Jarrod Overson's excellent QConSF 2013 talk
Original slides: http://www.slideshare.net/JarrodOverson/complexity-28214103
Matthew "Maverick" Eagar
- it's not 2003
- no longer about jQuery animations
- Traditional request/response cycle
- UJS
- Bad support for managing JS complexity
- and getting bigger
- big apps, big codebases
- big codebases -> complexity
- "Solved problem" in "traditional" languages
- linting
- maintainability index
- bug rate
- Dynamic langauge with some (a lot?) of problems
- rapid evoluation, leaving best practices behind
- immature tooling
- ECMA6... HOW??!
If you're not automating it, you might as well not be doing it;
if you're not visualizing it, it might as well not be happening
-- Jarrod Overson <3
Demo:
https://github.com/es-analysis/plato
- static analysis and visualization
- no code is good code (maintainability)
"CoffeeScript is a fantastic, awesome language, and an awful, dismal ecosystem"
"CoffeeScript is a fantastic, awesome language, and an awful, dismal ecosystem"
-- Maverick
- No evolution
- NO tooling
- Rendered obsolete by ECMA6
- CS and JS can co-exist
- Same tests
- lint some, but not others
Stack Overflow makes you a human linter
function get_user_id() {
var user_id = null;
$.get("/users/me", function(user) {
user_id = user.id;
});
return user_id;
}
id = get_user_id(); // WHY U NO WORK?!??!11
http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call
SO MANY DUPLICATES
http://stackoverflow.com/questions/18127243/jquery-return-value-from-function
delete_visits = (ids_to_remove) ->
dfds = []
visits = []
for id in ids_to_remove
model = new Pam.Models.Visit({id: id})
model.fetch().done =>
dfd = model.destroy()
dfds.push(dfd)
$.when(dfds...)
delete_visits = (ids_to_remove) ->
1. dfds = []
2. visits = []
3. for id in ids_to_remove
4. model = new Pam.Models.Visit({id: id})
5. model.fetch().done =>
7. dfd = model.destroy()
8. dfds.push(dfd)
6. $.when(dfds...)
- Thought:Coding... 5:1?