Playing with Redis and MongoDB.
Archive for the ‘Uncategorized’ Category
Today
Friday, October 30th, 2009Agile versus waterfall development
Sunday, November 16th, 2008Duck typing vs. strong typing
Thursday, October 16th, 2008One year ago I wrote the original of this article after an interview. That article was lost when I reinstalled my server and did not bother to back up the database. But this time I should write better since I had time to reflect on the issue in the intervening one year.
It started when I was talking to this person who asked me whether strongly typed languages are better than duck-typed languages. That person was a manager at a company that used ActionScript. I told him both families of languages had their uses. In other cases, simply we do not have a choice. This person was shocked that I did not take sides. He had the impression that ActionScript was strongly typed (that’s what his programmers told him). He tried to convince me that strongly typed languages are better.
Compile-time checking makes sense with low-level languages, when certain statements can be checked to detect runtime problems. For example, copying from a byte array to a string (or similar) would not make sense because it would result in corruption in memory. When you go to a higher level, detection becomes harder because the compiler needs to know so much about objects at runtime. Such checks are either impossible to program or would make the compiler slow or useless.
Having no compilation errors does inspire some confidence as far as the quality of the code goes but experienced programmers know that problems occur at runtime.
Compilation of strongly-typed languages created generations of programmers who simply do not write test for their code.