YUI Blog
yuiblog.com · Company blog · on HN since 2007
Yahoo's developer blog for the YUI library, featuring web performance research and talks by Douglas Crockford on JavaScript.
What HN saysCommenters mainly recommend its Douglas Crockford videos as the best JavaScript teaching they know, and cite it for browser support and performance advice.
141HN people shared it
71linked it in comments
103stories submitted
1.1Kstory points
7 years agolast shared
2007people per year2026
Most-shared posts
- 1Crockford on JavaScript19 people · 126 points · first shared 2010 · 17 comments on HN
- 240-60% of Yahoo's users have an empty cache experience7 people · 35 points · first shared 2008 · 11 comments on HN
- 3Ryan Dahl: Introduction to NodeJS6 people · 50 points · first shared 2010 · discussion on HN
- 4Douglas Crockford on Fat Arrow Functions in JavaScript4 people · 132 points · first shared 2012 · 60 comments on HN
- 5Node.js, YUI 3 & Dom Manipulation… Oh My4 people · 59 points · first shared 2010 · 8 comments on HN
- 6Event-Driven Web Application Design3 people · 7 points · first shared 2009 · discussion on HN
- 7Announcing YUI 3.4.0 and the new YUILibrary.com3 people · 4 points · first shared 2011 · discussion on HN
- 8What the 80/20 Rule Tells Us about Reducing HTTP Requests3 people · 3 points · first shared 2008 · discussion on HN
- 9Image Optimization, Part 4: Progressive JPEG…Hot or Not?3 people · 2 points · first shared 2008 · discussion on HN
- 10YUI Theater — Dav Glass: “Using Node.js and YUI 3″ (36 min.)3 people · 2 points · first shared 2010 · discussion on HN
- 11YUIConf 2012 Talk: Douglas Crockford on Monads and Gonads3 people · 2 points · first shared 2012 · discussion on HN
- 12Douglas Crockford: The JavaScript Programming Language3 people · 1 points · first shared 2008 · discussion on HN
- 13Performance research part 33 people · first shared 2009
- 14Module pattern3 people · first shared 2009
- 15Douglas Crockford: The JSON Saga [video]2 people · 56 points · first shared 2009 · 3 comments on HN
What HN people wrote when they linked it
columbo · 2014-08-29
I know Wells Fargo went full-bore with YUI to the point of creating their own derivative (http://www.yuiblog.com/blog/2013/11/08/yuiconf-2013-an-amazing-two-day…
I have to say, enterprise companies like WF really have it tough. With thousands of applications and tens-of-thousands of developers by the time they implement anything it's already been rendered obsolete.
At least they didn't go 100% Flex like some other companies
ville · 2012-07-11
I haven't read the book, but this praise of with statements struck me as odd: "The portions of this book that cover features that are relatively un-changing, such as code evaluation, with statements, and timers are continually being used in interesting ways." There also seems to be even a whole chapter in the book dedicated to with statements. What are those interesting and great applications that justify this feature, being considered harmful[0] and even removed from the language in strict mode of ES5?
[0] http://www.yuiblog.com/blog/2006/04/11/with-statement-considered-harmf…
dmix · 2011-11-23
Douglas Crockford is the best JS teacher I've come across.
This video series is excellent (and provides a bit of CS history) http://yuiblog.com/crockford/
Also his book, Javascript: The Good Parts
bluesmoon · 2011-02-09
IE6 is turning into a C grade browser this quarter (http://yuiblog.com/blog/2010/11/03/gbs-update-2010q4/) so you can probably just not serve JavaScript to it (server side detection). IE7 still doesn't do parallel script downloads, so you might need to do bottom loading for it, but it's best to first find out what your users use before optimizing for it. You can get really complicated and change your page structure based on useragent and user's network characteristics, but that requires far more development effort.
tworats · 2010-10-21
I'm shocked nobody's recommended Douglas Crockford's ... well ... everything:
http://javascript.crockford.com/
Watch the "Javascript: The Good Parts" presentation:
http://yuiblog.com/blog/2007/06/08/video-crockford-goodstuff/
Also check out Dustin Diaz's stuff:
http://www.dustindiaz.com/
I found his screencasts where you watch him program to be incredibly helpful:
http://www.dustindiaz.com/screencast-episode-01/
Start your javascript programming with jQuery. Good javascript style is not at all like Java, so forget everything you know about Java and see how jQuery does it.
thechangelog · 2010-02-24
The whole series so far ( http://yuiblog.com/crockford/ ) is, as you would expect, excellent.
Tihauan · 2010-02-20
"The mother of all demos" was used for this particular demo by Douglas Crockford in one of his public lectures about Javascript, http://yuiblog.com/crockford/. I also recommend watching that, btw.
Besides the fact that this title is catchy - what's wrong with that? - it also tells more about the content than "the demo by Doug Engelbart from 1968". Surprisingly, not that many people know or care who Doug Engelbart is.
pxlpshr · 2008-10-28
LinkedIn uses the framework on their site, and they gave a number of great reasons why.
http://yuiblog.com/blog/2008/06/05/implementation-focus-linkedin/
drderidder · 2014-11-06
Crockford has good recommendations on when to use `new`, or not, in his 2006 post on the topic[1]. I like most of what the author says re. classical OO in JS, but would stop short of not using `new` at all. Its a long-established standard and the open/close principle[2] is probably not enough of a concern in most applications to warrant using a different / slower / sometimes unsupported method. And there are functional programming libraries for extending objects[3]. Just encourage people to use idiomatic JS and then layer on solutions when and if they become a problem.
The article uses stories of obscure bugs as justification. These stories get used an awful lot to justify dogma on everything from strict typing to Promises to whatever. I feel that's misguided - there will always be enough rope to hang oneself with in any language, and those errors should have been mitigated by diligent use of static code analysis (linting) and unit testing. The author's book Programming JavaScript Applications[4] (which looks excellent otherwise) doesn't cover testing, either, but devotes a chapter to using logging for debugging. I'd rather advocate using lint-on-save, test-driven development, test coverage, and continual integration.
Also, for a deep dive into OO criticism, Thomas Neimann's article Nuts to OOP! is a must-read. [5]
[1] http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-ya/
[2] http://en.wikipedia.org/wiki/Open/closed_principle
[3]…
alanning · 2011-05-19
Thank you for this article. I recently started teaching my sister how to program and chose Python thanks to articles/discussions on HN similar to this one.
If you are taking pull requests here are a few suggestions:
* "Honing Those Skills"
+ http://hginit.com (Free, Web)
[Why? I found it a wonderful intro to distributed version control in general and Mercurial specifically]
+ http://yuiblog.com/crockford/ (Free, Video+Transcripts)
[Why? Provided great context and in-depth details in a very efficient manner]
* "Gettin’ Paid, Makin’ Money"
+ C# / .NET (Large job pool)
* "Things You’ll Need"
+ Ability to take constructive criticism
[Why? Get better faster. Appreciate user feedback.]
* "Not Another Neckbeard"
- Teh Womenz
[Why? It's obvious from your comments that you do not feel this is sexist nor did you mean it to be. I would have to log this under "taking constructive criticism" however. You point out that you know women who don't mind but there are some women who are bothered by this and taking it out would not impact the goal of the article. If you can make 1 person feel better about your writing by removing it to avoid any misunderstandings while not altering your meaning, it seems like a win for all.]
sradnidge · 2011-04-14
I wouldnt be put off reading The Good Parts by that post, although it does raise some valid points IMHO. The point is, the author of that blog post probably wouldn't have even known about those things had they not read the book. Whether something is 'good' or 'bad' is somewhat subjective. Check out Crockford's YUI Theatre lectures (http://yuiblog.com/crockford/) to get a taste of what you'll be in store for in that book.
At some point in those videos he mentions a book called The Little Schemer - I haven't read that but the reviews on Amazon look decent and if Crockford calls it out as useful you should probably not ignore it.
I found a really good book to be Object Oriented JavaScript from Packt (http://www.packtpub.com/object-oriented-javascript/book). Unlike most other js books, it spends a good few hundred pages without mentioning browsers. I seem to recommend their books a fair bit, no I do not have anything to gain from doing so :)
Finally, once you start getting stuck into things go hang out in the #node.js IRC channel. IRC is still probably the best technical resource out there as far as I'm concerned, especially when the community is as friendly as the #node.js regulars are.
travisglines · 2011-04-12
As someone who has spent the last six months coding in Node.js, I completely disagree with this notion.
One of my favorite advantages of Node is in fact that it is based on javascript. When building my application I can share code between client/sever side (string formatting methods for example) and don't need to do any mental context switching when it comes to languages. I've developed in javascript for years and all that I have learned doesn't go out the window here, all I need to do is learn how to use a few libraries.
The "faults" of javascript are primarily inexperience with event looped architectures that use callbacks (people complaining about having to use callbacks and the spaghetti code messes they make), people remembering the past horrible browser implementations of it (where something would work/be fast in one browser and not another ... Internet Explorer I'm looking at you) and confusion over how prototypical languages work vs. standard OOP.
Callbacks aren't that bad and a few extra nesting levels shouldn't create chaos in your code. Since its based entirely off of one javascript implementation (V8) the cross browser stuff is gone. How it handles OOP is different, just watch these videos first and you'll be fine: http://www.yuiblog.com/blog/2007/01/24/video-crockford-tjpl/
As far as speed goes it gets huge benefits by being javascript. Every time the Google coding machine feels like making V8 a little faster, Node gets faster too.
Yes its different,…
j-g-faustus · 2010-04-24
HTML is not complicated at all, that's why it became a success - pretty much anyone could learn to write a basic web page in a few weeks.
Web pages became complex over the years as people wanted do things that HTML was never meant to do. Like page layouts: Early on, people would use invisible images for spacing, humongous nested tables to "hack" a page layout in a language that didn't support page layouts, and pictures of text rather than actual text for example for non-standard fonts or text shadows.
The primary problem is that HTML was never designed for the kinds of things we use the web for today. See the Crockford Javascript presentation for a history of HTML and Javascript, I recommend Episode IV: http://yuiblog.com/crockford/
Designing an "HTML killer" is no simple task, all attempts so far have failed - from Java applets to XML.
But even today you can use applets or Flash to embed more complicated programs. The web protocols turned out to be eminently hackable, and with server-side page generation, forms, CSS, Javascript and now canvas it is "good enough" for more and more tasks, so I expect it is safe to say that HTML will be with us for quite a while longer.
csytan · 2009-09-22
I'll assume this is for client side js, since that's what most people use =)
Most of the js I write involves jQuery. As such, I find it's very useful to separate reusable components into jQuery plugins in separate files. If you don't use jQuery or another library which allows plugins, then it's best to create your own namespaced module.
See the "Module pattern" for more info:
http://www.yuiblog.com/blog/2007/06/12/module-pattern/
Depending on the complexity of your code, you might want to look into javascript build systems -- there's at least one for every major web framework.
Here's some advantages they offer:
- Allow bunding of many js files into one mega js file. (reduces HTTP requests for faster page loading)
- Specify javascript dependencies using special syntax. (easier maintenance)
- Versioning support (so users don't get an old cached version of your code)
When bundling js files, I try to aim for a maximum of two js files per page. One contains code which is global to the whole site (this is cached on subsequent views), and the second which contains page specific code.
peterwwillis · 2018-08-30
The reason why you should limit cookie sizes is request round trip.
A typical GET request involves multiple headers, including cookies. Cookies are sent for every request for any resource for a given domain. The more cookies you have, and the bigger they are, the bigger your request. The bigger your request, the more likely it is to take longer to send and receive it. The more of them you send, the more latency accumulates.
When The Cookie Crumbles https://yuiblog.com/blog/2007/03/01/performance-research-part-3/
Reduce Cookie Size https://developer.yahoo.com/performance/rules.html#cookie_size
Performance Limits https://stackoverflow.com/a/6963585
VertexRed · 2016-09-28
When I was experimenting with PS a few years ago, progressive JPEGs were always larger than baseline which is why I came to that conclusion.
This isn't however the full picture.
To keep it short, baseline JPEGs are usually smaller if the file size is less than 10 KB.
Useful article about progressive JPEG sizes: http://yuiblog.com/blog/2008/12/05/imageopt-4/
kgwgk · 2016-01-14
Not that this is wrong, but YUI was released less than one month later and had been in use at Yahoo for a few months.
http://yuiblog.com/blog/2006/02/13/the-yahoo-user-interface-library/
steveax · 2015-01-29
Good introduction to screen readers from Victor Tsaran of Yahoo [1] also shows his normal speed for browsing.
[1] http://yuiblog.com/blog/2007/05/14/video-intro-to-screenreaders/
drgath · 2014-08-29
YUI did host its own blog, but it was shut down a few days ago. http://www.yuiblog.com/blog/2014/08/25/weve-moved-to-tumblr/
ryannevius · 2014-06-17
Right on their blog (deprecation of their gallery, at least): http://www.yuiblog.com/blog/2014/06/16/yui-gallery-deprecation-announc…
However, the framework itself was just updated to a new version (3.17.2) two weeks ago. I can find nothing about the framework being dropped.
dottrap · 2014-06-01
Douglas Crockford (JavaScript: The Good Parts) has talked about this problem with binary floating point to do decimal (human) math, on many occasions.
Here is one such instance.
http://www.yuiblog.com/blog/2009/03/10/when-you-cant-count-on-your-num…
He has been on a crusade to introduce a decimal based floating point standard because he believes it is finally time we revisit this decision to use binary floating point.
Edit: spelling
cellover · 2014-02-03
I am currently in the process of re-learning JavaScript from scratch. And I found the light:
1. Douglas Crockford videos: http://www.yuiblog.com/crockford/
2. Eloquent JavaScript intermediate level tutorials: http://eloquentjavascript.net/contents.html
alec · 2013-11-28
A 2007 Yahoo investigation found 40-60% of Yahoo's users came to the site with an empty cache, accounting for 20% of page views. Empty cache experience is important.
http://www.yuiblog.com/blog/2007/01/04/performance-research-part-2/
grannyg00se · 2013-09-06
Crockford's story [1] behind the genesis of JSON is similar. Everything was already there, but he's the one who formalized it gave it an official home. That helped propel it to its current level of popularity. The fact that he didn't create javascript, the internet, the www, tcp, etc is not relevant.
[1] http://www.yuiblog.com/blog/2009/08/11/video-crockford-json/
wavesounds · 2013-09-03
Check out Douglas Crockfords book "Javascript the Good Parts" and/or his talks at Yahoo http://yuiblog.com/crockford/
XionOfCha0s · 2013-07-31
Personally I like this tutorial by douglas crockford
http://www.yuiblog.com/blog/2012/12/13/yuiconf-2012-talk-douglas-crock…
ycitm · 2013-07-15
Crockford has some very interesting things to say about it:
http://yuiblog.com/blog/2006/10/20/video-crockford-domtheory/
mjackson · 2013-05-20
From the OP:
> I changed the app to use cookie-based sessions, so that session data is stored in signed cookies rather than in memcache. This way, the web app servers don't need to share any state (other than the database). Plus it's faster for end users because the app doesn't have to hit memcache for session data.
The switch to using cookies for storing session data instead of memcache has tradeoffs. Sure, you no longer need to ask memcache for the session data. But you are also shipping a significantly larger cookie back and forth on every request.
If you're storing a lot of data in your session, this could actually slow things down in the long run. [1]
[1]: http://yuiblog.com/blog/2007/03/01/performance-research-part-3/
stoey · 2013-05-09
That's not actually what the Crockford link says [1] it talks about using array and object literals in place of `new Object()` or `new Array()`. Which does indeed seem faster [2].
[1] http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-ya/
[2] http://jsperf.com/new-vs-object-literal
mixmastamyk · 2013-04-08
I enjoyed the Crockford on Javascript talks. Even if you're not interested in JS, the first talk is about the history of computing/programming languages and is quite interesting.
http://yuiblog.com/crockford/