in reply to Re^8: Legacy Code: "Dominoes = Bad"
in thread Legacy Code: "Dominoes = Bad"
Would you agree that using CGI.pm is less effort and more maintainable? I posit that this is a non-trivial example because it is so frequent (still!), particularly roll-your-own query-string parsing.Using CGI.pm or not is about code reuse, not maintainability. But say I had handrolled my own CGI parsing, and for whatever new requirement, I now have the need to separate arguments not only by '&' and ';', but also by '-'. What do you think would be easier to do, change the code I wrote myself, or code that someone else wrote, and which doesn't live in my source control, but instead is maintained by the system wide packaging system, as it's third party software? (Note that I almost always would use CGI.pm if the alternative was writing it myself, but not for maintainability reasons - because code reuse makes I can deliver faster).
Could it be that monks of your experience will see almost any example as trivial, because it's something you've been doing for yearsThere's a lot that's not trivial. But I do mean a real function (or module) that does something - not a fragment like variable names. I'm asking for two implementations of the same functionality: one written in the simplest way, doing nothing more than required, and one written in the maintainable way, and then to show the latter did not take more effort to write than the former. (And with more effort, I do not mean the number of characters - typing '$target_hostname' or '$th' takes the same effort - effort is much more than the physical act of depressing and releasing keys; thinking what to write is effort; testing your code is effort; merging it into existing code may be an effort, etc)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Legacy Code: "Dominoes = Bad"
by armstd (Friar) on Apr 30, 2011 at 14:55 UTC | |
by JavaFan (Canon) on Apr 30, 2011 at 21:41 UTC | |
by Boldra (Curate) on May 01, 2011 at 19:19 UTC | |
by BrowserUk (Patriarch) on May 01, 2011 at 19:26 UTC | |
by JavaFan (Canon) on May 01, 2011 at 19:38 UTC | |
by Boldra (Curate) on May 02, 2011 at 09:15 UTC |