Sunday, May 15, 2011

Things I got right but didn't describe in such detail.

I've read a couple things or three lately that justified some of my strongly held intuitions in the past.

  1. Javascript is really like LISP (and tcl as well).
  2. Event Driven code is not hard; stop complaining you whiner!
  3. Simulating non-blockingness just papers over how dramatic IO is.
  4. Code correctness and Resource contract testing is the Right Thing(tm).
1 & 2 are dealt with in Crockford's Javascript lectures.
3 is sorta dealt with in the Crockford lectures, but I want to write an example of papering over read/write in Ruby/EventMachine.
And 4 was justified in the long winded talk by J.B. Rainsberger Integration Test are a Scam

1 is an observation that Javascript is a Function oriented language and so is LISP. You could probably map Javascript into some LISP-like derivative easily.

2 is a simple argument to make. Browser programming in Javascript is an EventLoop; look at all the total newbies that code Javascript in the Browser.

3 is comes down to the Marx quote "A sufficient change in quantity is a change in kind". IO takes many orders of magnitude more time to execute than all the code that looks like z = x + y or even a1 = sort(a2). If it is so different in time to execute, then it shouldn't be represented as just-one-more-line-of-code.

4 boils down to two parts. One, your basic APIs do what is expected. And Two, your components implement mutually agreed upon contracts. One and Two are easy to test, and they expose the real source of the remaining bugs: Design flaws.

Update:
Here is a table I found.
I/OCyclesOrder
L13100
L214101
RAM250102
Disk41,000,000107
Network240,000,000108

No comments:

Post a Comment