John Resig

ejohn.org · Personal blog · on HN since 2007

John Resig, creator of jQuery and former Khan Academy engineer, writes about JavaScript, programming education, and developer habits.

What HN saysCommenters repeatedly credit his "Write Code Every Day" post for building a daily coding habit, and cite his JavaScript and trie analyses as worth reading.
275HN people shared it
184linked it in comments
221stories submitted
9.5Kstory points
10 years agolast shared
2007people per year2026

Most-shared posts

  1. 1
    Learning Advanced JavaScript
    36 people · 990 points · first shared 2008 · 55 comments on HN
  2. 2
  3. 3
    Simple, nay classical, JavaScript inheritance
    11 people · 4 points · first shared 2008 · discussion on HN
  4. 4
    Write Code Every Day
    9 people · 1.0K points · first shared 2014 · 216 comments on HN
  5. 5
    JavaScript Micro-Templating
    8 people · 9 points · first shared 2008 · discussion on HN
  6. 6
    How JavaScript Timers Work
    7 people · 105 points · first shared 2008 · 6 comments on HN
  7. 7
    Programming Book Profits
    7 people · 30 points · first shared 2008 · 4 comments on HN
  8. 8
    Learning from Twitter
    6 people · 211 points · first shared 2011 · 36 comments on HN
  9. 9
    Genetic A/B Testing with JavaScript
    6 people · 48 points · first shared 2008 · 14 comments on HN
  10. 10
  11. 11
    New Khan Academy Exercise Framework Is Live
    5 people · 156 points · first shared 2011 · 29 comments on HN
  12. 12
    Processing ported to JavaScript
    5 people · 112 points · first shared 2008 · 28 comments on HN
  13. 13
    The Notes What Spawned JQuery (2005)
    5 people · 56 points · first shared 2009 · 7 comments on HN
  14. 14
    ECMAScript 5 Objects and Properties
    5 people · 30 points · first shared 2009 · 6 comments on HN
  15. 15
    John Resig - DOM DocumentFragments
    5 people · 6 points · first shared 2008 · discussion on HN

What HN people wrote when they linked it

