JSBits #3: 10 things to remember

Captain's log, stardate d68.y38/AB

Here's another JavaScript bits we wanted to share with you. This time around, I want to share my ten things to remember when writing code, which is something I borrowed from this article from Medium: Ten things you will eventually learn from JavaScript projects.

Remember - Photo by Nick Fewings on Unsplash

Here's my interpretation, with my own comments, on the ten items listed on that article:

  1. Divide and conquer: the most fundamental principle, not only in programming, but to solving almost any problem.
  2. Make things embarrassingly obvious: I've tried to look clever a lot of times. And I can tell you, it's not clever.
  3. Resolve magic numbers and strings: use constants.
  4. Fight nesting: no if inside if inside if (and callback hell, of course).
  5. Configure hard: use an external config file.
  6. Frameworks are there to help: don't reinvent (unless for learning).
  7. Unless it is a prototype — write tests: no comment - speaks for itself.
  8. Use version control: why this is not point #0?
  9. Manage state responsibly: probably the most javascripty item of the list. We're obsessed with it. In part because it's not solved in the language (lots of ways to manage state). In part, because it's not solved in any language (maybe in Clojure?)
  10. Question trends: also javascripty. New is not better.
Daniel Gómez

Daniel Gómez

Dani started playing with computers with his Oric 1, at least 100 years ago. He now juggles his programming skills with two bands and being a father of three. Legend says, it's him and his identical twin brothers working as a team.

comments powered by Disqus

You're one step away from meeting your best partner in business.

Hire Us