D

Douglas Crockford

crockford.com · Personal blog · on HN since 2008

Douglas Crockford, a JavaScript figure and JSON promoter, writes on JavaScript, parsing, Base32, DEC64 and his Misty language.

What HN saysCommenters recommend his site for learning JavaScript and cite his Base32 encoding as a good compromise for length and avoiding confusable characters.
180HN people shared it
111linked it in comments
90stories submitted
1.1Kstory points
2 months agolast shared
2008people per year2026

Most-shared posts

  1. 1
  2. 2
    Base 32
    16 people · 11 points · first shared 2020 · 2 comments on HN
  3. 3
  4. 4
    DEC64: Decimal Floating Point (2020)
    9 people · 88 points · first shared 2021 · 56 comments on HN
  5. 5
    Base32
    9 people · first shared 2012
  6. 6
    Misty Programming Language
    8 people · 71 points · first shared 2023 · 47 comments on HN
  7. 7
    The Little Javascripter
    8 people · 47 points · first shared 2009 · 12 comments on HN
  8. 8
    Top Down Operator Precedence (2007)
    8 people · 29 points · first shared 2018 · 5 comments on HN
  9. 9
    Classical Inheritance in JavaScript
    7 people · 31 points · first shared 2010 · 7 comments on HN
  10. 10
  11. 11
    CSS Color Names
    5 people · 5 points · first shared 2008 · discussion on HN
  12. 12
    Jsmin
    5 people · first shared 2008
  13. 13
    Little
    5 people · first shared 2019
  14. 14
    Little Scheme
    4 people · 5 points · first shared 2008 · discussion on HN
  15. 15
    Javascript
    4 people · first shared 2008

What HN people wrote when they linked it

