Live data from Hacker News

How to Write Unmaintainable Code (1999)

doc.ic.ac.uk

31–40 of 72 posts

Re: How to Write Unmaintainable Code (1999)

#31
post #5

> You earn extra Brownie points whenever the beginning and end of a block appear on separate pages in a printed listing. I'm aware that this is from 1997-1999, but I'm curious: Do people still print out source code for better reading?

> I'm aware that this is from 1997-1999, but I'm curious: Do people still print out source code for better reading?

I know a bunch of embedded C programmers who have been doing it for a long time who do this regularly. They know their stuff. They don't print out the whole codebase, just a few pages of whatever they're working on, then they annotate it with a pen while thinking about whatever problems they are solving.

Re: How to Write Unmaintainable Code (1999)

#33
post #19
post #14

Earlier quoted context omitted.

I was watching a TV documentary a few weeks ago about a botched government IT project, and a company that also had bad experiences with the company that did the project had some British auditor review the software that was delivered for their project. The show interviewed the auditor and he actually pulled out a box (maybe 50cm/20 inch high), completely full, with printouts of the whole source code of this applicatio…

To be fair, an IDE is not geared at auditing and it would be much more painful to do freeform annotations in it. Circling problematic areas, drawing connections between variables/functions, making handwritten notes in the margin... all that is easy on paper and requires workarounds/other programs on a PC.

I can see that, but how does one work through 5000 pages? I'd shoot myself in the head before the end of week 1 (metaphorically speaking). And I guess they used a combination of digital/analog methods, but still since the GP asked - that guy must've spend weeks studying printed source code...

Re: How to Write Unmaintainable Code (1999)

#37

There's only one rule: 1. Don't write fast running behavioural tests that verify the software is working as required. With fast running tests I can maintain any old crap. Well, technically speaking I can rewrite it, but no-one will mind.

Write tests that ensure each subroutine is called with specific parameters, so that functionally identical modifications cause the test to fail. Any change to the code now requires a change to several tests.

Re: How to Write Unmaintainable Code (1999)

#38
My favourite one must be number 20. Best ever quote of Thumper I've seen...!

"Never document gotchas in the code. If you suspect there may be a bug in a class, keep it to yourself. [...] Remember the words of Thumper "If you can't say anything nice, don't say anything at all". What if the programmer who wrote that code saw your comments? What if the owner of the company saw them? What if a customer did? You could get yourself fired."

Re: How to Write Unmaintainable Code (1999)

#39

I've thought a particularly effective approach is actually to do the "right" thing but take it to ridiculous lengths - the "Enterprise FizzBuzz" that was posted on HN recently being a good example of this.

I'm not sure that's the right thing on any level...

Re: How to Write Unmaintainable Code (1999)

#40
post #5

> You earn extra Brownie points whenever the beginning and end of a block appear on separate pages in a printed listing. I'm aware that this is from 1997-1999, but I'm curious: Do people still print out source code for better reading?

> I'm aware that this is from 1997-1999, but I'm curious: Do people still print out source code for better reading? I know a bunch of embedded C programmers who have been doing it for a long time who do this regularly. They know their stuff. They don't print out the whole codebase, just a few pages of whatever they're working on, then they annotate it with a pen while thinking about whatever problems they are solving…

I can imagine this being more helpful if you lacked access to a debugger, and lacked the time (or desire) to build debugging tools by other means... Which I imagine is plausible in that context.
Post reply on HN