Toxic Elephant

Don't bury it in your back yard!

Skipping Python for Ruby

Posted by matijs 18/01/2007 at 18h59

Without an e writes

Well, ruby just isn’t that much better than python. If I’m going to relearn everything, why would I bother with ruby? Why not just jump straight to lisp?

I can really appreciate this argument, since it resonates with my reasons for not learning Python: I knew Perl, and was doing most of my programming in it, making nicely structured, readable, object-oriented programs. To me, Python didn’t seem like such a big step forward: It’s like a Perl with enforced readability.

And then came Ruby.

My introduction to Ruby was not through Rails, but through reading the online version of the Pickaxe Book. After reading the first chapter, I was sold. Here was a language that truly embraced object-orientation, and gave access to all kinds of interesting abstractions that I had only vaguely heard of (such as coroutines). There also was a pleasant lack of boilerplate.

So to me, Ruby is that much better than Perl, whereas Python is not. I wouldn’t know if I agree that Ruby is not that much better than Python, but at least I can understand the argument. Ruby is certainly no Lisp, although it comes close.

So what’s next? Lisp’s features certainly look appealing, giving basically the pinnacle of power of abstraction, in exchange for slightly unappealing syntax. I believe the syntax can be overcome, so my next language to learn may well be a Lisp. Which Lisp is still an open question. On the other hand, there are interesting languages like Erlang, ML and the like.

[Incidentally, Without an e is the creator of Scarlet Lambda, which is roughly a web framework written in, or at least used with, a functional style of programming in Python, with a Lisp-like syntax. Wow.]

Tags no comments no trackbacks

Hello, World

Posted by matijs 26/11/2006 at 21h30

On November 2nd our daughter Sophia Emiko was born. At birth, she weighed 3050 grams, and was about 48 cm tall.

In the photograph, she is about three and a half hours old.

Tags no comments no trackbacks

Finally, B'stilla

Posted by matijs 30/10/2006 at 21h36

More than ten years after my only trip to Morocco, I have finally had the
pleasure of eating B’stilla. Amazing! It’s sweet, hearty, rich,
succulant and crunchy.

What I wanted to try but found hard to actually order in Morocco — as I
recall, few restaurants served it, and if they did it had to be ordered a
day or so in advance — I can now get right here in Amsterdam, at a
restaurant just a short bikeride away.

Hurray!

Tags no comments no trackbacks

Trackback Spam

Posted by matijs 22/10/2006 at 11h23

The less said about it the better. I just blocked three IP ranges completely. I don’t really like to take these kinds of measures, for two reasons:

  1. I don’t want to block legitimate access to my web site.
  2. I don’t want to spend my days adjusting my firewall, adding rules whenever new spam seeps through the cracks.

Since I was spending my days cleaning up trackback spam, reason #2 stopped applying. There also didn’t seem to be any legitimate access from the blocks in question.

Damn Spam has more details on these particular spammers. You can see they’ve been at it for a while now.

Before, I only blocked one IP address. It was from a company called Webrescuer with a very impolite bot. Aparrently, being impolite wasn’t a very good business model, as they seem to be gone now. I removed the block.

Tags no comments

How to write software

Posted by matijs 18/10/2006 at 10h29

Peter Armstrong hits it right on the head:

People Need Gaudy Shit

Instead of having a loose set of things that work, that are generally or even just sometimes good, that we mix and match according to the circumstances, we get everything put together in a box with a nice bow on top. Then, if you don’t use everything in the box, you’re an infidel.

I remember the first time I came across Extreme Programming (XP). I was at a bookshop looking to buy Design Patterns. This was some time ago, but there already were lots of books on XP. Most titles sounded like “XP explained yet again in a different way”. Marketing, indeed.

The thing is, talking a lot to your customers and pair programming have nothing to do with each other. Nothing at all. Both can be good ideas, depending on the circumstances.

When I write software at home, for myself, of course I can’t do pair programming. When I write something that only I will use, there’s no point in talking to my customers. I almost always use unit testing and version control. Using that for a one-off script written in ten minutes is insane.

I could make my own list of what works here, but Robert Fuller has done a pretty good job.

Tags 1 comment 1 trackback

New Language Features in .NET

Posted by matijs 06/09/2006 at 16h36

One of the reasons I have a dislike for both Java and the main .NET langauges, VB.NET and C#, is the ridiculous verbosity involved in creating and filling an object variable. Typically, what you get is something like:

