Final Thoughts

In notebook:
Building Modern Web Apps
Created at:
2016-02-02
Updated:
2016-02-02
Tags:
JavaScript Performance

Optimise for readability (your code)

Write code that makes sense to you later and your colleagues as well

Don't minify your code "by hand". The number 1. priority should be that your code is easily understandable.

Shares a story about a developer who create a single file with 3000 lines of code, that had to be thrown out, because no other developer could understand it.

Nine months of work was lost.

Any fool can write code a computer can understand. Good programmers write code that humans can understand - Martin Fowler

Nice trivia: Martin Fowler was ACUTALLY in the chat room of this workshop!

Static analysis

  • standard (npm module)
  • eslint.org
  • jscs.info

Lost of arguments about style, who you should write your code. It should not be a personal choice. But static analysis tools, linters.

NPM standard module: comes preconfigured with coding standards that are widely accepted by him and his collegues, peers as best practice. It can format you code to match this style (standard.format)

emotion-free code style enforcement

So it's no longer personal conversation about what code style is the best. Just use standard. The lead technical at project level will pick the style.

Mate it part of your testing

A test scipt in your package.js file and put standard there:

"scripts": {
  ...
  "test":"standard && node test"
}

Becomes part of your testing

Private, shared code?

Npm private modules, npm enterprise

  • do you trust other people's code
  • what if you want to share your code, but maybe not with the whole world?

npm private modules is for this (npm enterprise to do behind firewall etc)

Evangelize open source at your company

bit.ly/os-charity - great argument why open source is beneficial for everyone (for companies)

Walmart created Happy JS framework for NodeJS. It worked great on Black Friday.

Shows where to contact ampersand etcMore challenges if you want 

1. link to real repos
2. etc.