214 points · by shill · 14y ago · 64 comments
1. Knew about PPK[0], didn't know about JZ[1]
2. Feature detection came about from writing this book! Which generalizes too: writing is a great way to innovate (something pg has said, too).
3. A nice little jab at GRRM, who thoroughly deserves it.
4. An exciting glimpse into the future of computer science pedagogy by way of JavaScript in the browser. (And I can't help but wonder if this is an oblique response to the recent Alan Kay Dr. Dobbs interview, where Kay asserts, "The Web, in comparison, is a joke. The Web was done by amateurs."[2])
5. Points out that even the best of us can get stuck in a procrastination loop.
6. Resig is going to finish a JavaScript book [3]
[0] http://www.quirksmode.org/
[1] http://perfectionkills.com/
[2] http://www.drdobbs.com/architecture-and-design/interview-wit...
It's rather amusing to see a case where I, unfortunately, fed the trolls trotted out as an example of future decision making. In this case the decision behind this was my own and largely done through my personal examination of the jQuery code base.
"Yawwwwnnnnn.... this is, quite possibly, the most inane set of ramblings set up by someone who has obviously never created a JavaScript library of any kind, nor has used JavaScript code in any sort of production environment."
https://groups.google.com/d/msg/comp.lang.javascript/QVlJ0bz...
>> Do you have any idea how many agents jQuery will identify as IE?
>The ones we care about?
I wonder why jQuery eventually turned to feature testing...As to why jQuery moved to feature testing, we discussed that in the jQuery 1.3 release notes: http://docs.jquery.com/Release:jQuery_1.3
Or maybe I just haven't been on usenet news for a while...
it took the act of writing a book to realize this fundamental design flaw.
Not cool. Most everyone is too close to their own work.Writers need editors. Artists need critics. Devs need QA/test.
Fortunately, letting code rest for 6+ months is a pretty good strategy for getting a "new mind".
So is explaining your work to someone else, such as writing about it.
comp.lang.javascript's FAQ on browser-sniffing: http://jibbering.com/faq/notes/detect-browser/
He wrote the first 3 books of his 7 book series at a normal pace, about every 18 months, but then slowed to a crawl for book 4 - something like a 5 year delay. Writer's block happens, but what makes people angry is that he continues to have an extensive "extra-curricular" schedule involving workshops, cons, and travel. And he's told his fans "I don't owe you anything," and has shown not only not-shame, but active antipathy to those who have the temerity to call him out on his irresponsibility. What's worse, is that his bad behavior is being rewarded with new interest thanks to the HBO miniseries of the books.
I mean, manipulating financial markets for gain, losing your bets, and taking taxpayer money to give yourself a bonus is one thing, but leaving fantasy readers in a lurch is quite another level of villainy.
Edit, since I'm being downvoted, and that was written in a hurry on the train: I wrote a book too. It was really fucking hard, and took a long time, but I'm ultimately happy with the way it came out, and that I took the time to do it properly. The reward for that care and hard work seems to be not "great book, thanks!" but people bitching about how long it took to write.
Hence, I now have a very low tolerance for people complaining about other people's work and being whiny and entitled.
I can't help but cheer for GRRM, even though I'm waiting for the next book to be published.
He has gone as long as six years between book releases in the series.
The best way to get a project done is to
1. need the money
2. not get paid until you finish
If either of those elements are missing, expect delays ;-)On a selfish note, writing HTML seems to be much easier than producing a properly formatted PDF page. So I enjoy technical writing, but not enough to go through the hoops of for-paper (or paper like e-books) publishing.
With that said, I usually just go to the print page of some links and read. You will be surprised how many sites inadvertently give the best reading experience through their printer page (NYT for example)
Same deal with MP3 vs other formats. PDF is a sort of gold standard in being able to precisely lay out text and know it'll render mostly right on most devices (even if the format/layout is wrong for those devices).
HTML5 and EPUB are getting there but vary so much between different platforms that till now (and EPUB 3 is changing this) the quality of books in those formats has been hideous production wise. Compare the typical EPUB book against the typical PDF book in terms of whitespace, layout, fonts, and how the author and publisher intended it to look.
PDFs predate both CSS and the legion of webdevs we have available now. It's effectively vestigial.
However, PDFs do allow for digital signing, which is not a feature webpages can have AFAIK.
I think the "hard" part is properly paginating things? And I guess generating table of contents, inner-book-links, things that my blogging platform (Octopress) handles in a way that I've been used to as a Rails templater.
[0] http://www.yuiblog.com/blog/2006/04/11/with-statement-consid...
For with statements in particular, templating and scoped evaluation (I provide an example from the Firebug console in the book) are probably the two areas in which I've seen it most successfully used.
For code evaluation I only have to direct you to the creation of Coffeescript (an entirely evaluated language) whose innovations have directly influenced new versions of the ECMAScript language.
They have their place and when used sparingly, but effectively, the can be formidable parts of a web developer's arsenal.
> For code evaluation I only have to direct you to the creation
> of Coffeescript (an entirely evaluated language) whose
> innovations have directly influenced new versions of the
> ECMAScript language.
The standard way to use CoffeeScript is to compile it to JavaScript first, and then deploy and run with that. There's zero "eval()" involved. Or rather, doing direct "eval()" of CoffeeScript is possible, and on occasion fun, but is discouraged for all the usual reasons.So they _can_ be used effectively if one really knows what one is doing, but they're a bit of a footgun.
If nothing else, surely it should be avoided in production purely for performance reasons.
You can imagine code like:
function () {
with (match("Foo a b")) { return a + b }
with (match("Bar a b")) { return a - b }
}
This would let you have basic pattern matching. Of course, this would also necessitate adding constructors (in the pattern-matching sense) to the language, so it would be fairly complicated. A simple option would be to just support lists and objects: function () {
with (match("[a, b]")) { return a + b }
with (match("[a]")) { return a }
with (match("[]")) { return 0 }
}
You could imagine this syntax being streamlined a bit.Basically, the with statement gives you a bit of access to the variable scope which is very useful in adding features to the language. It isn't quite as flexible as some alternatives (e.g. macros) but it can still be useful.
As mentioned elsewhere, using `with` is very slow: http://jsperf.com/with-versus-without
Very fitting that he's now at Khan Academy.
I've personally bought the jsninja ebook for friends and myself because I thought it was a great read and wanted to contribute to this kind of effort.
Can't wait till my paper copy ships - guess I better make sure my address is accurate still :)