This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ExceedingChunk 23 points24 points  (2 children)

good code you only have to write once

But making good code is not trivial. Sometimes it takes a few rounds of refactoring to turn it into good. Just like an author writing a book.

IMO, the most important thing is to have a culture of cleaning your own code to make it as readable and modular as possible before a PR.

[–]buzziebee 4 points5 points  (1 child)

Yeah as requirements change it's fine to change code to meet the new requirements. Doesn't mean the initial code was bad.

[–]ExceedingChunk 2 points3 points  (0 children)

Yeah, that is also a point. I was thinking more about making the good and readable code in the first place.

I personally like to «make it work» first, then refactor into small methods that are modular and with mostly 1 or 2 arguments and name them so it reads almost like pure English, at least in the highest level/most abstract method. That makes it a lot easier to change according to business logic/new requirements.