2
April
2007
I was lucky enough to be in NYC when the Allman Brothers Band started their annual Beacon Theater concerts run. And I was even luckier to see them perform ‘Dazed and Confused’. Yes indeed. Zeppelin’s. I’m not confused (though I was somewhat dazed by their cover). It started with ‘In Memory of Elizabeth Reed’ which evolved into ‘Mountain Jam’ from which they moved to ‘Dazed and Confused’ and shook everyone. Then back to ‘Mountain Jam’ and finally ‘Whipping Post’ [1]. Surely the best concert I’ve been to.
1 A complete and vivid review is available here
Posted under Music
11
February
2007
It occurred to me yesterday, while playing with the Ruby script I was writing, that it would be useful to have a let facility in Ruby, which would enable the following code
def foo
# do something really exciting with the object 'master_foo'
# now...
master_foo.select { |x| x>3 }.let do |mf|
puts "#{mf}, #{mf.length}"
end
end
What is it good for? Well, instead of introducing a new local variable and using assignment to hold a temp value (like the result of the select call above), we can add a let method that simply yields itself to the block it gets. Something like
class Object
def let(&block)
yield self
end
end
which enables the following silly example
"hello cruel world".split.let do |p|
puts "The number of words in '#{p.join(' ')}' is #{p.length}"
puts "and the second one is '#{p[1]}'"
p
end
instead of
p = "hello cruel world".split
puts "The number of words in '#{p.join(' ')}' is #{p.length}"
puts "and the second one is '#{p[1]}'"
Well guess what? The upcoming Ruby 1.9 release a new ‘’tap’’ method is included that is similar, though not identical.
Posted under Programming languages
18
December
2006
When I was 12 or so I was a real Beatles maniac. I had all of their albums, I went to Liverpool and visited Penny Lane and Strawberry Fields, I even went to visit the Abbey Road studios. Time has passed and I grow cynical and older and my music preferences have evolved to an eclectic blend of Jazz, Blues, Progressive Rock and Punk with my current Heroes (to mention a few) being Miles, Coltrane, Hendrix, the Allman Brothers, Patti Smith, Robert Wyatt, the Pixies, Joni Mitchell and so many more. It is surprising (or is it?) and refreshing to suddenly realize how great their (the Fab Four that is) music still is.
I couldn’t resist buying the latest Love album and I’m glad I couldn’t. What a sweet journey.
Posted under Music
25
September
2006
Got to admit it, I’m a language coward. 3 times in a row I have chickened out and didn’t go with the programming language I knew was the right one for the job. Even though my recommendation would probably be accepted. And it gets better – once it was in my company, where I was the CTO (and founder). What a wimp.
It occurred to me after reading Yegge’s interesting but long post (aren’t they all) of his now (or was it then) favorite programming language. I, just like him, was and still am, on a holy-grail quest of finding the ultimate programming language. Elegant, efficient, with lots of libraries and easy FFI, concise, extensible and multi-paradigm. And guess what? I’ve found it, only to discover that even I can’t stand behind it and advocate it to my fellow (or subordinate) developers. After all, who enjoys these “not another crazy idea” look in their eyes. Just like with any leader/follower situation, the leader’s biggest fear is to lose his followers. And how easy that is when you come with this fancy, academic language which nobody really uses and will look plainly odd on their resumes. Does it really matter it implies a better programming experience? Probably not.
Ah, wonder what was that language? Well it wasn’t any language in particular although more than anything it was Scheme. And oddly, scheme is pretty familiar to many people much more so than the arcane OCaml or Erlang.
Will I ever be manly enough to do the right thing? Sometime I get carried away in dreams of an Utopian programming position when I will be expected to make bold decisions and will be given enough room to go with what I feel is right. Sounds too good? Well, doesn’t that sound like a research position? And if so, will choosing the right language is limited to research and out of scope for what is considered to be real-world? Probably and sadly, yes.
Posted under Programming languages
17
April
2006
Developers love to optimize. They love it so much they will often engage in it too early, a habit so bad it will frequently back-fire. But even the mature ones will happily pursue that ultimate sweet goal – making that code run faster or use less bandwidth, or consume less space. We all want that warm fuzzy feeling of achieving 53% improvement, and then 15% and then, pathetically, the last 2.71% .
It is probably due to the immediate and accurate feedback that optimization gives us. It is measurable and involves no smart-ass manager’s opinion or some client’s subjective impression. It is the perfect ego booster. It is also an enjoyable process during which we can test some tricks and resurrect our old passion for data-structures 101.
The flip side of it is bad, ugly, non-reusable code. That is, most of the time optimization and especially micro-optimization, will result in transforming the naively elegant structure of the code into a hairy beast that runs faster but smells. A harsh fact. I was always amused to see that programmers write “dense” code when trying to optimize a lot. That is, for some odd reason the variables names are always a single letter, with less spaces per line sometimes even fitting multiple statements into a single semi-colon separated line. As if by taking less space the code would run faster.
Unless of course you have meditated on it long enough to understand that there is another, even more elegant way of solving the problem at hand. And not only is it elegant it is simpler and faster. This is macro-optimization and is the true reward of programming—solving a problem the second time after reaching enlightenment. Sweet indeed.
Posted under Software development
16
January
2006
For the last 2 months or so, I’ve been experimenting with my own version of the hipster PDA . Mine is rather flat, that is I keep no separation into projects. There are 2 stacks of cards one for todo lists and one for meeting summaries. The later doesn’t follow any conventions, I just take notes there (and the limited space forces me to be more concise; hurray to that).
With the todo list I did try to come up with some structure. Every line starts with a name of the person in charge1. The line is slightly indented so I can put one of 3 marks next to it:
- ‘v’ when its done
- ‘d’ when it is deferred
- ‘x’ when it is obsolete
Every “closed” line is marked by one of the above marks and is highlighted (I picked it up somewhere from 43folders). This way it is very easy to see what are the opened tasks.
A task becomes obsolete when I realize it was a stupid idea to begin with, and what-the-hell was I thinking when I jotted it in the first place. I love these tasks. A task is deferred when it stays too long as the only open one in its card. Put it differently it is the only non-highlighted one in its card. Since I can not make it obsolete (darn), I move it to the latest card. This sounds a bit tedious but practically it isn’t as your motivation to close those tasks which you keep dragging around increases.
I find my self scanning all the cards a couple of times a day, looking for open tasks and picking up those which seems to be more relevant or more annoying (depending on my productivity meter). Again it sounds tedious but it isn’t. This linear process makes it harder to neglect tasks and thus is pretty helpful. For me this life hack works which is more than I can say of any other trick I’ve tried.
1 Believe it or not they let me supervise programmers ;)
Posted under Life hacks
12
December
2005
I can’t help admiring the technical achievement in making an Ajax-based browser-resident Outlook clone. I also can’t help thinking how I consistently failed using Outlook as my email client [1] . So, do we really need such an application? Isn’t gmail enough? I wouldn’t be surprised if despite the latest hype surrounding Ajax applications we’ll really be using those who prove to be simple and functional rather than those which mimic their desktop ancestors with great self indulgent.
A recent Nielsen article confirms this. The naive browser interface that we’ve grown accustomed to is a blessing for many applications. It makes simplicity shine by forcing the developers to abide to the html’s restrictions hence forcing us (the developers) to actually refine the functionality and the user experience so it’ll fit a (relatively) limited UI platform. It is also by now a standard platform which is known to be powerful yet simple enough for a great deal of application.
Indeed elegant (read simple and concise) user experience is not outside of the Ajax reach, yet Ajax developers are much more likely to jump through hoops if they only can. Surely you’ve seen a grinning programmer after he finally got to use that library/API everybody is talking about. Frankly most of the time we are concerned more with our (programmers) own delight than the users needs. While Google did miracles (as always) with gmail and 37signals are, well, 37signals I doubt will see a lot of such fine Ajax based applications.
[1] ...and run away screaming into the loving arms of Thunderbird or M2. Actually MS Project also proved to be a software I simply failed to learn how to use despite repeated attempts. I honestly tried to overcome my inherent inclination to use an MS product, but these two applications turned out to be so annoying, so rigid and so different from what I expect from an application that I just gave up.
Posted under Software development