Here's a question for those of you who have experience of fixing or enhancing other people's Java code, which I hope will also be really useful for those in the early stages of learning programming. Please contribute!
If you've looked at other people's code, you will know that sinking feeling when you discover 2000 consecutive lines of unindented spaghetti. On the other hand, sometimes you pick up a class library and it just oozes clarity and professionalism.
So the question is - what are the immediate clues that tell you whether a piece of code is a nightmare or a dream? What I'm really hoping for are highly specific answers rather than generalisations - it would be good to be able to use them as a set of explicit tests that we can all apply to our code.
Here's a few of my favourites for starters:
No indentation or (far worse) wrong indentation.
If, else, or loop blocks that I can't fit on one screen.
Repeated blocks of code that only differ in a couple of lines.
Member names that fully describe what the member is without needing a comment.
Methods that start with a series of assert statements that document and check the parameters.
Lots of Observer/Listener interfaces.