Leave a comment

momentsmusicaux November 12 2013, 13:15:43 UTC
Why didn't the first coder just do a 'is the string length less than 5? Yes: pad it with 0s at the front'. Considering only those two cases is brittle (though I admit I don't know the business logic of US postcodes). But the first rewrite is already into total insanity territory.

Better still, use a language that considers that this sort of thing is a frequent use case: http://php.net/manual/en/function.str-pad.php

A case to rewrite the whole project, surely! ;)

Reply

skington November 13 2013, 14:52:49 UTC
Perl 5 is alive and well, even if Larry Wall is concentrating on Perl 6. There are major point releases every year, and lots of activity in module development compared to even a couple of years ago. It's increasingly easy to install one or more versions of Perl locally without having to worry about which version of Perl is installed system-wide, e.g. with perlbrew and cpanm. We use perlbrew in production at work so we can run e.g. perl 5.14.2 for our code, while the server still uses 5.10.1 for its own stuff.

Reply

apostle_of_eris November 14 2013, 05:20:00 UTC
Please re-read the narcissism piece.
In twenty years, the web has spawned billions or trillions of pages. There is nothing remotely equivalent in human experience. It is inevitable that everything will be ad hoc; my standard architecture metaphor is a coral reef.
PHP has a lot that is ugly and sucky. Perl has a lot that is ugly and sucky. Suck it up.

Reply

skington November 14 2013, 14:47:37 UTC
I'm not going to take criticism for going off-topic when the comment I was responding to already went off-topic. Yes, arguing about the semantics of code is inappropriate given that the point of the original article was that you shouldn't barge in with your own assumptions and rewrite code just for the hell of it. But that ship has sailed.

What I was responding to was the suggestion that you use PHP for any code. This is just plain wrong. PHP is clearly, by any logical standard, an absolutely terrible language, and the only reason to ever use it is that you have no alternative.

Reply


Leave a comment

Up