
I'm an advocate of learning how to program without worrying too much about the language implementation - but a small project at work recently reminded me of the benefits of having a pretty good understanding of the featureset available in your chosen language and platform. Sometimes, languages hand you cheap performance improvements on a plate, if you just know to use them.
In a 'couple of hundred lines of perl' script the difference between using an array:
Array:
and the exact same functionality using a perl hash:
real 3m3.544s
user 3m3.292s
sys 0m0.210s
Hash:
can be pretty significant - about 33% in the example here - and it was a line or two shorter.
real 1m57.281s
user 1m57.043s
sys 0m0.218s
Bottom line: a good programmer not only learns how to program in a language agnostic fashion, but also learns what features the implementation languages offers - and uses them.
posted at: 06:40 | path: /technical | permanent link to this entry
