14

There is this general idea that people have that when programmers are able to run their code in their first attempt, without any error, they think of ourselves as geniuses. But i think that is the case only when you are starting to code. If a programmer with enough experience runs his/her code in their first attempt without any issues, he/she just says their thanks and moves on, because they know that the code can sense cockiness and if they get too carried away now they'll have to pay the price in future.

Comments
  • 1
    When I run TDD cycles I run 90% of the implementation code first time... the 10% is edge cases or api code I need to understand further by poking at it.

    You're right though, I've seen some people just crack on when something runs and think everything is fine without verifying their work.

    Best example: we had a big stats application churn calculation that the original devs (contract timeout) had written. It ran in 24 hours then went away.

    Great, they handed it over "working" and it must be right because the data is exactly
    the same...

    They had fucked up, the database commit was done once at the very end of a 24h calculation (nonsense that it would take that long anyway)... and try>empty catch around the thing to suppress the database save exception.

    The core function of the application they'd written over a year was fucking useless and me and my dev friend spent 6mo wiping their arses.

    All because they didn't confirm their work.
  • 1
    Write tests for every method you make. It makes a huge difference if you're running the tests in strict mode and you can't run any of it without first fixing the common warnings by properly checking input before using it in the logic.
  • 1
    @unfuckers-inc spot on. Test first and the rest comes easy... tests are like the lube for that big old chubby, well running code.
Add Comment