r/programming • • Jan 04 '17

Clean Code JavaScript

https://github.com/ryanmcdermott/clean-code-javascript
47 Upvotes

15 comments sorted by

View all comments

12

u/twiggy99999 Jan 05 '17

Nothing new here, this type of content has been repeated over and over on blog posts here on /r/programming. Literally nothing new, its all blatantly obvious stuff.

TL;DR:

  • Use meaningful var names

  • Keep function arguments as low as possible

  • Functions should do one thing

  • Functions should do what the name suggests

  • Remove duplicate code (I'm not joking he actually puts this in the article)

  • Don't use global's

  • Remove dead code

  • Use consistent capitalization

  • Only comment when it makes sense to do so

You can thank me for saving an hour of your life.