back to article The Wun Show: Douglas Crockford has been sniffing JavaScript's bad parts again

In the opening chapter of his latest book How JavaScript Works (pub. Virgule-Solidus, 2018, c. £24.19, pp 279), Douglas Crockford introduces us to a selection of English linguistic idiosyncrasies that he will inflict on his readers. The most startling of these is his spelling of "one" – yes, yes that Kelly's eye, that …

  1. Roger Greenwood

    Fabulous . . .

    . . . and now we are all left wondering how many vespas (spent or not) we need to lay our hands on.

    1. dajames Silver badge

      Re: Fabulous . . .

      ... how many vespas (spent or not) ...

      I'm wondering whether that was just a typo, or whether you don't know what Swan Vesta matches are (Wikipedia) or are unaware of the hobby of matchstick modelling?

      1. Admiral Grace Hopper

        Re: Fabulous . . .

        Or maybe there is a really hard core set of model builders who use wasps rather than matches.

        1. Natalie Gritpants Jr

          Re: Fabulous . . .

          or scooters

          1. Tom 7 Silver badge

            Re: Fabulous . . .

            Vespa's are the original Segway only they would take a Segway to Brighton beach and take the piss out of it.

  2. Michael H.F. Wilkinson Silver badge
    Coat

    Wunderful piece

    Sorry, sorry, couldn't resist. I'd better get me coat

  3. sbt Silver badge
    Angel

    The misfeatures aren't a problem if you don't get all fancy-pants.

    Even callbacks are easily handled with some consistent interface design practices.

    Mr. Crockford makes a fine exemplar of the old saw "Too smart for his own good".

    Thanks for wading through the excruciating text to winkle out the parts of interest.

  4. Neil Barnes Silver badge
    Headmaster

    wun != one

    wun == in need of an editor who can spell. A technical treatise is not the place to bugger around with accepted orthography.

    1. phuzz Silver badge

      Re: wun != one

      On the other hand, a self published book is exactly where I'd expect to see it.

    2. Orv Silver badge

      Re: wun != one

      Yes, but this is a tradition at this point -- see also M.D. Spivak's "The Joy of TeX" and its odd preface introducing non-gender-specific pronouns (which, as far as I can tell, are rarely actually used in the book.)

  5. thosrtanner

    Wun thing to say.

    I have to say, while I agree with his comments about callbacks and Promises (which look messy, and there's just no replacing callbacks with promises in existing code without tearing your hair out), he's way out of line about async/await. It's a really useful technique and makes the code much cleaner, easier to read (and write), and less error prone.

    The worst problem with async/await is all the books and stackoverflow posts that explain async/await code as though it was happening sequentially. Which it most definitely is not. The number of times people have suggested you can call an async function from the main thread and wait for it to finish is depressing (though the fact that you can't do that is also depressing)

    Also, in passing, I hate that JSON cannot be commented. Because there's a lot of tools (eslint, I'm looking at you) that expect their configuration to be in strict json format, and I like to explain why I've taken a decision in my configuration details, thank you very much. So I use yaml, but every time I want to do something, I have to take the eslint example and stick it through a json->yaml converter....

    1. The First Dave Silver badge

      Re: Wun thing to say.

      "JSON cannot be commented" - citation needed

      1. Tom 7 Silver badge

        Re: Wun thing to say.

        There's no definition for comments in JSON because if you cant work out how to put them in anyway you really should step back from the computer and find something less complicated like turning the lights out and never coming back.

      2. thosrtanner

        Re: Wun thing to say.

        Here's a few

        https://www.json.org/ - no possibility of comments in that

        https://en.wikipedia.org/wiki/JSON - hmm. still nothing about comments in there

        https://tools.ietf.org/html/rfc7159 - nope, no comments in there either

        and even this which provides a hacky workround

        https://stackoverflow.com/questions/244777/can-comments-be-used-in-json

        I can't put in comments without stuffing the data in a nasty way.

        1. JDX Gold badge

          Re: Wun thing to say.

          just add comment fields to the JSON objects ;)

    2. Orv Silver badge

      Re: Wun thing to say.

      Nothing has made me feel quite so stupid and thick-headed as trying to understand Promises. It doesn't help that every explanation starts by linking to a 50-minute PowerPoint presentation on YouTube. I have never successfully learned anything from a PowerPoint presentation and I consider them the least efficient possible way to convey technical information.

  6. Wilco

    Babylon

    Transpilers should never be used in production? What a crock (ford)

  7. caffeine addict Silver badge

    I've been doing this job for 20 years and often had DC's name flung at me without ever bothering to find out *why* he's considered the one true authority on JS.

    It does worry me when people decide that any one way is the only way, and the fact that he's just one bloke who happens to be smart and happens to have looked under the hood early on makes me wonder about the logic of buying into the cult. Obviously there's a lot of sense in the DC-ish way of doing things, but there are other religions that have the same general rules. IYSWIM.

  8. Mage Silver badge
    Coffee/keyboard

    Wut!

    Is this a review of a real book? Not just one of Verity's excellent rambles?

    P.S. Do people still buy books on programming rather than searching t'web?

    I used to. I have enough to fill almost 2m of shelf. Anyone want ancient books on Z80, C++, Prolog, Modula-2, Pascal, OpenGL, Windows 95, DOS Interrupts and even older Uni textbooks?

    1. Warm Braw Silver badge

      Re: Wut!

      Anyone want ancient books on Z80, C++, Prolog, Modula-2, Pascal...

      I've already got most of those, thanks, along with VMS 5 internals documentation and some electronics textbooks from the days when things were mostly analogue. If you can work out how to throw them out, please let me know, I always seem to fail at the last moment...

      1. Alistair Silver badge
        Windows

        Re: Wut!

        ..... I have an RPGII manual from IBM. All 480 pages of it. To be honest, I've never actually read it although I was able to (finally) get a ticket opened (once) on something by quoting the manual at the IBM support person.

        For sale, one small anchor, cheap.

  9. Arthur the cat Silver badge

    the unspeakable/unreadable XML

    Or as we greybeards call it, S-expressions done very badly by those who didn't learn from history.

  10. jake Silver badge

    Oh goodie. Another JS book. Just what the world needs.

    Shame he didn't co-write it with Wendel Ollie, a PhD candidate at UC Berkeley.[0] If he had, we could call it "The Crockford-Ollie" and be done with it.

    With apologies & a tip o't'at to AvE ...

    [0] W. Ollie is a construct for illustrative purposes. No actual Wendels have been mocked in the delivery of this opinion piece. Likewise, this should in no way be considered a gibe at the UC system. Don't you just love having to placate the hand-wringers with every attempt at humo(u)r? Answers on a post card.

  11. LeahroyNake Silver badge

    Not right

    'This is quite annoying and distracting, but no more so than an economy-class, transatlantic flight in a cramped, middle-aisle seat in front of a poorly disciplined ADD boy-child whose seatback kicks are Poisson-distributed with Lambda around 4.7 per minute.'

    ADD and ADHD are medically recognised conditions. The use of them in this context is wrong.

    Shame on you and its a sponsored article.... Most of the sponsored ones seem to have no comment option? Maybe you missed this one?

    Yes I have a child with ADHD but they are not 'a little shit', 'naughty' or intentionally annoying. They need more care and consideration for their environment and wellbeing not not what my father would describe as 'a good hiding' or a 'slap around the ear'.

    1. Alistair Silver badge
      Windows

      Re: Not right

      I don't see a sponsored tag in there at all Leahroy.

    2. Anonymous Coward
      Anonymous Coward

      Re: Not right in the head

      Insanity is a medically recognised condition. And occasionally they get on a plane also. I do not want one in the seat behind me.

      So you're seeing "sponsored articles", 'shit', 'naughty', 'hiding', 'slap', and all sorts of offense which no one else can see. Umm, were you going to travel anywhere soon? Could you warn us first?

      1. Anonymous Coward
        Anonymous Coward

        Re: Not right in the head

        This reminds me of the comments made by my grandparents. I can, to a small degree, forgive my grandparents for having outdated views which are, frankly, outrageous today. Peoples views on mental illness, medical conditions, sexuality, race, disability have changed dramatically over the last 50 years. I hope your views will catch up too.

        1. Alister Silver badge

          Re: Not right in the head

          I sincerely hope that I never "catch up" to the point of being hysterically hypersensitive about every mention of an illness or disability. That's a symptom of a much deeper sickness in society.

          1. Anonymous Coward
            Anonymous Coward

            Re: Not right in the head

            'This is quite annoying and distracting, but no more so than an economy-class, transatlantic flight in a cramped, middle-aisle seat in front of a poorly disciplined ADD boy-child whose seatback kicks are Poisson-distributed with Lambda around 4.7 per minute.'

            Replace "ADD boy-child" with any of the following: Gay, Muslim, Epileptic etc. They are all offensive because they portray the illness/race/sexuality in a negative light, perhaps innocently, but never-the-less, offensive.

            You may be old enough to remember how the charity "Spastic Society" was renamed due to people using the word "Spastic" in a negative light.

            1. Alister Silver badge

              Re: Not right in the head

              You may be old enough to remember how the charity "Spastic Society" was renamed due to people using the word "Spastic" in a negative light.

              And can't you see what's wrong with that? Spastic is the correct medical term for those suffering with various muscle related illnesses, and yet because the term was used in a derogatory fashion, it's original usage is now frowned upon.

              In the same way, black as a description of colour is now considered incorrect, which is just stupid, and spade to describe a digging implement, and slope for a gradual descent, even dyke, to describe a retaining wall is now considered improper.

              It is ridiculous that words which have been co-opted for abusive or derogatory use should no longer be acceptable in their original context.

              1. Anonymous Coward
                Anonymous Coward

                Re: Not right in the head

                "And can't you see what's wrong with that? Spastic is the correct medical term for those suffering with various muscle related illnesses, and yet because the term was used in a derogatory fashion, it's original usage is now frowned upon."

                I agree there is nothing wrong with the words: spastic, dyke, black. It is there use in a derogatory fashion that is the problem. It is similar to marketing, if you repeat these words often enough in a negative or mocking connotation then their use becomes associated this that negative connotation.

                The solution is quite simple: do not use religion/race/disability, or in this case, medical conditions as derogatory term. It would have been easy to use "badly behaved" / "annoying" / "offensive" in this circumstance.

                In using the medical term in this circumstance you are causing discomfort to those people that have this condition and also those people that have a relative with this condition.

      2. Danny Boyd

        Re: Not right in the head

        And if it's too much of a bother to warn us, could you please not forget your medications when traveling?

    3. jake Silver badge
      Pint

      Re: Not right

      Wow. A perfect example to illustrate my colophon, and posted immediately adjacent to that very post, to boot. Ta! Have a homebrew!

  12. Claptrap314 Silver badge

    DC: The wrong parts

    I spent a decade doing microprocessor validation at AMD & IBM. This work included building a floating point emulator. I know far, FAR too much about both the standards and the actual behavior of microprocessors (and their repeated bugs) to let this one go.

    Building an integer library out of floating point operations is up there with taking out your own appendix. You better be good (he was an MD), desperate (he was stuck in the Antarctic winter), and with a high tolerance for pain & crazy (he was Russian).

    Floating point operations are a LOT slower than integer. If you really want to go the route of building up an MP library, steal from CPAN (it's okay) or better yet https://gmplib.org/ (it's better).

    There are three ways to go from float to int. The first is to use floats in the in range, and use the hardware float-to-int to convert. This method has a LOT of bugs historically. It is also generally one of the slowest instructions in an FPU. The second is to use denorms. Of course, denorms are also a rich source of errors, and behind the curtains, denorms are calling the same circuits as the previous convert function, only they do it for every instruction. The last is to ensure that all of the results are bounded so that you can add 3 times a power of 2 to them and keep the same exponent bits. You can then read off the integer part from the bottom bits. Of course, you have to be careful that when you add or subtract, that you rebalance your number after every add and subtract (no multiples for you!). So, again, REALLY slow. And all-original library. As someone who has reason to be confident that if he really had to, he could build such a library, just don't.

  13. Long John Brass Silver badge
    Coat

    Harumph...

    This sounds to me like the old argument, long ago advanced by the pipe-smoking and leather elbow patch generation, that nobody should be allowed to use C until he or she has mastered Z80 assembly

    Harumph and how very dare you; Youth of today, I don't know. wouldn't know thier LDA from their TAY.

    Mines the one with the Ovaltine and kippers in the pocket.

    Given the quality of some of the code I've seen some Devs shit over the wall to OPs. Maybe regular beatings with an assembler wouldn't go amiss?

    1. dajames Silver badge

      Re: Harumph...

      Youth of today, I don't know. wouldn't know thier LDA from their TAY.

      Errr ... TAY?

      Wouldn't have done you much good on a Z80, which didn't have the 6502's fancy page zero addressing.

    2. Doctor Syntax Silver badge

      Re: Harumph...

      "Youth of today"

      Given how long she's been entertaining us with her columns I'm quite sure Verity will be quite pleased with that.

  14. Long John Brass Silver badge

    fancy page zero

    6502 - A more elegant weapon for a more civilised age

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019