These are great points - but I have one question: How do you know you're writing bad code when you're writing it?
Despite having been writing code for like 15 years, I still sometimes find it hard to spot it when writing it. Yeah, I can go and try and change it later and I'll realize "oh this is kind of crap", but how do I prevent myself from writing it in that way in the first place?
My best solution so far has been TDD, but I'd be curious to hear if anyone has any other solutions :)
Robert Martin's Clean Code is a book that instructs a person how to see bad code, and how to fix bad code.
The book points out that these are skills that can be learned. And that they are difficult skills to acquire, so it is set up as examples and exercises to help learn the skills. For a wide variety of bad code (anti)patterns.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
These are great points - but I have one question: How do you know you're writing bad code when you're writing it?
Despite having been writing code for like 15 years, I still sometimes find it hard to spot it when writing it. Yeah, I can go and try and change it later and I'll realize "oh this is kind of crap", but how do I prevent myself from writing it in that way in the first place?
My best solution so far has been TDD, but I'd be curious to hear if anyone has any other solutions :)
I have read somewhere before that the code for a feature or a module has to be written 3 times to get it right. :P
Robert Martin's Clean Code is a book that instructs a person how to see bad code, and how to fix bad code.
The book points out that these are skills that can be learned. And that they are difficult skills to acquire, so it is set up as examples and exercises to help learn the skills. For a wide variety of bad code (anti)patterns.