dugmartin · 2016-11-10
John Resig wrote up a nice analysis of tries using Javascript five years ago. It is well worth the read: http://ejohn.org/blog/javascript-trie-performance-analysis/
rnovak · 2015-10-28
I've really never learned anything well by learning a book, maybe you'll have the same luck (or lack-thereof). Id' start building stuff. Follow tutorials, and then starting looking at API docs and experimenting. After that, I'd follow along with 'JavaScript Ninja'[1], straight from John Resig (who designed/wrote? jQuery), which gets into the prototypical inheritance, etc. I've gotten past some fairly well-known Technical interviews through the above approach. Either way, good luck with your journey. http://ejohn.org/apps/learn/
smurfpandey · 2015-02-26
I have started many side-projects but left them half way, because i got bored or something else caught my eye. But with my latest project[0] I am following a simple philosophy by John Resig, "Write code every day"[1]. Even if i write code for 30 mins, it's okay. By following this i am always in touch with the project. It has helped me a lot in being disciplined. [0]: https://github.com/smurfpandey/mysqlweb [1]: http://ejohn.org/blog/write-code-every-day/
khalilravanna · 2015-01-28
Practice as a habit. Practicing something repeatedly, preferably every day, is the best way to get better at something. I started programming every day after being inspired by a blog post by John Resig that got posted to HN [1]. I started a game that I've been working on for 245 days straight. I started with almost no knowledge of game programming and now have, I dare say, a playable game. Github really helped with this because you get a nice display of your commit history over the past year that gives an incentive to not break the chain [2]. I've been able to apply this to other skills I've wanted to get better at: relearning how to play the piano, making music, working out, etc. and have seen great results. 1. [http://ejohn.org/blog/write-code-every-day/] 2. [http://i.imgur.com/6zq1IbJ.png]
mandlar · 2014-04-25
This was a fantastic read! Congratulations on finishing your book. Ever since John Resig wrote about Write Code Every Day [1], I've fallen into the habit of writing some code on a new side project of mine. Every day, at least 30 minutes of work. Not saving up things to do for the weekend makes it a lot less stressful and has increased my productivity significantly. And whatever I've been working on is constantly on my mind instead of put aside until the weekend or some other period of free time. I'm definitely reaping the benefits of not "breaking the chain." [1] http://ejohn.org/blog/write-code-every-day/
mr-ron · 2014-02-03
One of my favorite tutorials from John Resig: http://ejohn.org/apps/learn/
wwweston · 2014-01-30
querySelector and querySelectorAll could have been pretty great, but they suffer from some serious problems as they ended up spec'd. The one I hate most is that qSA returns Yet Another JavaScript Collection That Is A Lot Like An Array But Isn't An Array And Therefore Doesn't Have Any Of The Nice Methods(TM). Yes, you're going to have to iterate over the thing using an index in a loop. There's others: http://ejohn.org/blog/thoughts-on-queryselectorall/ I'm really not sure how the standards-makers got this so terribly wrong given that the libraries had already started to solve the problem.
EdSharkey · 2013-12-10
In my opinion, a zen master should be able to declare classes, extend them, do mixins, construct one off instances and synthetic classes, access super class' methods the old school way, etc without helper functions like the ones listed in the article. Be able to use and master the tools the language gives you. Don't be afraid of the language; but do acknowledge that it is a toy language with lots of invisible death traps. Establish a coding convention that lets your team build and test large scale applications effectively. If that includes helpers and tools, (I like Resig's class.js myself, http://ejohn.org/blog/simple-javascript-inheritance/) then great! Just please make sure the team can do it all without the helpers so that they understand all that is possible.
kemayo · 2013-03-26
As a best-practices criticism, this is using a direct window scroll handler, which can be a bit of a performance nightmare. It's often better to use some sort of throttling to make sure your scroll handler only runs every X ms. The tradeoff there, of course, is that you get a slightly less buttery-smooth pinning experience... but in return your pages will still scroll nicely on non-zippy machines. Resig wrote about this after it horribly mauled Twitter a few years back: http://ejohn.org/blog/learning-from-twitter/
philipwalton · 2013-03-25
John Resig made a similar point in an article discussing using JavaScript as an intro language for the Khan Academy. http://ejohn.org/blog/introducing-khan-cs/ He argues (and I agree) that prototypal inheritance isn't complicated unless you're coming from a very classical inheritance background.
marioestrada · 2013-02-14
I love how this post is the total opposite of John Resig's article about how WebKit is the jQuery of rendering engines: http://ejohn.org/blog/webkit-is-the-jquery-of-browser-engines/ And how the "bloat" added by adding WebKit specific hacks to jQuery is just 3 half-lines of code, I think it would be safe to assume that if Opera was as big as WebKit is jQuery would also need a lot of hacks for it.
scottyallen · 2012-12-02
This would be a great demo to see running in a responsive programming environment, ala Bret Victor's amazing Inventing on Principle talk (http://vimeo.com/36579366). I want to be able to click on hex values and get a color picker that updates the demo in realtime, and be able to click on various magic numbers and drag a slider to change them. Incidentally, Bret Victor's talk was the starting point for Khan Academy's CS curriculum that John Resign led (http://ejohn.org/blog/introducing-khan-cs/). Edit: I managed to get this running in livecoding.io, which does some of what Bret Victor was talking about (basic sliders and color pickers): http://livecoding.io/4191583. Not sure why it's running so much slower though...
jones1618 · 2012-10-11
Just because a problem has been "solved" for one platform (Fast PC's w/ Gigabytes of ram/disk) doesn't mean it is solved for all platforms (Web apps for phones/tablets, etc). John Resig (of jQuery and Khan Academy fame) had a really interesting thread on creating a fast-loading (i.e. small, efficient) dictionary for a JavaScript app. http://ejohn.org/blog/revised-javascript-dictionary-search/ The comments have some really clever ideas for encoding the dictionary and Resig weighs in on his favorite solution with informative data. There's an interesting "Succinct Trie" data structure that turns a 620K dictionary into a 220K string that doesn't need to be decoded to be searched. http://stevehanov.ca/blog/index.php?id=120
ehsanu1 · 2012-08-30
Khan Academy has a pretty amazing live environment inside the browser: http://khanacademy.org/cs It's been tested to work pretty well with middle school children, so it seems right up your alley. John Resig (creator of jQuery) made it happen, his blog post on it: http://ejohn.org/blog/introducing-khan-cs/
bryanlarsen · 2012-08-14
You're right about some of the warts of javascript. John specifically discusses these in a different blog post. http://ejohn.org/blog/javascript-as-a-first-language/ Some of these warts are surprisingly easy to work around: for instance, they always use "===" and don't even tell the student about "==" until much later. In other cases I just think you're wrong. For instance, I think that the prototype system is simpler and easier to understand than classical objects, while at the same time being more powerful.
graue · 2012-07-31
I'm confused. In the features list: "Prism forces you to use the correct element for marking up code: <code>." But the site's index.html is using only a pre tag: <p>The Prism source, highlighted with Prism (don’t you just love how meta this is?):</p> <pre data-src="prism.js"></pre> It looks like the script is automatically expanding this, inserting <code> tags along with the named file, but I don't see any documentation for doing it this way. Also, if anyone is as confused as I was about why there's a "data-src" attribute, apparently it's an HTML5 data attribute: http://ejohn.org/blog/html-5-data-attributes/
stc · 2011-11-07
The Eloquent Javascript book is excellent, thanks for the heads up. Definitely helping to expand my mind as I work through it. For anyone else here trying to learn I have also been using it conjunction with this tutorial here http://ejohn.org/apps/learn/ that has lots of interactive examples but not so much on explanations.
icebraining · 2011-10-17
Daily, none, but I have some on my RSS reader; besides the ones already posted: http://julien.danjou.info/blog/index.html ← Julien Danjou, Awesome WM main (only?) dev. http://ejohn.org/ ← John Resig, jQuery creator and lead dev http://codeutopia.net/blog/
dmethvin · 2011-08-16
It depends on the selector and the browser. Something like $(".myclass") is worth caching on IE7 because it requires a pass through the entire document; there's no `querySelectorAll` or `getElementsByClassName`. I wouldn't start by caching selectors all over the place unless you profile and see that it's slow. Doing a lot of selecting in a `scroll` or `mousemove` handler would be a bad idea though: http://ejohn.org/blog/learning-from-twitter/
dave1010uk · 2011-07-21
John Resig (creator of jQuery) has some great interactive excercises: http://ejohn.org/apps/learn/
mun2mun · 2011-06-30
http://ejohn.org/apps/learn/ http://bonsaiden.github.com/JavaScript-Garden/ And JavaScript: The Good Parts book as others recommended.
apitaru · 2011-02-05
Thanks for the library! It's always great to see new game-dev solutions for JavaScript coders. It would be interesting to embed the game inside a native iOS app and distribute it through the app store... http://ejohn.org/blog/iphone-javascript-apps/ I'm assuming it'll take a tremendous performance hit vs. native apps, but not all games need 60fps.
tlrobinson · 2010-12-17
My recommendations: Videos: * YUI Theater talks by Douglas Crockford: http://developer.yahoo.com/yui/theater/ especially: * The JavaScript Programming Language * Advanced JavaScript Websites: * "A Re-introduction to JavaScript": https://developer.mozilla.org/en/a_re-introduction_to_javascript * Advanced tutorial from John Resig: http://ejohn.org/apps/learn/ * MDC Reference: https://developer.mozilla.org/en/javascript Books (you can borrow my copies of these if you want): * "JavaScript: The Good Parts" * "JavaScript: The Definitive Guide" is a good reference for both the language and browser/DOM APIs
talkingtab · 2010-06-26
Not a book, but a great source of information beyond basic syntax is http://ejohn.org/apps/learn/
invisible · 2010-03-28
I don't know - I love PHP classes but I'd love to see PHP with prototype-style inheritance (if PHP had classes for strings, etc. in respect to basic variable types). I think the "everything is an object" route is great and coupling that with prototypes exemplifies that decision's greatness. However, I really do think that JavaScript needs all of the great things ECMA 5 displays first and foremost (such as strict mode, getters/setters/enumerable/configurable/writable for property descriptors). John Resig does an excellent job of summing up ECMA 5 pragmatically (it truly must be great to work on JavaScript stuff as a day job): http://ejohn.org/blog/ecmascript-5-objects-and-properties/
nostrademons · 2009-12-29
If everyone thought this way, many really great projects would never have been started, because their authors would be so bogged down by maintenance work they'd never do anything new. Take a look at John Resig's projects page: http://ejohn.org/projects/ Click on anything that's not a JavaScript project, and you get a broken link. Would you rather he spend time fixing them up, or would you rather he spend time improving JQuery?
dschoon · 2009-07-31
I have great admiration for the amount of time and precision put into this article--as well as Amazon's relentless, cold, uncool devotion to optimization. These meditations on A/B optimization reminded me of a genetic algorithm-based A/B testing framework mentioned not too long ago: http://ejohn.org/blog/genetic-ab-testing-with-javascript/ (I'd link to Genetify itself, but there's no homepage, just the demo) An interesting thought: Why hasn't this caught on? Machines are good at exactly the things A/B testing aims at: measuring performance, permuting a test-matrix, and reporting on the results. This is not to say Genetify is the answer, but rather that I rarely hear of conversion optimization from developers.
adamhowell · 2009-06-29
As far as I can tell only one "cludge" for all of IE (one JS file). I really couldn't care less about FF2. View source here -- http://2009.full-frontal.org/ -- then visit it in IE. Works great. DIVs weren't meant to be the only way to style w/o tables. For a front-end guy like me, this is pretty cool. (Also, more about the "HTML shiv" approach they're using is here: http://ejohn.org/blog/html5-shiv/)
jeresig · 2009-06-19
I posted my follow-up thoughts here: http://ejohn.org/blog/unimpressed-by-nodeiterator/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close