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!

Graph of Thought

chainA phrase that has been really bothering me since I was a teenager is “Chain of Thought” or “Train of Thought” – it even has its own wiki page! As I have recently realized that one use of blogs are meant to be a personal ranting space, so let me do that.

A chain is a lot like a vector, so when I hear the phrase “Chain of Thought”, I see a thinker/brain jumping from link to link, much like an iterator, and most of the links are identical. I don’t think like that, and I’m sure most people don’t either.

When I try to visualize thinking, the picture that comes to my mind is that of a set of stacks, with thoughts popping out of some and being pushed into others.

At other times, thoughts remind me of a tree, with the brain traversing it, sometimes depth first, and sometimes breadth first, but more often, thought looks to me like a graph, with the brain hopping from node to node however the hell it pleases.

A tree is a graph, and a vector is a tree, so why do we have to chain our thoughts by making them look like they follow a linear pattern? They are seldom that linear! Ok, a “Graph of Thought” sounds modern, but trees have been around for much longer than chains!

To me, analogies and models are dangerous oversimplifications. Whenever we use a model to represent something, the thing that is being represented loses a certain part of its being. By sticking to a chain model, we are simplifying our thought process, and perhaps, becoming just a little bit more stupid in the process. I say, let us kill the phrase “Chain of Thought” and climb one teeny weeny step higher on the ladder of evolution.

After this post, I will take the nested brackets that I love (and I do love them (honestly (yes, this is a forced example))) as deep as I want to, without bothering about grammar.

Grammar needs a redesign.

Your Privacy is an Illusion

WhitehatWhat would you do if your laundry-shop published your laundry bills online, along with your name, address and phone number, for the whole world to see?

 

A couple of months ago, while trying to understand Pakistan’s perpetual energy crisis situation, I entered the LESCO website hosted at http://www.lesco.info/. As soon as I clicked the Customer Service link, I was teleported to a consumer privacy and security hell. I closed my browser after going through a few pages, hoping that the website would disappear like a bad dream, and tried to forget about it. Two months later, the website is still online, so I think LESCO doesn’t have any plans to take it offline. Meanwhile, I have gone through the five stages of grief, laced with a few non-standard stages like ‘hilarity’ and ‘helplessness’ that Kubler-Ross probably hadn’t thought of, so now I can write about this joke without affecting my blood-pressure and general sanity.

When you enter the webite, you are rewarded with a pre-filled login form. You heard me right – the form is pre-filled with the username “Guest” and password “*******” (hehe) for your convenience. The links at the top are pointing to a certain firm called Clicksoft and are broken, but you can still visit the Clicksoft website to hear their amusing pitch:

ClickSoft is a groundbreaking software development organization providing high-end technical solutions. Our customers benefit from our vast experience of Enterprise Resource Planning (ERP) software solutions for demanding mission critical environments in, retail and wholesale, manufacturing, financial services.

I will not pass any judgement on their claims, but I do wish that their prospective clients do a little research on them before handing them any business.

 

After you “log on” to the LESCO /mc/ website homepage as a “Guest”, you are handed a search form, but not just any form – this one has the special power of letting you search the complete LESCO database!. You can search by any field, including customer name, their address and even their neighbor’s bill. By the way, from the search forms, it looks like many people are born with “through”, “Col” and “Officer” in their names.

I am a big proponent of transparency, but LESCO has taken it a bit too far! You can search in Applications and you can search for Consumers and even browse various LESCO locations. The real gem, though, is the Feedback Form. It allows you to “Change Password”! Yes, the same password that was embedded in the login page (*******)… A classic case of WTF!

If you think it ends here, you are wrong, LESCO has one more surprise for you. Visit the Reports section and you will come across URL masterpieceslike:http://www.lesco.info/mc/default.php?action=35&where=%20where%20c.app_date%3C=’2008-05-06′
%20%20and%20substring(c.loc_code,2,1)=’2’&circle=&desc=Demand%20Note%20Paid
All ten year old script kiddies and their pet parrots know the kind of malicious things that are possible with a little bit of SQL Injection, so I will not spell them out here, but apparently, the “Regional Training Centre LESCO”, who own the website, are still trying to figure out how to create websites. With employees like these, who needs corporate saboteurs?

So, coming back to the original question (“What would you do if your laundry-shop published your laundry bill, along with your name, address and phone number online, for the whole world to see?”), if your answer is “Nothing.”, I will understand. The rising oil and food prices have probably pushed things like data privacy towards the bottom of the list of things to worry about. Consider yourself lucky though, if a telemarketer discovers this treasure trove and a vaccum cleaner salesman comes aknocking at your door two days after you apply for an electricity connection. It would certainly be better than having your identity stolen. and a lot more entertaining if you are like me.

I did some research on consumer privacy and identify protection in Pakistan to see where the consumers (that’s you and me) stand, and discovered that Pakistan is yet to have a consumer rights protection law. Besides Babar Bhatti of telecompk, who writes about the topic frequently, and Dr. Awab, who urged me to write this post, I did not find any Pakistani bloggers who have shown serious concern about consumer data privacy in Pakistan on their blogs (though my google search session was brief). I did stumble upon websites for entities like Consumer Rights Commission of Pakistan and The Network, but have yet to read what they are all about.

On the bright side, incidents like this make one think that perhaps the lack of ecommerce in Pakistan is actually a blessing in disguise. What do you think?

PS. For those too busy to visit the actual website, I’ll try to upload some screenshots soon.

PPS. No bytes were harmed or abused in the writing of this post.

Kubuntu 8.04 with KDE4 – the Final Verdict

