News for hackers. Stuff that matters.
Re:Ask HN: What is your best advice for a developer to write... by _greim_ on Wednesday June 29, 2016 @11:44AM (#12002407)
For JavaScript in particular.

1) TDD. Since JS offers so few static guarantees, unit testing your components and utilities as you build is important; arguably more so even than in other languages. Besides test-as-you-go, this includes building things to be testable in the first place. "How would I test this?" should be an up-front question that heavily informs the approach you end up taking. Even if you write no tests, this approach will improve your code.

2) Linting. This goes beyond just enforcing code style preferences. It turns out there are lots of potential bugs you can prevent from a simple static analysis—despite JS's lack of static guarantees—and catching them early will avoid errors and make you more productive.

There are no comments on this comment yet.