Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Let's Make Javascript Great Again!

Let's Make Javascript Great Again!

Interactive session at SXSW 2017.

Avatar for Conrad VanLandingham

Conrad VanLandingham

March 11, 2017
Tweet

More Decks by Conrad VanLandingham

Other Decks in Programming

Transcript

  1. Grunt Gulp Broccoli Mimosa Makefiles webpack SystemJS fetch promises await

    Exponentiation operator Array.includes Classes Object enumerable arrow functions Generators global import Async ivate fields trimStart trimEnd 
 promises f and from string Nested im Observa string.ma Relations cons let sessionSt Template s
  2. How did JS get here? JavaScript built by Brendan Eich

    (who’s speaking right now at the Hyatt Regency, better run!) for then , First delivered prototype in 10 days, circa 1995
  3. Eric Schmidt, CEO Google "It was so good that it

    essentially forced me to change my mind." How did JS get here?
  4. 2008-2009 Birth of Node Open Source V8 Engine (2008) JavaScript

    on the Server (2009) How did JS get here?
  5. Github Popularity StackOverflow Popularity Objective-C Ruby C C++ Python PHP

    C# Java JavaScript Today Most popular dynamic language (Yes, this is to scale) How did JS get here?
  6. • Coherent model for development • Module system / code

    separation • Declarative data binding • Components, routing scheme, • data validation, animation, event management, etc • Community support = stability, new features, OSS Frameworks provide: How did JS get here?
  7. Can we make JS better? How is JavaScript not great

    today? • The “new framework every day” fatigue? • The “language was built in only 10 days” hindsight?
  8. JavaScript’s rise through convictions Can we make JS better? •

    Forced to grow in hostile browser wars • Lack of new ECMA versions for a decade • Open source community having to “fix” and grow the language
  9. If it can be written in JavaScript, it probably will

    be written in JavaScript. Can we make JS better?
  10. Don’t invest in a lot of up-front technical debt (ie…

    big boilerplates). Understand what the different libraries in your packages.json actually do. Focus on how data flows through your app. Can we make keep up with JS better? Keep It (Stupid) Simple.
  11. Any dependency you bring on to a project is just

    as much a liability as if your team wrote the code. Can we make keep up with JS better? Evaluating Open Source Libraries
  12. Can we make keep up with JS better? module.exports =

    leftpad; function leftpad (str, len, ch) { str = String(str); var i = -1; if (!ch && ch !== 0) ch = ' '; len = len - str.length; while (++i < len) { str = ch + str; } return str; }
  13. Evaluating Open Source libraries • Does it actually do what

    you need it to?
 Don’t eat soup with a shovel, don’t dig a ditch with a spoon. • What is the quality of code?
 Does it utilize modern best-practices? • Actively developed?
 Software is never “done.” • Active user base? • Documentation? • What dependencies does it rely on? Can we make keep up with JS better?
  14. Evaluating Open Source libraries • Does it actually do what

    you need it to?
 Don’t eat soup with a shovel, don’t dig a ditch with a spoon. • What is the quality of code?
 Does it utilize modern best-practices? • Actively developed?
 Software is never “done.” • Active user base? • Documentation? • What dependencies does it rely on? Can we make keep up with JS better?
  15. Code should be written to minimize the time it takes

    for someone else to understand it. Can we make keep up with JS better? Write Readable Code.
  16. We believe: • Write for another human being, don’t focus

    on micro-optimizations • Invest in modern JavaScript versions • Pack information into variable names • Commenting is to help the reader know as much as the writer.
 Don’t comment things that are already apparent by reading the code. • Embrace the language Can we make keep up with JS better? Write readable code.
  17. JavaScript is a multi-paradigm language.
 It supports programming in different

    styles: • Procedural: (imperative), like C • Object-oriented: objects are primary building blocks, like Java • Functional: functions as first class citizens. Like Haskell, ClojureScript, or Elm. Can we make keep up with JS better? Write readable code.
  18. Function Purity A function that relies only on its input

    arguments to derive the return value, and does not produce any side affects (such as modifying values or state outside of itself). Immutability Involves how you handle changes. Example: instead of adding items to an array, you create a new array with your item at the end of it. Can we make keep up with JS better? Write readable code.
  19. Don’t try to be an “expert” in everything. Pick your

    tools wisely and then become expert in those. Focus on keeping up with the innovation within your sphere. Can we make keep up with JS better?
  20. Can we make keep up with JS better? GraphQL Service

    Apollo Databases Microservices External APIs MOBILE WEB React React Native
  21. Node proved to be 2-5 times faster… “ “ -

    Kiran Prasad Our Node code base [is] 1,000 to 2,000 lines of code. The Ruby code base [was] 60,000. “ “ On ’s move to Node.js from Ruby on Rails Why JS can be is great.
  22. IN SHORT, SOFTWARE IS EATING THE WORLD. M A R

    C A N D R E E S E N (he made )
  23. IN SHORT, SOFTWARE IS EATING THE WORLD. M A R

    C A N D R E E S E N (he made ) JAVASCRIPT IS EATING SOFTWARE.