19 ms·
Eloquent JavaScript, Second Edition
- hmottestad 13y agoThe bugs in the background are fun to watch. They actually eat each other from time to time. Though it does seem to require some CPU power and got my fans to spin up a bit.
- marijn 13y agoIf you watch really closely, they even 'mate' and lay eggs. And yes, it's a huge cpu hog. But it will pause when you unfocus/hide the page.
- brokenparser 13y agoIt completely trashes Firefox here, not exactly a compelling argument for a site like this.
- marijn 13y agoYou're right. Seems some recent change in FF upped their requestAnimationFrame fire rate, or I made some change since I last tested it that causes the slowdown. In any case, try to refresh, should be smoother now (I've added a mechanism that reduces the framerate when the animation is eating up too much processing time).
- brokenparser 13y agoI can barely scroll with the animation turned off, on a 2.8GHz CPU (it only returns to normal when reloading the page with js disabled). It's times like this when I really appreciate NoScript, but the pledge link only appears with js enabled. The fancy background could be hurting you in the pocket.
- marijn 13y agoOdd. Is your screen huge? Your machine slow? Anyway, I've made it so that the bitmaps are hidden when the animation is disabled, since they are the most likely candidate for making scrolling slow.
- brokenparser 13y agoThat works, clicking "animation" restores Firefox back to normal. What's weird though, is that the usual slow script warning doesn't work here. That shouldn't happen and might be a regression. And no to both, although it's probably slower than yours. Even with 170x140 and the main div removed (responsive design view), it won't animate.
- marijn 13y agoThe slow script warning, as far as I understand it, only fires when the script runs uninterrupted for a certain time. This was a case of animation frames taking up more time than their framerate, and thus firing end-to-end, killing the responsiveness of the browser itself.
- coldtea 13y agoWhat kind of machines do you use? I use a 2010 MacBook Pro and have no issues. Chrome beta.
- brokenparser 13y agoTry Firefox, my box is newer.
- sebnukem2 13y agoI have no problem on Firefox, it's very smooth, but does draw a little bit of CPU power.
- RobinL 13y agoI imagine it's an extension of the 'terrarium' example which is used to demonstrate OOP in javascript in the first edition of this book.... [edit - yes - it says this at the bottom of the page!]
- k_kelly 13y agoI really liked this book the first time around and I'm glad to see it's (possibly) getting a second edition. But I had to remove the background to finish the page, it really creeped me out.
- marijn 13y agoHah, okay. That wasn't the intention at all. Why did it creep you out? Do you have a particular problem with little crawly animals?
- k_kelly 13y agoNothing like a phobia or anything, but it did give me a feeling that there were bugs all over my screen. It's a cool animation though and a nice reference to the first book, personally I'd probably add a small toggle for the bugs.
- marijn 13y agoGood idea. Done.
- tyrion 13y agoThe moving background is constantly distracting me from the main content :( And btw I dind't notice the "animation" button on the top right until I came here to read the comments.
- cliveowen 13y agoThat's a lot of money to ask. Chuck Palahniuk's Fight Club got bought for $6000. Just sayin'.
- ilikepi 13y agoIf you're going to compare the monetary goals of this campaign to other books, it would probably make more sense to use other programming books as the basis of your comparison. However, I think this is beside the point anyway for two reasons. First, as the author here is running the campaign himself, it's entirely within his power to set the rules. If one of the tasks isn't raising as much as he expected, he can decide to lower the price. He could also rework the task definition to fit better given the amount raised. Secondly, I have seen both the first edition of this book, and the companion interactive website, recommended time and time again, here and elsewhere. I would not be surprised if many (if not all) of these goals are hit. edit: wording fixes
- coldtea 13y agoYes, and programmers in India work for $300/month, so you should probably lower your salary to that, right?
- lewispollard 13y agoAnd was then sold for profit. This book is being released for free once the funds have been raised.
- pavs 13y agoI want to start learning Javascript (total beginner with few months experience with PHP), can you guys recommend me some good books suggestions as to what frameworks I should get in to?
- aidos 13y agoPersonally I'd suggest you learn the basics before looking at frameworks. Frameworks will muddy the water and you won't be able to tell why/where magic is happening.
- addflip 13y agoYeah I second aidos sentiments. Stay away from frameworks especially jQuery. Check out the first version of this book and CodeAcademy's js course.
- GeneralMayhem 13y agojQuery is more of a library than a framework, and I don't see anything wrong with starting with it, since most of what it hides is the warts of the DOM API, not core Javascript concepts. I think the other replies were worried more about Knockout/Angular/Backbone that do a lot more hidden magic and can make it very unclear what's part of the language and what's part of the framework.
- Kequc 13y agoThe reason to avoid jQuery while learning is that it teaches you to use javascript lazily as an afterthought to get a DOM element to do what you want quickly. It doesn't encourage you to learn a single thing about javascript.
- jfarmer 13y agoI don't know about that! People were writing terrible JavaScript to perform DOM-manipulation magic long before jQuery came around. I think it has more to do with how people see JavaScript, i.e., whether JavaScript is a general purposes programming language or just a tool to make cool things happen on web pages, than it does what framework they do or don't use.
- talles 13y ago"from Kashmir to Louisiana to Minas Gerais" Minas Gerais is the Brazilian state that I live, what a coincidence. I wonder if the author choose randomly...
- tnorthcutt 13y agoI grew up in Louisiana, and also wondered what the connection there was. It's not a state you see mentioned often (in a positive light, anyway).
- marijn 13y agoI exchanged a few emails with an underfunded high school teacher in Louisiana who was using the book to teach his students programming. Hence the reference.
- marijn 13y agoNope. I visited there once (some of my father's cousins emigrated to Brazil 40 years ago) and did recently receive an email from a reader in Belo Horizonte.
- JoshGlazebrook 13y agoAre there any plans for a chapter on the new major stuff in ECMAScript 6? I believe the target date for the finalization of the spec is still around December? Which is not that far away... time to start shopping for xmas gifts :S
- marijn 13y agoECMAScript 6 is out of scope for now, since even when the spec is released, it'll take a while for it to become practical to actually program in.
- JoshGlazebrook 13y agoOn the client side, sure. But a lot of the Harmony features are already present in node 0.11.x unstable. So perhaps the node.js chapter could include bits about it.
- marijn 13y agoThat's a good point. I'll spend some time learning about ES6 features and their SpiderMonkey/V8 support status.
- austenallred 13y agoI just came here to say thank you. I tried dozens of methods to learn how to program (I'm a marketer) and all of them start with "ok just type this and see what happens." I love the approach of breaking everything down to the essentials and helping me understand the fundamentals. I don't have much cash, but I'll contribute what I can.
- vdaniuk 13y agoHey, I am a marketer too and wanted to share my experience with you. I am learning programming simultaneously, on and off at the following resources: http://teamtreehouse.com http://teamtreehouse.com http://codeschool.com http://codeschool.com http://edx.org http://edx.org (MIT and Harvard Introduction to computer science) http://udacity.com http://udacity.com (several courses, starting from intro) Combining various sources and styles with general documentation reading and stackoverflow answers really helped me.
- wmboy 13y agoAnother good resources for learning JS: http://javascriptissexy.com/how-to-learn-javascript-properly/ http://javascriptissexy.com/how-to-learn-javascript-properly...
- dmarusic16 13y agoI absolutely loved the first edition, and I will be chipping in. Great work Marijn.
- victorhooi 13y agoI've just donated 20 euros to this =). Hopefully he'll reach his target.
- scottmagdalein 13y agoTo those who've read both, I wonder how [the first edition of] Eloquent JavaScript compares with JavaScript: The Good Parts.
- nhebb 13y agoJavaScript: The Good Parts has passages like this: The new function object is given a prototype property whose value is an object containing a constructor property whose value is the new function object. ... whereas Eloquent Javascript is written in English. [Edit: To be fair, Douglas Crockford does write in the preface that the book is dense and may require multiple readings. He means it.]
- marijn 13y agoI'm the author of Eloquent JS, so I'm far from unbiased, but the main difference in my mind is that The Good Parts is very spartan and extremely prescriptive in what you should do and, especially, what you should never do, whereas Eloquent JS tries to actually be attractive to read and have a much more open and enthusiastic mindset towards what programming is.
- scottmagdalein 13y agoThanks!
- jisaacks 13y agoMy favorite quote from the Good Parts: "if you want to find out more about the bad parts and how to use them badly, simply consult any other JavaScript book"
- kibwen 13y agoIn terms of credentials, just wanted to point out that Marijn is also the author of CodeMirror,[1] which is a wonderful in-browser code editor used by Light Table, Bitbucket, and lots of others.[2] [1] http://codemirror.net/ http://codemirror.net/ [2] http://codemirror.net/doc/realworld.html http://codemirror.net/doc/realworld.html
- flanbiscuit 13y agoDoesn't Chrome DevTools use Code Mirror?
- kibwen 13y agoNot sure about Chrome, but here's the bug for adding it to Webkit: https://bugs.webkit.org/show_bug.cgi?id=92769 https://bugs.webkit.org/show_bug.cgi?id=92769 It's marked as RESOLVED FIXED, but I honestly can't tell from the comments if it was ever actually merged in. There's also an initiative to begin using it in Firefox's built-in dev tools, still in-progress: https://bugzilla.mozilla.org/show_bug.cgi?id=816756 https://bugzilla.mozilla.org/show_bug.cgi?id=816756 (By the way, the difference in readability between the old and new Bugzilla is startling. Good job, Bugzilla team.)
- nspragmatic 13y agoIt looks like it made it into WebKit on an experimental basis: http://trac.webkit.org/changeset/125201 http://trac.webkit.org/changeset/125201. This was over a year ago, though; don't know about its current status.
- paulirish 13y agoYes. Both Chrome DevTools and Safari's Inspector (separate projects these days) both use CodeMirror as their editor.
- felideon 13y agoAnd before that, the author of the best postgres library on the planet: Postmodern. http://marijnhaverbeke.nl/postmodern/ http://marijnhaverbeke.nl/postmodern/
- taude 13y agoI bought the first edition six months ago and thought it was still quite useful. I look forward to the new version, especially for onboarding experienced devs that don't have all the nuances of Javascript mastered.
- taude 13y agoI do have to say that I think perks for donations would be better than nothing, even if it's as simple as drop-shipping a copy of the book to each person who pre-buys it (or something)... something like donate $25, get one of the first copies of the books. Or even have it be a digital version, or something...
- marijn 13y agoEverybody gets a digital version—as in, I'll be distributing ebook formats from the website as soon as the book is finished. Sending a book costs about $10 for the book, $2-5 for shipping, and days of my time to orchestrate. It'd decimate more than half of a $25 donation. I do see the appeal of perks, but I think the trade-off is unattractive in this case.
- jnowlan 13y agoCouldn't hard copies be outsourced to No Starch if a set amount was donated? I'd much rather buy a book - and would make a higher/set donation.
- marijn 13y agoWell, you're free to make a small donation now and order the book from Amazon (for ~$20, I expect) in a few months. I know it's not psychologically the same thing, but the end result is similar.
- billpollock 13y agoWe always do 40% off pre-pub offers that includes the print book and DRM free ebook versions (pdf, epub, and mobi). Just give us your email (nostarch.com) and we'll send those to you. Maybe we should launch that offer now. -- Bill at nostarch dot com
- kamjam 13y agoNot to mention the amount of paper, energy to print and distribute. I know some people to like to thumb through physical books, and I'm sounding like a tree hugger, but small differences from everyone can make big impacts.
- mkhalil 13y agoThis website is in the top 5 list of the worst website designs I have ever seen.
- mkhalil 13y agoJavascript isn't the best language to "learn to program". Syntax wise it's decent, but for at least us web developers, we shouldn't preach that to newly interested folk. You see how bad websites are today, and it's mostly due to abusing JavaScript. When people learn something they want to use it, and if they know JavaScript better then a good back end server lang, they create...a mess. Stop abusing my CPU!
- sejje 13y agoYou don't like what people build in it? That's a pretty silly anti-javascript argument.
- mkhalil 13y agoNo. That would be a silly anti-anything argument. Javascript uses client-side resources for execution. Build a crappy app (and they will because their learning), and it will freeze my browser/their browser. Other reasons why JavaScript sucks for learning programming: - You won't know you messed up until you execute your code - It's slow. - Debugging JavaScript code blows. And most tutorials don't even show users how to do that. - - ESPECIALLY IF YOU USE JQUERY - Too many to list.
- kyllo 13y agoThis complaint is outdated. The dev tools that come built in with browsers are pretty damn good these days. They provide a Javascript console and debugger, as well as a DOM inspector and a request inspector. So it's actually really easy now to figure out what's going on with your JS code. There are unit test frameworks for JS now too. Bad JS is still bad, but it's much easier to write good JS now than it used to be.
- ahuth 13y agoJavascript is definitely one of the best languages to "learn to program." This is because it's so easy to get something up and running - you don't need to figure out how to set up a development environment or how to compile something. You can focus on learning how to program. Yes, there is some really bad Javascript out there, but that's why we need this book.
- Kiro 13y agoIs it worth reading the first edition or should I wait until this is finished? I'm quite experienced in JS but glancing the first edition it seems like it explain some abstract things I still can't wrap my head around in a good way.
- swirlycheetah 13y agoI'd say get stuck in. I'm pretty new to js and I'm only part way through as of now but the built in console when reading it online really helps solidify the experience for me.
- crisnoble 13y agoThe first edition is still the best resource on learning JavaScript I have ever used. Definitely worth reading / using it (it is highly interactive, and so much more than 'a book').
- bdcravens 13y agoI purchased the print version (haven't gone through it yet, like most books I buy, they tend to sit on the shelf for a while) ... is there a benefit to doing the interactive version instead/in addition?
- budu3 13y agoI like the layout of the book. For a self publish book how did you get the layout and typesetting to look that good?
- billpollock 13y agoI'd like to think that we helped just a little bit :)
- budu3 13y agoWe are you referring to when you say 'we', if I might ask?
- marijn 13y agoHe means that the paper version isn't self-published, but published by a professional publisher, No Starch Press (which is his company).
- billpollock 13y agoYes. Sorry for the confusion. I need more coffee. Bill
- billpollock 13y agoThis will be a very interesting experiment. We're certainly keen to release the second edition of Eloquent JavaScript and excited to see Marijn hard at work. Who knows. Perhaps this will become some sort of interesting blended model for other authors. -- Bill Pollock, No Starch Press
- slm_HN 13y agoHey, No Starch Press guy... what is up with your book covers? I have a print copy of Land of Lisp and the texture of the cover material is repugnant. It feels like the phlegm of Cthulhu hardened and pressed into book form. I have actually considered cutting the covers off just so I don't have to touch them.
- billpollock 13y agoInteresting. We actually love the texture and so does our author :) That's called a scuff-free matte finish. It's actually a plastic, overall gloss laminate with a matte finish on top. I personally hate glossy covers because I hate fingerprints. Cut the cover off if you like but matte is our preference.
- mnemonik 13y agoFWIW Land of Lisp feels incredible to me.
- lttlrck 13y agoTry adding some starch.
- mhartl 13y agoFYI, from the [Hacker News Guidelines](http://ycombinator.com/newsguidelines.html http://ycombinator.com/newsguidelines.html): Please don't sign comments, especially with your url. They're already signed with your username. If other users want to learn more about you, they can click on it to see your profile.
- tjbiddle 13y ago"Consider the final product to be your perk." That's how crowd-funding needs to be done, in my opinion. I don't care about little knick knacks - I want my monetary support to actually better the product, not be spent on useless items.
- shire 13y agoCool thanks for this. Is there something similar to this for python 2.7?
- cenhyperion 13y ago"they will help with professional editing (which is sorely needed when a non-native speaker like me tries to write an English book" Wow, I had absolutely no idea that Marijn wasn't a native speaker. I've always considered Eloquent Javascript one of the best written technical books I've read.