Back

JSBits #3: 10 things to remember

Captain's log, stardate d68.y38/AB

Javascript ES6 Development
-
Full-stack developer
JSBits #3: 10 things to remember

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.

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.

Share this post

Related Articles

JSBits #2: Return more than one value

JSBits #2: Return more than one value

Here's another JavaScript bits we wanted to share with you. Small tips and tricks for JavaScript developers for all levels. This time around, we share how to return more than one value.

Read full article
JSBits #4: Comparison operator

JSBits #4: Comparison operator

Here's another JavaScript bits we wanted to share with you. Let's talk about the comparison operator, today.

Read full article
JSBits #5: Loop statements: 'for..in' vs 'for..of'

JSBits #5: Loop statements: 'for..in' vs 'for..of'

Here's another JavaScript bits we wanted to share with you. Let's talk about the loop statements, today.

Read full article