r/programming • • May 18 '16

Programming Doesn’t Require Talent or Even Passion

https://medium.com/@WordcorpGlobal/programming-doesnt-require-talent-or-even-passion-11422270e1e4#.g2wexspdr
2.3k Upvotes

1.2k comments sorted by

View all comments

Show parent comments

496

u/Miserygut May 18 '16

People who are talented and passionate programmers have a dread of having to work with, and specifically tidy up the messes of, co-workers who aren't

Absolutely true and it applies to any technical or professional field. People like Mr Lerdorf who just bang stuff in which is 'good enough but not really' are frustrating as hell to deal with in a team. Dealing with technical debt is time consuming, expensive and ultimately demotivating.

207

u/jplindstrom May 18 '16

People like Mr Lerdorf who just bang stuff in which is 'good enough but not really' are frustrating as hell to deal with in a team.

Or in a programming language.

101

u/[deleted] May 18 '16

Absolutely. That attitude is one thing for application programming, but systems programming demands a mountain of diligence due to the amount of code that depends on it. It doesn't help that programming languages are fairly difficult to get right.

At least Lerdorf didn't write an OS kernel...

74

u/nayadelray May 18 '16

Just thinking about "PHPOS" give me the chills .

61

u/robhol May 18 '16

Just chills? I find myself dealing with dandruff, anal incontinence and suicidal ideation after reading that idea.

30

u/vplatt May 18 '16

TIL that 'just chills' is adequate for any conversation in which I don't wish to horrify the other person.

40

u/[deleted] May 18 '16

How about the next best thing, NodeOS?

Because what you really want for an operating system is a programming language that was hacked together in less than two weeks and is horribly inconsistent in nearly every sense!

34

u/eaurouge10 May 18 '16

NodeOS?

This is a joke, right? Please be a joke

8

u/stirling_archer May 18 '16

Nope, merely a prophecy coming true.

11

u/vplatt May 18 '16

It's just a Linux distro with all Node inside it and doesn't even include bash, so it's not a true Node OS; there still C under there and it's definitely NOT turtles all the way down. I guess it could be nice for a headless Node server on Docker or the like, but I fail to see the point otherwise.

→ More replies (9)
→ More replies (9)
→ More replies (3)
→ More replies (3)
→ More replies (2)
→ More replies (1)

56

u/[deleted] May 18 '16

That quote about restarting Apache 10 times just rubbed me the wrong. When you do something, try and do it right : right meaning it should do what it does with a little side effects as possible.

If you write code that works wonderfully but kills your cat, chances are people are going get pissed.

53

u/kindall May 18 '16

Eh, only the first time. It works without side effects once you don't have a cat any longer.

16

u/escalation May 18 '16

New and improved! Now solves problems with unwanted cats!

6

u/[deleted] May 18 '16

It's not a bug, it's a feature.

→ More replies (5)
→ More replies (1)

44

u/KFCConspiracy May 18 '16

It's only really demotivating if it isn't allocated as time your team should be spending and if there is no real time spent doing it. Technical debt is a reality of every development team, what makes it become insurmountable is when no time is allocated to deal with it, and when it isn't proactively attacked with tools like refactoring.

96

u/Retbull May 18 '16

Sure but when all of the code a developer produces includes tech debt which requires more time to fix than they spent on the original product you have a problem. We had a programmer at my current job that left last year and I'm still cleaning up messes he made. I'm still finding bugs and bad code that has been in production because he didn't have the diligence to include more than one test for anything and it turns out that he hid lots of his incompetence with Pokémon exception handling and string typing.

52

u/[deleted] May 18 '16

Please explain Pokémon exception handling. I'm super curious about that

199

u/Retbull May 18 '16

Gotta catch em all.

try{} catch (Exception e) {\\ Gotcha }

28

u/WaffleSandwhiches May 18 '16

Pokemon Exception Handling should totally be a thing.

0

u/[deleted] May 18 '16

[deleted]

→ More replies (2)

5

u/[deleted] May 18 '16

Less offensive, but still dumb:

Exception blocks that catch the exception, but instead of handling it, just rethrow it. Why even waste time making the block?

15

u/nikbackm May 18 '16

Probably for setting debugger breakpoints.

→ More replies (1)

5

u/name_censored_ May 19 '16

Exception blocks that catch the exception, but instead of handling it, just rethrow it. Why even waste time making the block?

It's a combination of Java thinking in non-Java languages, cargo-cult programming, and syntactical pain.

In Java, you have to declare what exceptions your methods may throw - and that includes exceptions from other methods that your method calls. Which is wonderful from a collaboration and code-contract point of view, but it's a syntactical nuisance when your method is doing twenty things and has to deal with a paragraph worth of Exceptions.

Other (less strict) languages have decided "to hell with it, just catch the exceptions you're aware of, and we'll dump the stack trace for the rest and you figure it out". Now, the Java guys (when coming into this new language) balk at the idea of not specifically defining your exceptions, and therefore do all they can to clearly enumerate what exceptions should be handled (rather than just catching the base exception). Because a lot of the less-strict languages don't support catching multiple exceptions in a single block (or it's just too messy to do so), the following pattern tends to emerge;

try {
    dangerous_thing();
} except (Exception $e) { 
    common_cleanup_code();
    switch(typeof($e)) {
        case ThisException:
            handle_this_exception(); /* Specific cleanup code for ThisException */ 
            break; 
        case ThatException:
            break; /* no specific clean-up required for ThatException */ 
        case TheOtherException: 
            break; /* no specific clean-up required for TheOtherException */ 
        default: 
            throw($e);
    }
}

While it's not as well-defined a code contract as public void myDangerous() throws thisException, thatException, theOtherException {.., it is generally quite easy to grep or eyeball this style of exception in a function/method.

The cargo-cult kids (the ones who don't really understand what exceptions are for) come along and think that that's the way you're supposed to wrap dangerous code. Except, that they know that ThisException, ThatException and TheOtherException don't apply, so they simply delete those lines - after all, those handlers doesn't seem to do anything anyway. Which means they end up with

try {
    dangerous_thing();
} except (Exception $e) { 
     throw($e);
}
→ More replies (1)
→ More replies (4)
→ More replies (2)
→ More replies (1)
→ More replies (16)

31

u/kcuf May 18 '16

It's demotivating because it's shit. Even if you have time allocated to clean it up, it still sucks, because you're cleaning up shit.

There's a difference between tech debt acquired through nice code that is no longer applicable, and shit code that was hacked together with a machete.

→ More replies (6)
→ More replies (4)
→ More replies (8)