Perl is not only a programming language but also a religion

This creates a problem when one wants to discuss the state of worshipping in the context of Perl.
bless is a reserved word in Perl, and it has a specific technical meaning.

Roget’s Thesaurus came to my rescue. It offered me three alternative words: hallow, consecrate, sanctify.

Now we can start hallowing whatever is holy and sacred in the magnificent language Perl.

Ubuntu Humor

MarkShuttleworth’s FAQ has the following passage in the answer to the question “What about the GCC 4.0 transition? Why did you adopt GCC 4.0?”:

“This was discussed with the Debian toolchain maintainers, who were themselves planning to adopt GCC 4 at some time (well, sort of involved the Ubuntu maintainer talking to himself, they are the same guy, …).”

Several minutes after reading the FAQ, I still find the above passage to be hilarious.

Note also Bug #1 in Ubuntu.

A Brief Look at C++0x

I had more than a brief look at (but less than deep study of) A Brief Look at C++0x, by Bjarne Stroustrup from January 2, 2006. I hope I would not have to deal with this monstrosity in future software development projects.

I prefer to deal with advanced concepts the FORTH way. Like LISP or SCHEME, have a way to roll your own programming constructs. On the other hand, have a seamless way to integrate with low-level programming languages such as C or assembly language.

Python, alas, still misses a way to embed a function written in C in a Python script to compile it on the fly and run it together with the rest of the script, to support low-level operations in an efficient way. FORTH, on the other hand, supports embedding assembly language in FORTH source code.

Instead of piling all levels of abstract concepts on a single language and run the risk of making its abstractions leak (see: The Law of Leaky Abstractions) and making whatever is going under its hood overly complicated and difficult to understand and debug, how about making different languages support different levels of abstractions yet seamlessly interoperate, like existing assembly language integrations into FORTH and C?

Law of Demeter

Law of Demeter
Introducing Demeter and its Laws

The degree of obeying Law of Demeter in a software application’s design affects its maintenance.
I am wondering whether the same Law or a similar one applies to the number of places one must consult in source code to understand something.

For example, if you define in C++ a macro which expands into a template, expanding in turn to a class which inherits from two classes and has a virtual function – how many source code files do you have to consult to understand what exactly is going on in the original macro expansion.

Or, a simpler case: you #define a macro which expands into a curried function call.
You #define another macro, which curries a further argument in that function call.
Then you’ll have to consult three different places in source code in order to understand the function call.

There seems to be a trade-off between maintenance needs (ability to modify the software by editing at one place and easily grepping the entire source code base to rule out any special cases), and understanding needs (ability to understand everything about a variable or function by referring to its definition/s at only one place; possibly not having to grep for more than one pattern in order to match all uses of that variable even if they hide inside macro definitions).

Did anyone else research and/or write about this issue?

What is the word length of the computer that the IRS use for Bill Gates' taxes?

According to Microsoft founder too rich for tax computer to handle, IRS need to use a special computer to store and manage Bill Gates’ tax return.

Given that Bill Gates’ fortune is now $47×109, how many bits are needed to represent it?
Dollars: 47×109 = 0xAF16B1600 i.e. 36 bits (not including the sign bit).
Cents: 47×1011 = 0x4464DD49800 i.e. 43 bits (not including the sign bit).

Maximum fortune which can be represented in 31 bits (signed) and 32 bits (unsigned):
231-1 cents: $21,474,836.47 or $21 million
232-1 cents: $42,949,672.95 or $42 million

If only dollars are represented, then billionaires can be accommodated ($2,147 millions in 31 bits, $4,295 millions in 32 bits).
Thus, if IRS ignore cents, they need the special computer to manage tax returns of several of the billionaires having tax relationships with USA. So Bill Gates probably is not the only one, whose taxes require the IRS to use a special computer.

Mort, Elvis and Einstein – don't forget also Busy Shula and Maxwell!

Sriram Krishnan’s famous “Lisp is sin” article (shredded to tears in reddit.com) was mentioned in Lambda the Ultimate. In this article, I met for the first time the Mort, Elvis and Einstein trio.

