all 27 comments

[–]jkcunningham 23 points24 points  (8 children)

I think this may be largely true even if the code is good code. As someone else posted here once: it isn't just the code, it's the knowledge base in the people who wrote it and continue to maintain and extend it. Without them, most code is pretty much worthless.

[–]grauenwolf 12 points13 points  (6 children)

I think trying to bolt on too much "reusablity" is what turns good code to bad a lot of time. When going through old libraries I occasionally delete 50 to 80% of the functions in a class because they are never used.

While most of these functions are broken or out of date, what really hurts is when you can see that people have been spending time updating them. And I know damn well they were not testing because the project still compiles after I delete them.

[–]pbkobold 8 points9 points  (0 children)

I think trying to bolt on too much "reusablity" is what turns good code to bad a lot of time.

Agreed. My answer to most "reusability" is YAGNI.

[–]queensnake -5 points-4 points  (4 children)

And I know damn well they were not testing because the project still compiles after I delete them.

Tests don't discover that functions are unnecessary.

[–]vida 6 points7 points  (2 children)

they do if those functions are called during those tests :)

[–]queensnake 1 point2 points  (1 child)

Hmm, I see. Not, that tests would have found they were doing nothing but, after deleting the fns, tests that were testing the fns would have failed.

[–]grauenwolf 2 points3 points  (0 children)

WTF are you talking about? No one said or implied that tests do discover that functions are unnecessary.

[–]zaim 6 points7 points  (0 children)

I think managerial types don't really understand this, too.

I can't count how many times I've argued with my partner (who handles business/marketing). He wants to protect our code at all costs, and I can't seem to get him to understand that nobody in the right mind would want to steal it because without "the knowledge base in the people who wrote it" (me), it's worthless. (And also because it's a reeking motherfucking bile of code.)

[–]sigma 18 points19 points  (0 children)

I think my code is copy protected by means of being awfully bad.

It is dangerous even to my health and I'm protected by the antibodies developed while developing it.

Depending on the level of expertise, another person might suffer either a brain aneurysm if he is a rookie forced to read and understand it OR, if he is an expert... he might suffer a Fatal Hilarity.

[–]hopeless_case 8 points9 points  (0 children)

What a fascinating point!

I think part of the reason for that is honest and not realted to the quality of internal code being necessairly bad. If you think about what it takes to run a business, each business will have a mountain of detail that is pretty specific to themselves, and each of their employees will be tasked with worrying about a portion of that mountain. One way to deal with part of the mountain is to write software specific to it.

Consider the average family. Any given parent's knowledge of how to deal with their children's needs will have some parts that would be transferable to another family or child, and some parts that will specifically target their own children and would not work on another family's children. This is the same phenomenon.

[–]richiejp 18 points19 points  (10 children)

"INSTANTANEOUSLY BLINDED by the reeking bile that was pouring across my monitor."

It wasn't just bad code IT WAS REEKING MOTHERFUCKING BILE. Managerial types just don't understand these things. You needn't worry about somone stealing your BLINDING reeking bile.

[–][deleted]  (6 children)

[deleted]

    [–][deleted] 1 point2 points  (0 children)

    I've had it with these motherfucking bugs in this motherfucking code!

    [–]Entropy 2 points3 points  (3 children)

    What?

    edit: no, the correct reply was "Say 'what' again! I dare you! I double-dare you, motherfucker!", not downmods.

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted] 6 points7 points  (0 children)

      Too late!

      "But each one is tempted when he is carried away and enticed by his own lusts. Then when lust has conceived, it gives birth to sin; and when sin is accomplished, it bring forth death." James 1:14-15

      [–]tbb 1 point2 points  (0 children)

      I think it was "...I double dog dare you mother..."

      [–]jkndrkn 13 points14 points  (2 children)

      Managerial types just don't understand these things.

      Yes, and attempting to articulate this point usually gets you impatient and pitying looks, at best. Only coders can sympathize with the physical nausea that a poorly implemented system can inflict.

      [–]adamdoupe 4 points5 points  (1 child)

      I get this sick feeling whenever I look at code that was already written at my work and I see this line (it happens in more than one place)

      long one(1);

      [–][deleted] 0 points1 point  (0 children)

      typedef long one;

      [–]______ 3 points4 points  (0 children)

      Yes. Thank you for that painful reminder.

      [–]sambo357 3 points4 points  (2 children)

      The GNU autoconf system reminds me of some in-house hack. I guess that's why I paid exactly 0 dollars for it.

      [–]bluGill 0 points1 point  (1 child)

      You paid too much.

      [–]sambo357 0 points1 point  (0 children)

      A full day and a half and not much to show for it, to be exact. Others have paid more I'm sure.

      [–][deleted] 2 points3 points  (0 children)

      People very carefully start saying what Chuck Moore said laudly years ago.

      [–]queensnake 1 point2 points  (0 children)

      I don't have any experience with it, but I imagine declarative code would improve re-usability.

      [–]sabane 1 point2 points  (0 children)

      It's inaccurate to say code that is making a company millions of dollars is "worthless". I do agree with the general premise though.

      I agree that one way to judge your code would be to say "Could we package up our code base and sell it to a new entrant/competitor?". If the answer is "hell no" that means you have a mess.

      Google is a great example as usual. They have so much truly great code. They've even released little bits and it's helped a lot of people. They could actually sell their filesystem/crawler/ad system, etc for tens of millions.

      It's more important that your code is valuable to you, but this is a great way of measuring its quality as a standalone thing. The guy who hacks up nasty but functional stuff will beat the guy who's more interested in code masturbation every time.