It's Friday somewhere
Dec. 17th, 2007 05:49 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
As usual I am probably the last one to notice, but just in case I'm not: Script.aculo.us fucking owns.
Sometime in the reasonably near future I want to arrange, um, everything I have been thinking about in the last week and a half into an essay, the thesis of which is: if you are a Web 2.0 coder, learning Lisp will make you a much better Web 2.0 coder. No, really. And not just because of what Paul Graham had to say about his experiences starting Viaweb (short version: back during the early days of Web 1.0, they built one of the first truly agile web applications -- hell, quite possibly the first web application full stop -- and one that could have justifiably been called a Web 2.0 app if we'd had AJAX back then). I do not have time to expound on this right now, but I leave you the following points to mull over while I get my house in order:
Sometime in the reasonably near future I want to arrange, um, everything I have been thinking about in the last week and a half into an essay, the thesis of which is: if you are a Web 2.0 coder, learning Lisp will make you a much better Web 2.0 coder. No, really. And not just because of what Paul Graham had to say about his experiences starting Viaweb (short version: back during the early days of Web 1.0, they built one of the first truly agile web applications -- hell, quite possibly the first web application full stop -- and one that could have justifiably been called a Web 2.0 app if we'd had AJAX back then). I do not have time to expound on this right now, but I leave you the following points to mull over while I get my house in order:
- Dynamic HTML lives and dies by the DOM. If your code spends a lot of time modifying innerHTML members, you are doing it wrong. Javascript makes it easy, blissfully easy, to manipulate your content by manipulating its structure -- adding, removing and altering elements and their attributes by type and value.
The DOM is a tree, and here is the Big Secret Insight about trees: trees are lists. Trees are dead easy to represent as nested lists, and if you can think in Lisp then you think in trees all the time anyway. Use trees. Learn Lisp. - Remember my enormous long rant about C++ functors from a few weeks ago? Remember the part where I talked about "functions as first-order data"? Javascript treats functions as first-order data. You can create, modify, assign and replace functions at runtime. Yes, you heard me right: self-modifying code. The hardest thing about self-modifying code is getting your head around the fact that yes, it exists, and yes, you can do it. Go get comfortable with it. Learn Lisp.