DjDarkman · 2011-01-15
Make sure to ask this guy: http://crockford.com/ I think he would have some great suggestions. :)
ams6110 · 2010-02-09
Douglas Crockford, who's website really opened my eyes to the capabilities of Javascript about 4 years ago, recommends only one book: JavaScript: The Definitive Guide (5th Edition) by David Flanagan Since he wrote that, he's also come out with his own book, JavaScript: The Good Parts. Disclaimer, I have not read either book, but I highly recommend his website: http://www.crockford.com
jcl · 2008-03-12
I've been learning JavaScript myself, and I've been finding Douglas Crockford's site useful: http://www.crockford.com/ (Note that to become the best JavaScript programmer ever, you'll probably have to pick up some other languages along the way. But JavaScript is both a good language to learn and a good language for learning, so it's not a bad idea to learn JavaScript really well first before learning others. Keep an open mind.)
kamjam · 2014-03-05
This one is great also: http://www.crockford.com/
Merad · 2025-10-18
Crockford base32 [0] is the best compromise, IMO. Reasonable length of 26 chars. Uses only alphanumeric characters and avoids issues with case sensitivity and confusing characters (0 vs O, etc.). 0: https://www.crockford.com/base32.html
cantSpellSober · 2024-01-08
There's even "dead project, alternatives?" Issue in the Github https://github.com/yui/yuicompressor/issues/276 For discussion, today's "best" equivalent would be...esbuild? Speaking of Crockford and minifiers, the delightfully simple site for JSMin (2001) still exists https://www.crockford.com/jsmin.html
fargle · 2023-07-04
Pratt parsers are one of the most beautiful ideas and were somewhat forgotten (mislaid?). This is a neat article and has great references but I think he missed Douglas Crockford's great blog post (https://www.crockford.com/javascript/tdop/tdop.html) about them from 2007. I think that it is somewhat responsible for them resurfacing. Nice to see another good article and people talking about them and another example in a different language.
KMag · 2023-01-19
Crockford's version of base32 [0] (sometimes called crockford32) treats 0, o, and O the same when decoding, likewise for 1, i, I, l and L. It also doesn't use the letter U, to reduce the chances of including English obscenities. So, you don't need to remove ambiguities if you can collapse the ambiguities into equivalence classes. If you're going to use some flavor of base32, crockford32 is hard to argue against. I could bikeshed some alternatives (I would use the letter U and include Q in the 0 equivalence class, and not worry too much about obscenities), but of the somewhat common base32 standards, crockford32 is the best, IMNSHO. [0] https://www.crockford.com/base32.html
mhoad · 2022-01-08
I recently read a book by Google’s head guy on API design that was specifically about designing APIs and it had a big section on what makes a good identifier and why people reach for UUIDs and why specifically it is a problem on multiple levels. The thing that he ended up recommending however was super interesting in that I had never seen it mentioned before but it was basically to use this instead http://www.crockford.com/base32.html
pkulak · 2020-04-02
Or my personal favorite for anything you show to a user: https://www.crockford.com/base32.html
joallard · 2016-11-30
Case-insensivity is important for some to be able to reliably remember a string. I won't easily retain the difference between 'b4dQbFs31' and 'b4DqBfs31'. Same thing when speaking it out loud. 'B four D capital Q B capital F s thirty-one' is way more convoluted and error-prone than 'B four D Q B F S thirty-one'. The best thing I've found that fits this criterion is Crockford's Base 32 [1], basically the extension of hex digits, removing letters ILOU. But Base 32 (case-insensitivity by proxy) constrains us to 5 bits, which is only a 20% reduction over the 4 bits of base 16. So instead of the 20 bits `1ab2f` we could express them with something like `1qm3`. Or we could be using words... [1]: http://www.crockford.com/wrmg/base32.html
zcrar70 · 2015-09-28
He explains this here: http://www.crockford.com/javascript/encyclopedia/preface.html (In summary, it's a started work but not finished, and he's hoping people will step in to help him finish it). I do wonder how useful this going to prove, given Mozilla's already excellent reference material (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference).
guiambros · 2014-01-19
"Lessons from Habitat" [1], by Chip Morningstar and F. Randall Farmer. Not inspirational in the strict sense, but it's amazing to see a paper written more than 20 years ago and still with so many applicable insights in terms of psychology in gaming and virtual worlds. I keep going back and re-reading every couple of years. [1] http://www.crockford.com/ec/lessons.html
niggler · 2013-04-29
I think Crockford (http://crockford.com/) -- he is mentioned in the RFC: http://www.ietf.org/rfc/rfc4627.txt?number=4627
oinksoft · 2013-03-04
Don't consider learning a language like CoffeeScript or ClojureScript until you thoroughly understand JavaScript. I think it's much easier for a beginner to learn JavaScript APIs (both built-in and third-party), which you'll need, from JavaScript examples without having to translate them to another language in the process. Also, I'm not sure you can use these other languages' features judiciously without understanding their reasons for doing things a certain way. You will need to know how `this' and `prototype' are used and things of that nature, then you can decide if you find the abstractions and overhead of compile-to-JS languages useful. CoffeeScript implements a classical OO system: http://www.crockford.com/javascript/inheritance.html
taylodl · 2012-04-27
The trouble with JavaScript is the name is misleading - you're lead to believe it's a scripting form of Java. Instead it's more akin to Lisp in C clothing. Doug Crockford explains it best. http://www.crockford.com/javascript/javascript.html
mikeleeorg · 2011-08-22
To piggy-back off what reid contributed, here is Crockford's website containing a lot of his essays on JavaScript and a calendar of his past & upcoming speaking events: http://www.crockford.com/ He's also been active on Google+ https://plus.google.com/118095276221607585885/posts
kraynar · 2010-10-06
Agreed, but the name is Crockford. His site, which has a bunch of interesting JavaScript links on it: http://crockford.com
bootload · 2010-07-08
"... When I put the reference implementation onto the website, I needed to put a software license on it. I looked up all the licenses that are available, and there were a lot of them. I decided the one I liked the best was the MIT license, which was a notice that you would put on your source, and it would say: "you're allowed to use this for any purpose you want, just leave the notice in the source, and don't sue me." I love that license, it's really good. ... So I added one more line to my license, which was: "The Software shall be used for Good, not Evil." ..." I was using JSMin (py) today ~ http://www.crockford.com/javascript/jsmin.html wondering why there was no installer and poking around I found this article. Seems the addition of additional line in the MIT license gives lawyers headaches.
mrduncan · 2009-11-02
I didn't see any links to videos - here is one from his Google tech talk in February: http://www.youtube.com/watch?v=hQVTIJBZook. He also has a number of videos on YUI Theater (http://developer.yahoo.com/yui/theater/). I also recommend checking out the javascript page on his website, plenty of javascript related material to keep you busy for hours: http://www.crockford.com/javascript/
gord · 2009-10-14
Hmm.. How about the ADsafe code - http://www.adsafe.org/adsafe.js by Douglas Crockford, author of 'JavaScript : the good parts' - http://www.crockford.com/
bryanrasmussen · 2026-08-06
>You describe things like "access the file system" but what even is that? In Linux, if you write to a "file" in /proc or /sys, you can trigger all sorts of side effects, including cause a kernel panic. well, you can could of course go ahead and read some of the literature on capabilities based security, but you don't seem interested in that, so I guess I will give a go. Here I will give a not necessarily great description of capability based security where the capabilities are handled on the OS level, this is my poorly remembered version of a document read about 20 years ago. In Windows if you, as an attacker, are somehow able to do a complicated attack on any program that a user runs and it succeeds you can make that program do anything that the user has access to do. For example make it write to the local filesystem. For a large number of programs writing to the local filesystem does not make any sense and they were not written to do that, but now that the program has been corrupted by your attack it will write to the filesystem. But let us suppose our program, Solitaire, was written with a capabilities based language then in the manifest for the program when we installed it it would not give access to the file system. The capabilities system can in fact be very explicit, and you could easily have a program be explicitly limited to only those abilities that are needed to run your solitaire game, but instead of going on at length on this and the abilities it confers to…
horsawlarway · 2025-05-07
Yeah, and if people would solely use them as comments for humans to read... I'm with you. But they won't. A big part of the reason comments weren't included in JSON is that people tried to get clever with them. Directly quoting Crockford: > I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. And while I'd also love to occasionally throw a comment in a json file, I don't want to have to deal with any of the headaches they would have created in the ecosystem. And to be fair to Crockford here - it's not like he wasn't aware this was a downside. He even released a tool as a preprocessor for JSON if you wanted to put comments in: https://www.crockford.com/jsmin.html JSON intentionally chose to stay as simple and compatible as possible, and personally - I think that constraint was the right call. If I'm writing files I want to throw a lot of comments in... It usually means I should move to something like YAML instead. Again - JSON is terrible at a lot of things, but really hammered on simple and easy as focus points. If you give devs a place to store data outside the structure of the protocol... they will use it for all sorts of complicated craziness... which devolves to either multiple protocols, or a really complicated protocol.
lolinder · 2024-05-16
Just to be clear, this is what he actually says in that video: > And it's still maybe for its field of application the best language in the world for doing that kind of stuff but that's not good enough. We should be moving on to the next generation of languages. It used to be that we'd get new computer languages about every generation. That started with Fortran and then C and C++ and Java and JavaScript and so on and then it kind of stopped. There are still people developing languages but nobody cares. One person can make a programming language, a really good one, but you can't get adoption for it. This isn't Crockford becoming converted to the anti-JS crowd and hopping back to C, it's Crockford arguing that JavaScript shouldn't be the final iteration of programming languages. Presumably he believes that about C as well. It looks like he's working on writing a new language, Misty, intended to (maybe) replace JavaScript: https://www.crockford.com/misty/
smlckz · 2020-04-27
JavaScript is very expressive and powerful language. Maybe hard to learn. The prototypal inheritence and 'this' were confusing to me and took much time to understand those. Then I learnt that prototypal inheritance is a superset of ''class''ical inheritance [1] as well as this [2]. Hmm. With Reflect, Proxy etc. you have great metaprogramming capabilities that make this language much powerful. Still, there are some (many?) edge/corner cases and unfixable bugs (aka features) that the language is stuck with for the sake of backwards compatibility and developers have to learn these. (The most famous of these might be typeof null === "object") When I look at the amount of features added to the language specification, sometimes it seems like it is going to become another incarnation of the C++ specification. I still like its expressiveness and power, but if it becomes another C++ in future, I have to look somewhere else. (TypeScript maybe.) [1]: https://aaditmshah.github.io/why-prototypal-inheritance-matters/ [2]: https://wiki.c2.com/?ClosuresAndObjectsAreEquivalent and https://www.crockford.com/javascript/private.html
EtDybNuvCu · 2018-04-04
I'm not gonna bother quoting you to fisk you. Your approach towards my evidence is weak overall. I'm gonna throw more evidence at you. Miller and Dean Tribble have been working on WeakRefs lately: https://github.com/tc39/proposal-weakrefs Crockford's personal site no longer has the original JSON description, and neither does the Wayback Machine, but his site does still have a section on E: http://www.crockford.com/ In this talk [0], Crockford discusses the origin of JSON. He mentions working with Chip Morningstar (this guy http://habitatchronicles.com/2017/05/what-are-capabilities/) and has oblique references to his prior work. He doesn't bother to explain what he was doing during the 90s here, and at this point social interaction becomes required to learn more. 'hammering the ES peg in the E hole' is wrong. They're hammering the E peg into the ES hole. Not all of us believe in this approach; some of us think that JS is irredeemable and that we should keep iterating with languages like Pony and Monte which expand on the original E concepts. Like I said, kicking and screaming. I don't know why you all kick and scream so much, but you do. [0] http://www.youtube.com/watch?v=-C-JoyNuQJs
Tloewald · 2014-02-16
It's been a while since I used it, and I can't remember what the problems were off the top of my head but they were face palm level. Here's a discussion on stack exchange: http://programmers.stackexchange.com/questions/173176/javascript-objec… The general problem with all classical inheritance patterns in Javascript is that they don't really work (they treat Javascript as a static language so you get all kinds of nasty surprises because it isn't). This is particularly sad in comparison with older, conceptually simple languages like Objective-C that do this stuff properly. Crockford himself says it was a mistake to even include the section in the book (in 8 years he's never used it) http://www.crockford.com/javascript/inheritance.html The takeaway point is that doing classical inheritance in Javascript is a Bad Idea. If you think you've done it, you probably haven't. And no-one will use it.
csense · 2013-05-29
The curse of binary thinking is that numbers get really long. For example, if you have pi to six decimal places (truncated not rounded), it's 3.141592. Equivalent precision in binary is 11.00100100001111110110. Thinking in base 10 or base 16 (or if you're Douglas Crockford, base 32 [1]) is much easier for most people. It probably has something to do with how the human brain is wired. Not to mention the benefits of network effects -- most people use base 10, so if you use a different base, it's going to be a pain to convert all the time. I should also give a shout-out to base 8 for those who frequently use the "chmod" command, and anyone who thinks putting a zero in front of a number in their favorite programming language won't change its value. Obviously, this is only a comment about the headline and has nothing to do with the linked article's actual content. [1] http://www.crockford.com/wrmg/base32.html
Isofarro · 2012-04-16
"He has Douglas Crockford and Brendan Eich on the pro-trailing-semicolon side" Brendan Eich, the conceiver of the language. The best placed person in understanding why the JavaScript language does what it does, and what problem a feature was trying to solve. Douglas Crockford, the developer who took all of JavaScript and found within a clean elegant language. And then he pulled together what he considered the best bits of the language and used that subset as a starting point. http://anongallery.org/220/javascript-the-good-parts @fat - no idea who he is, apart from being an employee of Twitter and works on Twitter Bootcamp, which is a framework for other people to use to build websites. @izs - I think you overreach by grouping him as anti-semi-colon. Isaac is a pragmatist, he uses what suits the group of people he works with. NPM is a standalone app, a non-expert JavaScript developer doesn't need to delve into npm for it's standard usecases. So he choses a syntax he believes suits the group of people working with him. And yet, he is now the lead developer of Node.js, and he's already on record saying he won't be spending time changing Node.js into his preferred comma prefixed approach - because the existing team is already used to post fixed commas. That's what I like about Isaac - he listens to a wide range of opinions, and uses what works best for the environment he's in. Thomas Fuchs - heard of him, he's done lots of stuff JavaScript and PHP wise. I'll give you that…
nostrademons · 2008-04-16
For JavaScript, I've settled on using JSMin (http://www.crockford.com/javascript/jsmin.html) + GZip at the server level. Someone did a test of various compression tools and found that while they had wildly varying sizes before GZipping, they all came out to roughly the same size after GZip, except that I think raw+GZip was a bit bigger than JSMin/Packer/YUICompressor+GZip. So there's no reason to pay the extra decompression & debugging overhead that Packer entails. You'll probably want to concatenate all your JavaScript files together to save on HTTP requests. I wrote a dependency analyzer that reads dependency info off the JSDoc and automatically topologically sorts them to get the correct ordering. I'll probably open-source it and put it on the web when I get a chance to do some code cleanup and documentation. I don't use anything for CSS; I probably should, but it hasn't been a big problem. I've heard that Dreamweaver will automatically remove whitespace for you, but I get annoyed by that kind of munging, and my guess is that GZipping will eat up all the bulk anyway. Just follow all the normal rules about factoring your CSS for maintainability - you want to actually think about what you're trying to accomplish, and assign rules based on the semantics of the page. The worst CSS bloat I've seen has come from coders just copying & pasting some CSS example off the web whenever they have a problem. Understand what you're doing & don't cargo-cult. HTML is easy: use…

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