Why should I bother ?

Warning: This is a rant. Feel free to ignore

I love coding in Python, and in spite of some of the occasional issues it can cause, I feel that it lets one accomplish whatever one wants to do with the minimal amount of magic incantations. So naturally, I have been trying to convince my friends from college to try out Python, but after a few incidents I’m not so sure if I have been doing the right thing. Couple of events will explain the situation:

Scene I – Interview for positions in one of the “big four” Indian IT companies:
Friend of mine has Python listed under the skills sections in his CV
Interviewer: ওরে বাবা তুমি তো পাইথন জানো। (TRANS:Wow (in the sarcastic sense) – you seem to know Python)
Friend: হ্যাঁ (TRANS:Yes)
Interviewer: আচ্ছা Java জানো কি ? (TRANS:So, do you know Java)
Friend: যতটুকু কলেজে পড়িয়েছে, ওইটুকু, তার থেকে বেশী জানি নাহ (TRANS:Not much, just whatever they have taught in college) (the college course covers Java as an example of a Object Oriented language, so it does not go very deep)
Interviewer: আচ্ছা, এটা বল তো… (TRANS:All right then, answer this)
Interviewer: pretty convoluted question from Java – involving complicated API stuff and such
Friend: বলতে পারবো নাহ (TRANS:Sorry, I can’t answer this)
Interviewer: যা, এইটুকুই জানো না, আর পাইথন ফাইথন কী সব শিখে ফেলেছ ? (TRANS:Bah! You don’t know such basic stuff, and on the other hand, you have learn’t Python and whatnot!!)

Needless to say – the guy did not get selected, and got rid of Python from his CV.


Scene II – Yet another interview, this time for a “research” position in academia
Friend of mine has been learning PIL, PyGTK, etc and has Python listed in his CV
Interviewer: আচ্ছা, এই পাইথনটা কি ? (everyone in interview panel make weird facial expressions) (TRANS:So, what is this Python “thing”?)
Friend: <explains>
Interviewer: আচ্ছা এটার এরকম বিচ্ছিরি নাম কেন ? (TRANS:So, why does this have such a weird sounding name?)
Friend: <explains, mentioning Monty Python, etc>
Interviewer: দেখো, আমরা তো এসব জানিনা, আমরা সাবজেক্ট জানি। তুমি বরং কি সাবজেক্ট জানো বল (TRANS:Look, we do not know these things, we know “subjects”. What “subjects do you know ?)
<..and the interview continued with some very standard (and stupid, IMHO) questions (most of which, I believe are lifted from this particular book). My friend answered all of the questions, except for one.>


Friend later tells me: ওইরকম মুখ বানালো – ওই দেখেই বুঝলাম হবে নাহ্‌ । আমি আর কোথাও পাইথন জানি বলছি নাহ্‌ । (TRANS:From their expression on hearing the word Python, I knew I was not going to crack this interview. I’m not going to mention Python in any future interview.)


When the first incident happened, I thought it was a isolated case. But after the second one, I don’t think it is (and there has been at least one other similar case as well). In fact, when the campus recruitment started for our batch in college, a very senior and respected faculty member told me that my chances of getting placed from college was very slim. I did not appear for any of the recruitment programs (and almost got fined by the college authorities for being “absent”), so I did not get the chance to test out his theory – but that’s a different story altogether.
For the second incident, one may claim that the interviewers were perhaps looking for someone who had a good “theoretical understanding” or had “strong fundamentals”, but I have my doubts (primarily due to the generic crappy questions that were asked afterwards). The first incident on the other hand, points clearly towards something being very wrong with the interviewer.
The question that arises after all this is, why should I ask people to learn Python, or for that matter anything that is not covered by the officially sanctioned syllabus ? On one hand, our “progressive” political leaders and leaders of our various industries speak about nurturing and enhancing “talent” to build a better India, and what not. In the real world on the other hand, at the very ground level, the same institutions that the leaders are supposed to be the patrons and creators of, encourage nothing but mediocrity. End result: each year, thousands of bright young students get turned into zombies. What a terrible waste… what a terrible waste…

