The Underscore is over-rated

After years and years of abuse, my pinkies can’t take it anymore and have hijacked my remaining fingers (and the thumbs) into writing this post.

So if you are a developer, a database designer, or just writes APIs or SDKs or programming languages or opensource code that other people will reuse, and if you love coding conventions, and if you like using the underscore ‘_’ as a separator, please STOP RIGHT NOW!. Think of all the little fingers that you will save!

If you are still not convinced, try typing Q_Q_Q_Q a few times. See?

camelCase is just as good for variables, and FirstLeretterCapitalization should be sufficient for functions names. It is bad enough that the curly braces {}, the Backspace and the Enter keys are so far away from the left little finger, and yet it has to cover all those keys – please don’t make it any worse by these horrible underscores!

The generation before us (the pioneers of computer science etc. etc.) probably started using computer keyboards in their middle ages, my generation (in Pakistan at least) started using computers in our teens, and if my son is a good representative sample, then TNG (The Next Generation) started using computers before they learned how to write. This means their poor little fingers will get an extra decade or so of keyboard exposure. The pioneer generation didn’t have a clue, but we do – most of us 30 somethings have aching fingers (or is it just me?) each day, after spending half the day in front of the computer. Let’s make the world a little more pleasant for our kids.

So the next time you get this urge to use the _ in your code, please reconsider. Thank you!

Installing Microsoft Reader on Linux (and why Microsoft Reader rules)

As I suddenly found myself using Linux as my primary OS last year, I had to do something about my bookworm’ey itch, and tried a few solutions to the lack of Microsoft Reader on Linux.

  • I tried using a second computer as my “book computer” – 50 minutes of work, one chapter of a book is what works for me. Too much fan noise (my PCs, like me, are pretty old by now) and sheer waste of electricity.
  • I tried a virtualbox XP installation – the problem with a virtual OS is, if I run it fullscreen, I can’t use the linux software, and if I run it windowed, the Microsoft Reader window is too small. I can dedicate my second monitor to the XP virtual installation, but that is plain inefficient.
  • I tried keeping my pocket pc with me while working, but what is the use of a large LCD when you end up reading on a 3.5 inch screen.

This weekend, I finally managed to make Microsoft Reader work on Linux with Wine. I had to waste use a couple of hours doing so, but at the end, it was worth it. So here is the fast and clean way of installing Microsoft Reader on Linux, what you need is:

  • Have a Linux installation (obviously) – I’m on Kubuntu, this should work with *buntu.
  • The following software installed: wine, msttcorefonts, cabextract – You can install it with the usual: sudo aptitude install wine msttcorefonts cabextract
  • IE for Linux – for some reason, this is a pre-requisite of Microsoft Reader on Wine.
    • Instructions on how to install IE6 for Linux can be found here: http://howtoforge.com/ubuntu_internet_explorer_p2
    • You might need mfc42.cab – in which case, just follow the link on the page, and copy the cab to the folder used by ies4linux, which was /home/rv/.ies4linux/downloads
      for me.
  • Now you need to visit the Microsoft Reader download page in IE6, and when prompted, “Open” the file from its current location. If everything goes well, you should end up with Microsoft Reader installed – now you just need to run it.
  • To run the program, you can either tinker with the Wine configuration settings to export the required wine prefix or you can create a shell script containing:
    • #!/usr/bin/env bash
      # Script to run MS Reader
      cd
      export WINEPREFIX=”/home/rv/.ies4linux/ie6″
      wine “/home/rv/.ies4linux/ie6/drive_c/Program Files/Microsoft Reader/msreader.exe”
    • Save it as something like msreader.sh, modify the /rv/ part (which is my username), set the file rights to a+x via: chmod a+x msreader.sh and perhaps, create a shortcut to the file on your desktop.
  • Running the msreader.sh should run MS Reader now!
  • There is the small problem of actually opening .lit files in it – you have two options. You can either:
    • Modify the script above so that the filename/complete path is passed to the shell script and used in the wine… line. This can also be set up with the ubuntu file associations so that you can open .lit files directly by clicking them. Or, you can
    • Copy the .lit files you have in your “My Library” folder (which is what I did).
    • I ended up with a library folder at: /home/rv/.ies4linux/ie6/drive_c/windows/profiles/rv/My Documents/My Library
  • Start the reader, and the new .lit files should be automatically detected and populated inside your library!