While I did not know them at the time, the concept evoked in me painful memories. You see, nine years ago I worked on a project, which needed a sophisticated control for navigating through an hierarchical decomposition of a widget (tree control, in other words). This control was critical for the project’s ultimate success, so we spent a lot of time trying few versions and polishing it. As the project progressed, we used the control in few places in the software. Since each place had slightly different requirements from the control, I developed it as a C++ class with virtual functions. Each client of the class inherited from it and overrode some functions.

The design was very beautiful, sophisticated and a source of pride for me.

Eventually I finished my work on the project and phased out of it. The project entered a maintenance and enhancements phase. For this phase, other software developers were hired. Few years later I met the project leader and asked him how things are going.

He had me floored by telling me that his programmers had to re-implement the tree control class. The original design was too complicated for them to understand it!

Every time I feel bad about the absence of LISP and its ilk in mundane software development jobs, I recall the above painful anecdote.

Now that I know about Mort, Elvis and Einstein, I can see that my beautiful tree control was Einstein-level work, requiring Einstein types to understand it, apply and extend it. However, the maintenance programmers, who followed me, were Mort types. Groan!

Definitions of the trio can be found in:

I have an issue with Microsoft’s definition. They define Mort as a VB programmer, Elvis as C# programmer and Einstein as C++ programmer. I feel that this is too narrow spectrum of programmers.

I would like to add to the spectrum a persona to the side of Mort. This persona, called Busy Shula, is a courteous and busy secretary. She is very good at her main work. She just is not trained to program computers. She fiddles with configuration files to optimize the way her PC is facilitating her work flow. Some applications have configuration files which are really programs (like Tcl or Emacs’ elisp). So she sometimes gets exposed to programming concepts.

On the other side, there is Maxwell. He is a programmer, for whom C++ is not expressive enough. He devours the special assembly languages used by microprogrammed processors in the morning, and groks the most convoluted LISP, Haskell and O’Caml concepts at night. He also hold on his own when discussing parallel programming and even hardware design issues. He invents new programming languages and even new processors.

I believe that the best way to accommodate all those personas (Busy Shula, Mort, Elvis, Einstein and Maxwell) is to design a powerful library system for a powerful computer language (Scheme comes to my mind as a candidate). The library will feature high-level abstractions, which are convenient for the Morts and Elvises. The Einsteins and Maxwells will be able to look under the hood, rewire, and extend as necessary.

If a Mort or an Elvis gets bogged down with a problem implementing a new feature, he needs to have an Einstein on call to help him with the difficult parts of his work.

On the other hand, the Einsteins and Maxwells would not be bogged down with the tiny UI tweaks and polishes which differentiate among amateurish&irritating UI look and feel and professional&pleasant one.

Busy Shula also needs to have a Mort around to help her whenever configuration work is so extensive to constitute real programming.

Scratching a bookmarks itch in Mozilla

This tip may or may not be relevant for FireFox or more recent versions of Mozilla.

I have a long, hierarchical and mostly unsorted list of bookmarks used by my installation of the Mozilla 1.7.8 browser.
There is a search box, which allows me to locate a bookmark using text matching.

However, if I want to add a new bookmark and have to find the appropriate folder to which add it, the search box is useless for this purpose. Even if it finds me other bookmarks filed in the right folder (based upon their subject), it does not show me in which folder those bookmarks are.

The following hack solves the problem. The directory names are correct for Debian Sarge. If you use another Linux distribution or another OS, YMMV.

Look for the bookmarks.html file in your ~/.mozilla directory, load it (as a regular HTML file) in your browser, and bookmark it!
Its URL will typically be: file:///home/yourusername/.mozilla/default/something.slt/bookmarks.html

Next time you need to search for the folder where to add a new bookmark, load the bookmarked bookmarks.html file and run standard text search (Edit/Find in this page; usually bound to CTRL-F).

Then you can happily add your new bookmark to the best folder for your purposes.