Minor update: I realize that many have mistakenly assume that the requirements in the first interview had something to do with Java. It did not. It was a fresher interview, conducted during campus placements, and the students were expected to have zero experience. Many of the students who were actually selected were either placed in testing, or in .Net (mostly building/maintaining/troubleshooting ASP.Net/C# sites)

Updates..

This blog has not seen much activity in a while, so here goes:

  • Bought a HCL touch-screen based netbook. It’s somewhat ancient hardware, but most of the stuff works out of the box (except for the webcam, which does not even show up in lshal or lsusb). The touchscreen required a binary driver – but a Free/Open Source version seems to exist, though I could not get to calibrate the screen with the FOSS driver variant
    [Update: The webcam works - I had to press Fn-F5 to enable it. It is turned off by default to conserve battery.]
  • Taught myself (this was long overdue – but at least now I can admit that I did not know what I used not to know) how to properly write Python extensions in C. I started out with bindings for Hunspell (I’m reading up a bit on morphology nowadays, and finding it to be tremendously entertaining). There was a Python extension for Hunspell already, but it did not compile for me, and that pushed me to decide to figure out how to do this myself. One thing led to another, and so, as of now, there is (in progress) extensions for handling:
    • Hunspell. Usage instructions here
    • libgettext-po. This should be faster than the existing pure Python based PO file parsers out there. (maybe at some point, I could make Pootle/Translate Toolkit use this, and make the work of OLPC/Sugarlabs translation team members somewhat less frustrating.
    • XKB. I must admit that I took a shortcut for this, and this extension is actually based on the awesome libxklavier. The final plan is to develop a Sugar extension for managing the keyboard options and layouts using this extension. The code in the main git repository, though fairly complete in terms of what is required for Sugar at the moment, is not implemented via (py)gobject. Implementing the pygobject-based wrapper is turning out to be a bit more complicated than I initially thought, but some code for that is also available in this repository (it is somewhat easier now, since I know (at least most of of) what is happening under the hood).
  • Released a newer version of the FBReader activity, which is much more improved in terms of usability (eg: response to the game keys keys while the XO-1 is in tablet mode is much more smoother, and all the keys do something useful). People seem to be happy with the new release.
  • Coming back to the present, right now, among other things, I’m working on a few interesting (and important) enhancements for the book-reader(s). Some of them include support for long keypresses (eg: pressing the “square” game key for two seconds will show the table of contents), notification of critical power events (I realized to my horror during dogfooding, that in tablet mode, while the book reader is open in full screen, there is no way to tell how much battery-charge is left), etc. The bookmark support feature that I came up with a few months back needs a bit of polish, but I think I can make this show up in the next release of Read.

Free software translations for people who do not know English

Whenever we work on a PO file, we usually translate from English to the translate language. However, recently at OLPC, we had some Aymara translators who did not know English, but were quite comfortable with Spanish. We had been receiving such requests for supporting the display of an intermediate language in our translation system for quite some time now, and it was also a prominent feature request for Pootle, the web based translation software that we use. I was feeling a bit bored with my usual work, and decided to see if I could do something.


The straight forward way of implementing the feature would be to add yet another user preference which would store the list of languages in which the user would want to see the translations, but that seemed to involve significant amount of coding, and I was too lazy to do that. After thinking for sometime, I decided to take a short cut which should help us quite nicely now. Pootle can optionally show it’s interface in a non-English language, and I thought I would take advantage of that. Within around an hour (which included figuring out some of the Pootle code and understanding jToolkit), I had a patch which produced this:
Pootle with an intermediate language
So, if you select your UI language as Spanish, along with the original msgid, you will also get the corresponding Spanish translation when you are translating a message. I think this should do for now – though the “proper way” is probably the right thing to implement at some point.