UPDATE: June 2009 One year later, things are a lot simpler with Jaunty Jackalope and Wine 1.0.1! Here are the rough steps to follow:

  • Make sure you have wine 1.0.1 – 1.1.x has issues that I was too busy to debug. If you have a later version or have the wine repository added to your sources.list. You might want to “Force Version” for that.
  • Install ie4linux using the instructions here. Ignore the wine version warning. You may have to run the script multiple times if it crashes, but you’ll get ie6 installed eventually. I had to uncheck the Flash plugin installation option.
  • Make sure you have the wine-gecko package installed (this may be a redundant step)
  • Download the MSReaderSetup.exe file from the Microsoft site using your regular browser and save it somewhere.
  • Run the installer .exe via double-clicking, or right clicking, or via command-line
  • The reader should install. The first time, try running it via command-line after going to ~/.wine/drive_c/Program Files/Microsoft Reader and typing ./msreader.exe
  • If you get an msvcirt.dll error, download the dll from here and extract the dll to your ~/.wine/drive_c/windows/system32 folder.
  • Now running the .exe again should work, and you should also be able to run it after searching for it by ALT+F2.
  • To be able to open .lit files by double-clicking, you need to set up the file associations. To do so
    • Right-click any .lit file in Dolphin and select ‘Properties’.
    • Click the settings icon besides the line Type: Unknown
    • Press the Add button to add the associated application (msreader) and use the file dialog to browse to the msreader.exe file. You will need to enclose the path in double-quotes or escape the spaces. For me it was:  “/home/rv/.wine/drive_c/Program Files/Microsoft Reader/msreader.exe”
    • Unwind the open dialogs’ stack
  • At this point, you should be able to open a .lit file by double-clicking it. If you encouter any issues or had to follow a different path, do share in the comments to help out others.

I was experimenting with tellico this weekend (which deserves its own post), and realized that in the last 20 years, I have read a lot more ebooks than paper books (which makes me happy when I think of all the trees I have saved). At this point in time, I can safely say that Microsoft Reader is the best ebook software around. Of course, you can read books in other formats, plain text, html, pdf or even doc, and there are lots of other readers (like Mobipocket) to choose from, but nothing beats Microsoft Reader so far. A few reasons why…

  • the Microsoft proprietary ClearType technology is simply the best option for long reading sessions on LCD/TFT screens. Once you get used to the lack of paper texture and the smell of an old book (one does miss it the first few months), you will probably find yourself reading more and more books on MS Reader.
  • The Microsoft .lit format works on Pocket PCs transparently, and the PPC version of Microsoft Reader comes pre-installed with most of the Windows Mobile versions. So, like an ipod, you can keep your library synchronized, and pick up on your PPC where you left off on your laptop/desktop. I can’t part with my ancient XDA II (now 5 years old), and iphone is a little bit less attractive due to Microsoft Reader – strange but true.
  • You can use the “Read in Microsoft Reader” plugin for Microsoft Word to convert most of the standard text formats that Word can open – to .lit format, and have a single interface for most of your digital library.
  • If you are comfortable with IRC and DCC, channels like #bookz, #ebooks etc. on Undernet is all you need to download and read sample hundreds of thousands of legal (and otherwise) books that are already converted to the .lit format.

It took me a couple of hours of search and experimentation (mixed with answering a few emails) to get all the steps right, so I hope this post saves somebody a few minutes of their lives.

Desktop Tower Defense – An Inspiration to Young Entrepreneurs

DTD turned one week old recently. I used to play a lot of Desktop Tower Defense (or DTD as it is more commonly known) when it was launched and went crazily viral, thanks to a bunch of popular blogs that covered it.

Paul and Dave, the two guys behind DTD, shared the figures (100,000$) that they have earned in the first year of this small but addictive game on their blog. They also shared the story of the creation of DTD. It is a must read for the young web entrepreneurs of Pakistan (and elsewhere). This one small flash game enabled them to quit their day jobs and start their own casual game firm by the name of Casual Collective. So go read it!

Over-Promised and Under-Delivered