There are dozens of blogs and websites passionately ranting or raving about KDE (passion is one thing that the open-source community seldom lacks). As I have been using the latest Kubuntu Hardy Heron for almost a week, so I think I am ready to form an opinion about it. Here goes…

My second day with KDE4 was spent playing with plasmoids while installing the essential software in parallel. Plasmoids are to KDE4 what widgets are to the web (these days). Plasmoids are mostly eye-candy, but can also be full of fun features. After developing in Qt for last few years, I can safely say that plasmoid development is going to be a fun activity for the developers – and if KDE4 manages to get the escape velocity required to make it leave the linux environment and land on the MS desktops, a big development market will be built around it.

On day two, I searched Adept for all things plasma / plasmoid, and discovered extragear-plasma, which, as the name implies, has a few more plasmoids to play with. The comic strip plasmoid is fun, though you can only begin from the latest strip and go backwards in time from there (and so, requires more navigation features).
Then there’s KDEtwitter, but it eats up a lot of valuable pixels, and does not hyperlink the urls in tweets, so I had to stop using it after a few hours.

Learning to find my way around it wasn’t so hard. A few useful shortcuts and gotchas:

  • Ctrl+F1 and Ctrl+F2 switch between desktops.
  • Ctrl+F12 shows the desktop, and you can interact with the plasmoids before pressing Esc to go back to the normal view.
  • You can use the plasmoid resize handle with Ctrl to freely scale it, or Shift to maintain the aspect-ratio.
  • You can remove the panel (taskbar in Windows) quite easily by editing a text file. I think having a GUI based desktop editor should be a top priority for the KDE4 developers. Here’s how to completely remove the panel.
  • I didn’t notice this behavior in the earlier versions, but, your Trash can resides in your home folder, so if you delete a huge folder from a removable drive, it is actually MOVED to your ~/ folder – I deleted a 34GB folder and saw my harddisk run out of space due to this behavior. Irritating!
  • Shift+Del skips the Trash can and just deletes the files.
  • Apt urls – like apt:gparted – work, and automatically install the linked package.

I also found a lot of interesting arguments about the evil or revolutionary KDE4, here are a few of them:

While the KDE4 attempt to redefine the desktop may not be evil, it requires getting rid of a LOT of old (but not necessarily bad) habits, and right now, I don’t think the retraining is really worth it. A few examples of what I mean:

  • I can’t drag/drop files plasmoids into one another. I was used to dropping a .txt file on my desktop to the kate shortcut to open it, a divx file to the vlc shortcut, and so on… but now, I can’t drag an html file plasmoid to the kate plasmoid to start editing it right away. Drag/drop into an open application (.txt to kate or .html to firefox) isn’t supported either.
  • The context menu for plasmoids is very limited. I can not right click that same .html file to open it in any other software besides my browser (or atleast I haven’t discovered an easy way to this).
  • I can’t right-click a folder on the desktop and add it to an archive so that I can mail it immediately! This is a feature I have been using for years now, but suddenly, KDE4 has taken it away from me. Now, I need to go to a konsole and zip it manually.
  • There is no quicklaunch plasmoid. I have added a bunch of application shortcuts on my desktop, but I liked those tiny quicklaunch icons better.

So, KDE4 wants you to remember: “A plasmoid is not a file” and “A Desktop is not a folder”. While this new desktop may be semantically accurate, but practically, it has been very inefficient for me so far. Maybe I need to discover some magic tricks hidden inside KDE4 to be more productive… or maybe I am just an old dog who doesn’t want to learn new tricks. I will continue using it though, but mainly because reinstalling everything from scratch is too much effort, and because Yakuake, which is a “quake-style terminal” that I can open by an easy shortcut, is helping me do most of my work on the console.

Finally, if you ask for my recommendation, I will tell you to stick to the KDE3.5 version of HH, unless you are curious to see what the fuss is all about, or unless you intend to be an early-adaptor who wants to be an expert developer for KDE4 when it hits the mainstream.

Analog Big Clocks, Digital Encyclopedias

Image

Sorry about the “Big” in the title, yes, it is out of place, but I thought ABCDE would look pretty.

Thanks to KDE and its plasmoids, I have rediscovered analog clocks this week – the last time I checked (pun intended), I was using a digital clock all the time (pun not intended – seriously), but all that changed after I used the analog clock in KDE4 (featured in the picture here) this week. It’s not that the clock is pretty (which it is) but that I have realized that a digital clock only shows you an instance in time, where as an analog clock has a lot more information packed into it.

Right now, it is 12:51AM in the digital clock (since I’m on windows), but those numbers themselves don’t tell me much, besides the fact that it is 12:51AM. An analog clock, on the other hand (uh, sorry) not only tells me that it is 12:51AM, which is almost 11/12th of an hour after midnight, it also makes me think remember the recent past, the dinner I had at 10PM, the ex-student that I met after 6 years at 7PM while coming back home from a meeting at 5PM, all the way back to 8AM, when I woke up (I’m still proud about waking up at 8AM after many many months). It also shows me the time I can allow myself to write this post (10 minutes) before I must go to sleep (for 7 hours) so that I can wake up at 8AM again. I don’t know about you, but with a digital clock, I had to consciously think about all of this after looking at the time – but looking at the analog clock triggers these thoughts in the back my mind. A digital clock never did that!

So… no more digital clocks for me, I’m installing a windows widget for an analog clock (a digital analog clock would be an oxymoron) when I wake up (at 8AM).

In another related incident, tonight, my son’s bedtime (Barney) story featured Mrs. Goldfinch, who looked up the name of a multi-colored egg in books (it was a “dream-maker” egg), and my son’s immediate query was, “Why didn’t she look it up on Google?”.

We need a new set of books, and it is a good time to enter the children’s book market. Any takers?