Hari's CornerHumour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then
My reviews site redesigned
Site management by
Posted on Wed, Dec 20, 2006 at 13:24 IST (last updated: Wed, Sep 26, 2007 @ 15:21 IST)
Basic tips for Linux programming
Tutorials and HOWTOs by
Posted on Mon, Dec 11, 2006 at 10:56 IST (last updated: Wed, Oct 29, 2008 @ 22:00 IST)
Evaluate every available alternativeUnlike the unified Windows API which provides the Windows programmer with a single method of achieving a certain objective, Linux provides a variety of ways to achieve the same objective. For instance there are a variety of GUI abstraction toolkits, the major ones being QT and GTK to write GUI programs. Again, you need not necessarily choose C or C++. There are many choices for programming including basic shell scripting, Perl, Python and PHP. So do not always have a fixed idea that you need to learn the "hard" way. In fact, you might be surprised to discover the power and elegance of scripting. Do not be overwhelmed by choices. Just be aware of all of them and pick the tools and techniques that you're most comfortable with.
IDEs are not necessarily more productiveProgrammers who've used Microsoft Visual Studio extensively to do their development might find it uncomfortable to adapt to Linux's way of doing things. While there are some pretty decent IDEs in Linux including Kdevelop, anjuta and Eclipse, you might actually find that using a text editor and creating a make file to be a better idea in the long run. Particularly when you are developing Free Software applications, you might not want to tie down development to a particular platform or IDE considering that your code will be shared and other programmers might also be contributing to your project. While IDEs are not always bad, you might find developing smaller projects using a simple text editor and a makefile a better idea.
Do not look for distribution-specific featuresIt might surprise many Windows programmers to know that you can practically make no assumptions about a default Linux configuration on the end user's machine. Different distros use different configuration file locations and settings. Unless you're writing a system configuration utility for a particular distro, try and avoid distro-specific assumptions. Also never force users to run as "root" unless your application's sole purpose is to modify system specific settings.
Do NOT modify or attempt to modify system filesApart from being bad programming etiquette,
- You cannot assume that a certain system file exists on the end user's machine (because of distribution-specific differences).
- You simply cannot modify system files as a "normal" user and you cannot expect a normal productivity app to be run as "root."
Be consistent visuallyGUI programmers, especially GTK and QT programmers, need to understand that these libraries are heavily themeable (meaning that the end-user can modify the visual appearance of GUIs in almost any way possible - including fonts, colours and the widget appearance). Therefore, avoid using specific fonts or colours in your GUIs. You don't need them. Do not force your end users to install any particular font on their system. Leave your application's visual rendering entirely to the GUI library that you use. Unless you're writing a word processor you might hardly ever need to directly handle fonts in your application's code.
Be prepared to do some researchLinux does not come with an MSDN-like tool to provide you documentation for every single programming tool or API available out there. It's simply not practical because Linux is not developed by a single company. In most cases if you're using third-party libraries, you will be able to find documentation (either downloadable or online) on the official website of that particular library's maintainer. Also be aware that quite a few libraries come with incomplete documentation or none at all. You might have to look for sample code or even at header files to learn more about a particular library. Fortunately you might not encounter this situation in the case of most popular third-party libraries, but it's better to be prepared nevertheless.
Do not package dependenciesWhen you're creating a "distributable package" do not include dependencies along with your tarball. Just include the source and provide compiling instructions (the more generic, the better). Also mention the required dependencies in your README or INSTALL files and in your website. Since most Linux distributions have their own package management systems (and if you're application is good enough, it might even be included in the official package repository), you should leave the dependency handling either to the end user who compiles your program manually or to the distribution package maintainer who ships your application as part of his package. Since every Linux distribution has a different way to manage dependencies, do not interfere with it by creating an "installation" routine that tries to be smart and installs other libraries. Apart from creating versioning problems, it's simply tedious and cumbersome to include dependencies with the program. Also try and keep the dependencies to a minimum, particularly if your program tends to use exotic third-party libraries. Even if you're not releasing your program as Free Software, try and keep the packaging to a minimum and provide instructions to the user on dependencies. I hope this has been of use to you as a newbie to Linux programming. Happy programming!
Papa Hari's job interview tips
Humour and Nonsense by
Posted on Fri, Dec 8, 2006 at 21:32 IST (last updated: Thu, Oct 30, 2008 @ 08:08 IST)
Dress codeThe most important thing is the dress code. When you attend an interview, the first impressions you make on the interviewer count for a lot. Papa Hari recommends that you wear the following -- a pair of silky red trousers, a bright parrot green shirt, a yellow tie spotted with red dots and a pink blazer. Wearing a formal top hat and ray-ban sun glasses is highly recommended as well. After all, it's important to differentiate yourself from the rest. You will make an immediate impact on the interviewer with your neat, dignified appearance.
Your ResumeDecorate your resume with colour prints of your best holiday photos. Start with the phrase "I'm the greatest!" and use a variety of fonts, colours and styling. The more exotic the better. For instance, avoid "Times Roman" like a plague. Every other candidate uses it to the exclusion of all other fonts. Make sure that your resume speaks highly of you in every sentence. Never use the first-person. Always address yourself as "Mr. ABC is highly proficient in these areas... " and "Mr. ABC is highly trustworthy, competent and reliable." In short, your resume should be fairly sprinkled with glittering endorsements about the product that is YOU! Your confidence in yourself should communicate itself clearly to the interviewers.
TimingIt's extremely important to give the interviewer an idea of how important you are. Always walk into an interview nine and three quarters minutes late and when walking in to the interview, make sure that you're talking in your cell phone, preferably along the lines of "About that $10 million contract... wait till I get back to you. I have a meeting at the moment and I'll get back to you later." Interviewers respect important people and you immediately have something in your favour.
The most important questionThe first question that an interviewer will ask you is the famous opening to any job interview -- tell me about yourself. It's necessary to frame your answer along these lines:
"Pronoun. 1) The one identical with you. a) Used reflexively as the direct or indirect object of the verb or as the object of the preposition. example: did you buy yourself a gift? b) Used for emphasis. example: you yourself were certain of the facts. c) Used in an absolute construction. example: in office yourself, you helped push the bill along. 2) Your normal or healthy condition. example: Are you feeling yourself again?" Courtesy: thefreedictionary.comMost interviewers would be amazed at your knowledge and command over the English language.
Answering styleIt's not just about answering questions correctly but also stylishly. When an interviewer asks you a question, always nod your head intelligently and say "that's a very good question. I'm glad you asked it." And while thinking about your answer, always shake your head this way and that, rub your nose, scratch your chin and roll your eyes upwards. Every little gesture counts. Act like they're the media crew and you're a celebrity giving an exclusive interview. Make sure you give them the right impression and make them feel important.
Other miscellaneous tips
- Always smile broadly showing all your teeth at the end of every answer you give.
- Raise your top hat every time a question is asked. This is basic politeness
- Sit well back in your seat (if possible), purse your lips and put one leg over the other and keep shaking it. This shows that you're relaxed and comfortable. Interviewers like that.
- Never make eye contact with the interviewers while a question is being asked. Instead hold your chin in your palm and close your eyes slightly. This gives them the impression that you're really concentrating hard in absorbing the question.
The DRM issue and government intervention
Software and Technology by
Posted on Thu, Dec 7, 2006 at 17:59 IST (last updated: Wed, Jul 16, 2008 @ 21:14 IST)
If you don't like DRM, just don't buy products which have DRM in them. The technology is useful and governments should not interfere/put a blanket ban on its use. Also DRM doesn't affect FOSS, so why should I care?The assertion, in effect calls for passive resistance by the "market." Unfortunately, I see some big flaws in the above argument.
- Implied in the argument is the fact that if we (the small group of enlightened and empowered users) boycott those products, that'll convince the powerful global multinationals that the technology is not marketable and it'll be a failure. Unfortunately, it's a proven fact that the majority of software and hardware multinationals do not give a damn (to put it mildly) about the "enlightened" minority. Sure, consumer awareness is growing, but it's still nowhere near large enough to cause any major headaches for them.
- The second assumption is that the FOSS community will not be affected by the technology. I seriously doubt this but even otherwise, is this any reason not to be worried about DRM? What about the rest of the world? We certainly do not live in a vaccuum and whether we like it or not, anything that Microsoft, AMD, Intel or Sony does affects us directly or indirectly.
- Lastly, even if we, as individuals, are in a position to successfully boycott DRM-infected products, how practical would it be in the long run? Assuming a market where 80-90% of the products are DRM-enabled, how much choice do we have as consumers? And if the major multinational corporations do adopt DRM and Trusted Computing in a big way how can customers keep avoiding it forever?
Interesting article on customer service
Bits and Bytes by
Posted on Wed, Dec 6, 2006 at 12:34 IST (last updated: Wed, Jul 16, 2008 @ 20:48 IST)
A Linux rant from a frustrated newbie
Humour and Nonsense by
Posted on Mon, Dec 4, 2006 at 21:14 IST (last updated: Wed, Jul 16, 2008 @ 21:01 IST)