55. “The first rule of functions is that they should
be small. The second rule of functions is that
they should be smaller than that. “- Bob
Martin, Clean Code
67. Questions?
Len Smith
@ignu
http://iggy.nu
len.smith@live.com
Notes de l'éditeur
Who Uses JS? What do you use it for?
** RIGHT, THE WE...
MVC vs Controls.
Flash vs. Smartphones...
Decade and a half and gaining momentum.
*** But JavaScript’s expanding outside of the web...
Document DB. Querying, Storage all in JS.
node.js: Async. Really, really, really fast.
** PICTURE ON TWITTERS
JavaScript the Bad Parts is obviously a large book.
Good Parts only JS book I recommend
** WRITTEN BY
Godfather of JavaScript.
JSON. JSLint. JSMin.
*** TALKS ABOUT WHY JS MAKES US FEEL LIKE
most misunderstood language in the world.
*** What we really hate...
Not Dom Delouise.
But he doesn’t help anything.
*** THE DOM
*** The other problem is our fault
TOY
Clojure/Scala
***
Why don’t we learn it?
Marketing: Java - a lie
Alerts
** So.... what makes JS different?
DEMO
*** JavaScript is Powerful, Dangerous.
Stan Lee taught us
*** So how do we write maintainable code
Robert C. Martin
List of Principles
Some Important... some not.
*** BUT WHY?
If I lost some of you on what SOLID is, don’t worry much. Just remember, DRY AND CLEAR. Words are so simple but so difficult to achieve. What practice can force us down this path.
DRY: If my function does A and B and C... B Somewhere else
CLEAR: can name it B
If I can extend it with out modifying I’m probably clear. And I stay dry by not having this new functions concerns bleeding into things I’m extending
CLEAR: Animal that can walk sometimes but not in these cases
Clear how to use this
CLEAR: Animal that can walk sometimes but not in these cases
Clear on what I need. Testing.
In Web Applications,we typically finad
Manual Testing is Immoral. Unit Tests should be %100. Crisis of Faith with dynamic languages and Cross Testing and Integration Tests. Situational Tests should just test all of these connections.
Mouthfull.
Using JavaScript correctly, using TDD. Synergistic.
Who Uses JS? What do you use it for?
** RIGHT, THE WE...