in reply to how do you express coding-pleasure?
Solving bugs is nice, but for me, the greatest pleasure in coding is reserved for those occasions when you suddenly see a way to simplify a piece of existing, working code.
I was recently working on a piece of code that operated on overlapping substrings of a string, involving two nested for loops and 3 position counters. Getting it to work right took an inordinate amount of time trying to cater for all the overlaps and edge cases.
Then the realisation dawned that Perl's habit of padding shorter arguments to match the longer ones in many of it built in routines and operators meant that all my carefully crafted edge detection and correction was unnecessary. I removed it and everything still worked. That was a distinct pleasure.
Somemonk, I forget who, has or had a sig. that said something about knowing that you were moving in the right direction when you were throwing stuff away. That was the case here. Perl's default behaviour meant that a bunch of complicated tests and corrections could be eliminated.
I like that. And it happens much more in Perl than any other langauge I've ever used. (With the possible exception of PL/1 (actually PLS-86) which had more options to every library call than any other I ever used, and most of them had defaults that usually meant you could skip them. The only trouble was trying to remember which optional arguments had which defaults)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how do you express coding-pleasure? (notable quotes)
by grinder (Bishop) on Nov 28, 2004 at 17:55 UTC | |
by BrowserUk (Patriarch) on Nov 28, 2004 at 18:30 UTC | |
|
Re^2: how do you express coding-pleasure?
by jplindstrom (Monsignor) on Nov 28, 2004 at 17:40 UTC |