Sep 28th, 2009
by dagfinn.
Image by Balakov via Flickr
In The importance of bad code (or, WordPress and why I am a psychic), Marco Tabini proposes the idea that we need bad code. Or at least that we should be tolerant of bad code in open source projects because that invites participants that might otherwise not contribute.
This is an interesting [...]
May 4th, 2009
by dagfinn.
Image via Wikipedia
Dean Wampler blogs: Is the Supremacy of Object-Oriented Programming Over?
“The fact is, for a lot of these applications, it’s just data. The ceremony of object wrappers doesn’t carry its weight. Just put the data in a hash map (or a list if you don’t need the bits “labeled”) and then process the collection [...]
Apr 12th, 2009
by dagfinn.
Image via Wikipedia
After the previous post in this series, additional independent implementations of the idea of JavaScript-style classes have turned up. So I’m going to list them and comment briefly on the differences. I hope this will be helpful to anyone who actually wants to use this in practice and needs to decide on the [...]
Feb 3rd, 2009
by dagfinn.
Image by cackhanded via Flickr
Davey Shafik discusses return values from functions. In the specific case of a function that returns values from a database, he wants to return false on error and an empty array if the data set is empty. He also has a reason for that:
“However, it’s very rare that I care about [...]
Jan 4th, 2009
by dagfinn.
There was a lot of disagreement on the value of code comments after my earlier post Comments considered harmful. Perhaps the most important objection that was raised was the idea that it’s OK to improve the code, but it’s even better to keep the comments in addition to the improved code.
As one [...]
Dec 23rd, 2008
by dagfinn.
There is too much old advice in PHP. A recent case comes from the PHP Advent calendar. Eli White is a strong believer in commenting code, including inline comments inside functions.
Unfortunately, he’s at least 10 years too late. This used to [...]
Dec 14th, 2008
by dagfinn.
The core of your average web framework is a Front Controller. Front Controllers are commonly considered complex and esoteric. That’s a myth. I sometimes brag that I can construct a Front Controller in 15 minutes. Actually, it’s doesn’t take quite that long. In PHP, a Front Controller can be simplified to just one [...]
Nov 27th, 2008
by dagfinn.
They say there’s no free lunch, but at least there’s free breakfast. Last week I attended a “breakfast seminar” with Robert C. Martin (Uncle Bob). There really was free food.
Anyway, Uncle Bob held an extremely entertaining and useful introduction to the FitNesse testing tool. He got me hooked on it, but I’m even more fascinated [...]
Nov 8th, 2008
by dagfinn.
I got some interesting comments to my previous post on “beautiful code”. Some were pretty strong disagreements.
So am I wrong? Did I get carried away? Did my critical faculty go on vacation somewhere nice and sunny? I admit that sometimes I deliberately look at the positive and ignore the negative. (And sometimes [...]
Nov 3rd, 2008
by dagfinn.
Max Horwath has published his slides on Making Selenium Test Writing easier using a DSL onlinefrom IPC 2008. Let me quote the whole short description:
Implementing automated tests by using Seleniums API methods has several [...]