It is better to promise little and deliver more, instead of the other way round – this is a valuable lesson that we shouldn't have to learn – it should be painfully obvious. And yet, when we enter the 'real world' with infinite energy and little experience but enough ambition to conquer the world, we hastily agree to overly optimistic deadlines. Most often, we end up revising the same deadlines that seemed easily manageable a month ago, apologizing to the boss/client all the time, and putting in all-nighters and watching in desperation as two new bugs surface after one is fixed. Then we grow up, and learn to multiply both time and cost by a number much greater than 1.0 before estimating anything. We still miss deadlines… but we feel less stupid about them, and can charge more in some cases… but I digress…

What I wanted to say is, PTCL botched it.

PTCL announced that they will double the bandwidth on the 1st of March. They failed to deliver on that promise, the reason: "it's a weekend, our staff is not available, we will do it on monday".

The bandwidth was still not upgraded the next week – the reason: "We need to upgrade the ports from Islamabad, so it will happen in a single transaction for ALL the Pakistani users".

Yesterday (14th of March, half the month gone), I got an SMS from PTCL when I woke up at noon, telling me that my package has been upgraded to 512kbps 'according to my request' – so I turned on my machine, but the router was still showing 256kbps. After 4 hours, I called their helpline and asked them why had they sent me the SMS when I was still getting the same old speed? The lady (who sounded overwhelmed) asked me for my phone number, and then told me that my upgrade was in its final stage, I asked her how many stages do they have, she said "four". She said it should be complete "any time now", so I said thank you and hung up.

24 hours later (almost 9AM, 15th of March, 2008), I still have the same speed. After looking at the time and realizing that it is morning already, I just called their helpline again (yes, you can call this live blogging too) and told the PTCL rep that I was getting the same old speed despite their SMS – the girl at the other end took my number, checked her system and told me "Sir, our systems are still showing 256kbps". I swallowed the compulsory "No shit!" retort (I am beginning to understand why they prefer female customer relations employees), and asked her why, with their promise of 1st March, have they been unable to upgrade the bandwidth after two weeks. Her response: "Sir, we had till the 15th of March to upgrade. You can call in one hour and check again".

Now this is not right! I can see that they had to rush their price-cuts to meet the competition, and I realize that the 1st of the month is when most of the customers would consider switching, so PTCL had to try to retain that segment of their customer base by promising them the shiny new deal – but why did they have to promise the exact date if they were unsure that they could handle the upgrade workload, why the hell are they still considering 15th of March as their deadline (which is from PTA), and more importantly, why can't they apologize about it, as they have basically swindled me out of 653.50 Rs.

After the prescribed one hour wait, I called 1236 again – this time their support gal simplified it for me and told me in no uncertain terms that "Many customers have already had their account upgraded, yours will be done soon too, perhaps in a day or two. PTCL has promised the upgrades so you will get the upgrade soon". I asked the same 'why promise…' question, and she gave me the same 'please wait for a couple of days…' response.

I would have been perfectly okay with waiting for a few weeks while PTCL upgraded, but the above situation has converted me into an irked customer (note: not a completely 'unsatisfied' customer, their actual wares are good, even though their customer 'service' is lacking) when they could have used the chance to convert me into a super-satisfied customer. I can survive with my current 256kbps, but I hate being manipulated like this. PTCL should fire its marketing department and hire a few more techs – to get things done.

Time to sleep.

Freelancers and Consultants Must Read This

FreelanceSwitch.com is a blog full of insights and resources for the freelancers and consultants of the world (For those wondering about what's the difference between the two, this link provides a good explanation). They conducted a survey last year, and published the results of the survey today. You can download the survey results here

A few statistics in the 50+ page report that I found very interesting are:

  •  32.6% of freelancers earn less than they can from full-time employment.
  • 80% freelancers would prefer more money.
  • Only 22% of the freelancers work less and earn more compared to their prior job-oriented careers… and yet
  • 88.9% of the freelancer are happier now that they are freelancing.

Some more interesting statistics, particularly for the Pakistani Freelancers

  • Referrals account for 89% of new work (so keep your clients happy)
  • 15% work comes through blogs (start a blog duh)
  • The hourly average rate for softwre developers is around 73$ (stop charging 13$ per hour Pakis, its the lowest rate in the world (besides Bulgaria and Indonesia) in the survey.
  • UK freelance programmers charge the highest rate (158$)
  • Of the industries categorized in the survey, software designers and programmers earn the most.

Let me know if you find anything else of interest in the survey pdf.

Oh, and do join the Pakistani Freelancers group on Facebook if you are one.