Skip to content

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

Comments

- Don’t write code until you need it. This results in less code, which is directly correlated with ease of change. - If you write lots of separated classes but then use them directly inside other classes, you’ve defeated the point. When you depend on something, pass it in instead of directly referencing, if possible. - keep methods less than 5 lines, classes less than 100 lines.

AboutSource Built by g1lg1l

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