
Originally Posted by
samanime
It's things like that where you realize people either don't know what they are doing, or just don't care.
... and there's WAY too much of the latter; in particular people calling what has been considered good coding practices of the past three decades to be "an unnecessary waste of time and effort". A lot of the code I'm seeing today feels like it harkens back to the days where coders charged for products by the K-LoC.
For you kids who've never heard of K-LoC (No, not K-Tel, K-LoC) it means "Thousand Lines of Code" -- back in the days when Cobol and Fortran were bleeding edge languages, DEC programmers were doing everything in DiBol, Clipper/dBase was commonplace and developers even were releasing business apps written in ROM BASIC (no, that's not a joke) developers would actually quote and bill the price of software by the K-LOC. You'd ask "How big a project is that" and the response would be "Oh, that's a 5 to 6 K-Loc project"...
Which is of course when developers started writing really slow software by putting comments on every other line to pad how much they got paid.
Such practices were typical of the "back room UNIX geek" and other "big iron" world, and were frowned upon by those involved in what started out as the hobbyist/enthusiast side of things that pretty much BURIED Mainframes by driving the real computer revolution of the 80's and early 90's... I suppose I shouldn't find it too surprising that with *NIXisms having been on the rise the past decade, that sooner or later all the other bad practices and attitudes would follow suit... it's just disturbing to see all the old nonsense back with such a vengeance.
Now it's like people are just sleazing out the sloppy code any old way not to pad it, but just to get by on as little effort as possible while preying on the ignorance of the suits in the process. At least back when people crapped out code to pad the length artificially they put effort into doing so.
Off Topic:
Just remembered my first paycheck for computer work, I took a 10000+ line database system that stored everything as strings, and reduced it to 2000 lines of code that stored strings as strings and numbers as 32 numbers.... breaking the numeric data out to a fixed record/index with pointers to a separate storage for strings. Only 3000 or so lines we're 'unneccessary' comments (which I put in a separate text file with line number references).... Rest of it was just bad code like checking the same condition over and over, performing the same math over and over inside said conditionals, etc, etc... Sped up requests from taking 30 seconds to taking 2 seconds.
Idiocy like: (to borrow from some PHP I just cleaned up for someone)
Code:
if ($row['section']=='balls') && ($row['item']=='bocce') && ($row['count']>$hx-2) {
/* do something */
} elseif ($row['section']=='balls') && ($row['item']=='basketball') && ($row['count']>$hx-2) {
/* do something */
} elseif ($row['section']=='balls') && ($row['item']=='baseball') && ($row['count']>$hx-2) {
/* do something */
} elseif ($row['section']=='balls') && ($row['item']=='soccer') && ($row['count']>$hx-2) {
/* do something */
} elseif ($row['section']=='balls') && ($row['item']=='football') && ($row['count']>$hx-2) {
/* do something */
} elseif ($row['section']=='balls') && ($row['item']=='beach') && ($row['count']>$hx-2) {
/* do something */
}
and I can hear some people going "what's wrong with that?"
Code:
if ($row['section']=='balls') && ($row['count']>$hx-2) {
switch ($row['item']) {
case 'bocce':
/* do something */
break;
case 'basketball':
/* do something */
break;
case 'baseball':
/* do something */
break;
case 'soccer':
/* do something */
break;
case 'football':
/* do something */
break;
case 'beach':
/* do something */
break;
}
}
... and the person I showed that to called it premature optimization? Not worth the effort? WHISKEY TANGO FOXTROT!?!
No wonder most of the code out there performs worse that what we had decades ago on less hardware... when even simple 'no effort' optimizations like using single quotes instead of doubles in php or commas instead of string addition on ECHO either aren't taught, explained, or just "Wah, wah, way, it's too much effort" to NOT hit the shift key or slide over one character on the keyboard...
Bookmarks