Some.Deep.Namespace.Structure.SomeClass foo = new Some.Deep.Namespace.Structure.SomeClass();

The repitition of the class name makes the horrid namespace nesting twice as bad. And no, this is not about typing, this most definitely is about reading.

So, you can imagine my pleasant suprise when, belatedly, I came across a discussion of var. Basically, var is a new keyword in the upcoming C# 3.0 that allows you to do this:

var foo = new Some.Deep.Namespace.Structure.SomeClass();

And then, and this is the good part, the C# compiler will infer that foo is a variable of type Some.[..].SomeClass and will complain if you try to store anything else in it1.

Same type safety with half the reading. Excellent.

Now, that’s not all. It turns out there’s a lot more interesting stuff coming in C# 3.0, making it more concise and powerful.

1 Yes, I’m aware that ML does this and even more.

Tags no comments no trackbacks

Abstractions

Posted by matijs 01/09/2006 at 16h31

One of the reasons I enjoyed learning Ruby is that it allowed me to
understand and then use new abstractions. Not all of these are absent from
other languages, but Ruby made them comprehensible for me, so they became
part of my toolbox, if you will.

What this means is that I can write code that does the same thing in fewer
lines, and this in turn makes it easier to keep an overview of all of that
code.

At the same time, there is a whole group of programmers who completely
seem to have missed the abstractions train, or even the abstractions
road. They’re plowing along in the fields, barely able to divide their code
into subroutines beyond the ones forced upon them by their IDEs. These are
the people who write (whitespace added for clarity):

do_d

do_a
do_b
do_c
    
do_e
    
do_a
do_b
do_c

do_f

If the same five things need to be done a hundred times in a given source
file, that’s five hundred lines right there. The abstraction of the
subroutine is not an automatism for them.

So what does it matter whether people get taught programming in Java or in
Ruby, if no-one stops them from creating thousand-line subroutines? I really
wouldn’t know.

Tags no comments no trackbacks

Safe Passwords

Posted by matijs 03/08/2006 at 11h19

In the have-we-learned-nothing category, the New York Times refuses my extra-safe password, saying:

Password can only contain letters [a-z], numbers [0-9], periods [.], underscores [_], and hyphens [-].

That’s almost as stupid as godaddy’s registration page choking on my attempts to use an ampersand in a password.

I wonder if “only letters [a-z]” really means they should all be lower case. Let’s try… No, upper case is allowed. So, it’s stupid and wrong.

Tags no comments no trackbacks

How to Trim Spaces in TeX

Posted by matijs 20/07/2006 at 19h27

The problem

You created a macro package for LaTeX and promised that people could write either

\synttree[ a label ]

or

\synttree[a label]

and the result would be the same. Now your buggy macro for trimming spaces stands in the way of a much needed bug fix.

In short, you need a macro \trim that will trim (The name says it all, doesn’t it?) spaces off of its argument’s beginning and end.

Tags , no comments no trackbacks

Resolution Evaluation

Posted by matijs 15/07/2006 at 15h13

We’re now more than halfway through the year 2006, so it’s about time to evaluate the status of our new year’s resolutions. Now I realize many people give up on them by the time februari comes around. This is because they think a resolution should be followed all year, instead of being something to strive for all year. That way lies failure, clearly. And it’s also a kind of lazyness: “Oh, it’s now the second of januari, and I’ve already smoked a cigarette/forgot to call my mother/killed a kitten, might as well smoke/not call my mother/kill kittens all year.” If that’s your attitude, resolutions are dead cheap. Lazy bastards.

Anyway, on to my resolutions. Let’s see:

  • Answer all relevant e-mail within a reasonable time.

Well, that’s going pretty badly. Friend requests from cute orkutians, praise for msgconvert, ex-colleages who want to keep in touch, they all go unanswered. Of course I’ve been busy, but that’s really no excuse. My humblest apologies to you all.

  • Find out what I really want to be doing, and do that.

More luck here. I quit my job, after it had turned from just an ok way to make money into a constant source of frustration. So, as of June 1st, I am a self-employed software developer, IT consultant and web designer, which gives me the freedom and tranquility to think thoroughly on where I want to go and how to get there. Where I want to go would probably be somewhere where there is a nice PhD position in computational linguistics or computer science.

  • Post to my blog more regularly. I’m going to try mondays, but don’t hold your breath.

Well, you can all see how that’s going.

Tags 1 comment no trackbacks