8. ye ol’ UNIX philosophy
- mythical collection of koans
- bottom up and pragmatic
- ignoring it is irresponsible
9. Make each program do one thing well. To do a
new job, build afresh rather than complicate old
programs by adding new features.
Doug McIlroy
10. Rule 1. You can’t tell where a program is going to spend its time.
Bottlenecks occur in surprising places, so don’t try to second guess and
put in a speed hack until you’ve proven that’s where the bottleneck is.
Rule 2. Measure. Don’t tune for speed until you’ve measured, and even
then don’t unless one part of the code overwhelms the rest.
Rule 3. Fancy algorithms are slow when n is small, and n is usually
small. Fancy algorithms have big constants. Until you know that n is
frequently going to be big, don’t get fancy. (Even if n does get big, use
Rule 2 first.)
Rule 4. Fancy algorithms are buggier than simple ones, and they’re
much harder to implement. Use simple algorithms as well as simple
data structures.
Rule 5. Data dominates. If you’ve chosen the right data structures and
organized things well, the algorithms will almost always be self-evident.
Data structures, not algorithms, are central to programming.
Rule 6. There is no Rule 6.
Rob Pike
31. Unix Haters Handbook
“...your book is a pudding stuffed with apposite
observations, many well-conceived. Like
excrement, it contains enough undigested
nuggets of nutrition to sustain life for some. But
it is not a tasty pie: it reeks too much of
contempt and of envy.
Bon appetit!
Dennis Ritchie
32. practice != principle
best practices are temporal
don’t confuse a practice w/ a principle
eg: technology w/ goal (eg. git vs rcs)
56. The technique...
1. Instantiate a chromeless browser
instance.
2. Implement PhoneGap.exec bridge code.
3. Implement native plugin code.
4. Implement your JS API by wrapping
PhoneGap.exec() into something pretty.
79. debugging?
no longer a colossal PITA
chrome building in smarts for remoting
most ide envs have step debug now
until then: pull out your weinre *
* http://debug.phonegap.com
81. performance
http://stevesouders.com is the man
latency != init != exec
less code is faster code to write, exec, debug
compile, concat, min, inline, etc
closure compiler advanced mode is promising
DO NOT use css transforms (yet)
AVOID gradients, text-shadow, etc
84. mobile is hostile: use build tools to
automate repetitive tasks
read up on those that came before; this
isn’t new stuff
build a mobile web app first
give vanilla javascript a try; its a neat
language!