Skip to content

Comment on Ask HN: How do you write code so it's easy to change?

Comments

Write however you want to write, choose whatever best practices available, any design pattern, design principal. Just add lots of comments, as many comments as possible which talks about what each line is suppose to do. If you are using a pattern, write at the start that this is x pattern used for this scenario. if you are branching the code, which scenario each branch will take care of.

At the end, if you comments and logs are complete and self explanatory, any one can come in and change the code or debug the code.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.