Month: June 2006

Humble programmer

This thing of Humble Programmer really got me. I think that, in the unlikely case that someday a wannabe programmer would come to me asking for advices on how to learn programming and how to become really good at it, I would suggest that he needs just two things – humility and will to understand. I have to be honest, I didn’t read the original paper by Dijkstra. I tried, but it is very long and the introduction is nearly as long, and … ok I know, I should have. Nonetheless I read books and magazines and grasped the idea of “humble programmer” elsewhere.
So, what so powerful in being “humble” at programming?
Well there is so much to learn, because you question your approach and your solution rather than the world. How many times, when the code is malfunctioning, do you blame Microsoft, the libraries, the kernel, the compiler?
It is easy to take for grant that the problem is someone else fault without really investigate the matter seeking for objective proofs. If humility is not for you, then you can consider it as a sort of attempt of substantiated arrogance. From my experience during investigations I realize that a) it was my fault (more or less subtle anyway) and b) now I better understand the system and c) not only I’ll avoid this problem in future, but also I’ll avoid an entire family of related problems.
It is a long time I don’t stumble in a compiler bug. Really. I was used to finding some back at Amiga days (Lattice C), and still some at the beginning of (my) PC era (Watcom C/C++), but that means 10 years ago. And that makes sense. Both Gcc and Microsoft Visual C are very mature products (ok, let’s forget for a while the problems with managed C++ and the like, these are young, recently introduced technologies). The chance of hitting a bug writing even non-trivial code are so far fetched that maybe it’s more likely being hit by an asteroid while walking in the street.
Anytime someone calls me invoking a compiler bug as the cause for a problem, my eyebrow automatically raises in a Spock-like manner.
The will to understand is the complementary force guiding to great programming. Every time you are in a hurry, twiddling the code to make it work, without really understanding what’s going on, you are in double trouble. First if you don’t understand what you are doing (that’s research? ;-)) you are likely to fill the matter with subtle problems ready to strike on your back as soon as you get distracted. Then you are wasting the chance to increase your comprehension of the system, the chance to better handle it in the future, you are intentionally keeping your tool chest from growing with new powerful tools.
Ok, humble, but boring, I’m quitting here 🙂

Deception Point

This book (Italian title – “La Verità del Ghiaccio”) is definitively confirming the idea I have about Dan Brown. I think that he is a master in writing addictive books, but he is equally poor in devising characters and plots. The scenario is the election of the president of the United States. There is the Good Guy who is the president in charge and the obviously Bad Guy who is the contender.
In the foreground there is the Hero (more specifically a Heroine) that is called in Antarctica to examine an amazing discovery made by NASA.
But somewhere there is the Evil Guy who is maneuvering in order to keep curious and too bright people away from the truth. The Evil Guy is using the mythical Delta Force a special army that has no limit for its action and is used in covert operations.
The heroine and her friends risk their life several times and at the end the reader (maybe earlier if he/she is attentive) discovers who the Evil Guy is and how the Good Guy will prevail.

Dan Brown is able to write a book which you can’t drop after you start reading it. There is such a strong hook at the end of each chapter that closing the book requires an incredible amount of will.
Aside of this he plays cheap trick to channel the reader attention, to make him/her ignore the obvious solution. It is impossible that any scientist, even if at the beginning of the career could think that sea water fills a shaft well above the sea level. There is no need for the polar base commander to send a group of valuable scientist to do measurement by feet during a storm when they could use a vehicle.
The deception of the Evil Guy is the very same of the other two books. The Evil Guy is someone that is put under so good-natured light that the reader cannot suspect. A False Evil Guy is proposed so the reader is further distracted…. As I said cheap tricks, already seen in the “Da Vinci Code” and “Illuminati” (“Angeli e Demoni” in italian).
So, it is a strange feeling, I couldn’t actually put down the book, but I couldn’t like it. What a pity.

Two computers are better than one

So you are at the office and you badly need Linux as badly as Windows. Linux hosts the cross compiler and the tool chain for your project, while Windows keeps you in synch with the rest of the company.Dual boot is, of course, the way NOT to go. From my experience you end by using just one system. Beside that Fedora Core 5 support for NTFS is, to put it mildly, rough. You can read NTFS partition, but you cannot write, despite all the claims you find on Linux-Ntfs website. If you are incoscien… ehm, brave enough you can even try a captive NTFS driver that is supposed to wrap windows NTFS drivers. These drivers are pre-built for Fedora Core 4 and I wasn’t able to get things working on FC5. I actually have some work to do rather than playing with the OS.
Another option I haven’t tried (yet), but that friends tell me is working well is to use VMware. This is a system virtualization software that runs below one or more operating systems letting them believe they are alone.
Anyway having two PCs is always preferred, it is just annoying that you need two keyboards, two mice, and it becomes quite difficult at copy’n’pasting between the two.
Until this morning.
This morning, while sneaking over Freshmeat I found x2vnc a nice hack that, using the VNC system allows you to share the same keyboard and mouse with two PCs, one running Linux and the other running Windows, as it would be one dual headed system.
Now when I move the mouse pointer over the left edge of the Linux machine, the pointer “flows” into the Windows screen. Move it over the right edge of the Windows screen … et voila, it’s back to Linux. It even works fine when the Windows system is at the login screen (i.e. no user has yet logged in). It is so sweet that Copy’n’Paste works, too.
Great Hack.

Time awareness

I find extremely difficult being aware of the time required for various activities. I usually underestimate the time it takes to do stuff. Maybe the trouble is the delta between the speed of though and the speed of life. Usually life is slower and much more troublesome.An interesting technique for dealing with the troubled nature of real world is to add a margin to you planning. In “Game Development and Production” Erik Bethke suggest to consider a day a week as non-working in the planning so to get estimations that can survive to occasional disasters the universe is so generously filled. I usually do this and I find it is good, nevertheless my estimations tend to be optimistic.
One of the point of being aware of time is to recognize when using something pre-made is faster than rolling your own solution. So at last I have to admit that rewriting a new version of my website software from scratch is not something I can do now.
It is true that since I changed my job I have more time at home, but it is equally true that my main source of development time was in train commuting (notebook PCs rule). And I can’t do software development while driving car (apart from the travel to be much shorter).
So at last I resorted to look around what ready made software could do. I found two package that look promising: Drupal and phpWebSite. Unfortunately both require an SQL database which is not available in my current provider subscription. So I spent a bit of time and found pDB a complete SQL database implementation in PHP.
So now it is only a matter of making one of those package to use pDB and I should be done, fast and easy… wishful thinking 🙂