Shop OBEX P1 Docs P2 Docs Learn Events
The Official JavaScript Religious War Thread. - Page 10 — Parallax Forums

The Official JavaScript Religious War Thread.

16781012

Comments

  • Heater.Heater. Posts: 21,230
    edited 2015-02-13 02:24
    Ah yes, the Happy Hacking keyboard. I have thought about that from time to time. There are so many different models of it. At 300 dollars it's a bit too much for me to stomach. I have never bought a keyboard in my life. There are usually piles of keyboards and such going spare at every place I have worked.

    I don't want to shell out the cash for a keyboard unless I actually get to play with one first. It's that "feel" problem. It has to feel right. Especially at that price.

    Here is a article that is very critical of the Happy Hacking keyboard. http://xahlee.info/kbd/idiocy_of_happy_hacking_keyboard.html. Amusingly the guys list of "idiot" things about it pretty much mirrors my requirements listed above!
  • TorTor Posts: 2,010
    edited 2015-02-13 02:35
    I'm generally in agreement with Heater about the keyboard.. except for the numerical keypad. In these days of online banking I need it to safely enter KID numbers, the numerical ID that goes where a message would go on a paper giro. It identifies what the payment's for and who it's from. The problem is that banks, in their infinite wisdom, made this number a very long one, often fifteen digits or more. And very often a row of five or more of the same digit.. 00000, for example (in the middle of something). The only way to reliably enter that number is to lock your eyes on the number while typing the digits without watching, and that I do more easily on a numerical keypad (when I started working I had to enter orbital state vectors (lots and lots of digits) with my right hand from a telex message held in my left hand. So I learned to use the keypad efficiently).

    The most useless key on the keyboard must be the ¤ that Heater mentioned. What on earth is it for. On every keyboard I use I redefine it to what it should be, the dollar ($) sign. So that I can use a simple shift-4 to get the dollar. Why the useless ¤ got priority on my Nordic keyboard I don't know.

    -Tor
  • Heater.Heater. Posts: 21,230
    edited 2015-02-13 02:40
    OK we might keep the CAPS LOCK. But can we put the thing far away from where it gets hit by accident?

    Seem the only key I have that is in the right place is the Esc key!

    And possibly the space bar and cursor keys.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-13 02:45
  • Heater.Heater. Posts: 21,230
    edited 2015-02-13 02:51
    Probably most people have no idea what we mean when we mention ¤ here.

    It's shift 4 on Scandinavian and other keyboards.

    My Finnish friend tells me it is called the "squirrel skin" key. It does of course look like a laid out squirrel skin with it's four legs pointing in all directions.

    The reason for this, so they say, is that people in the forest used to trade with squirrel skins to represent money.

    Anyway it is the "currency sign". To denote an unspecified currency. Although I have no I why you would need that unless you happen to not have a correct currency symbol and have agreed the meaning in advance.
    http://en.wikipedia.org/wiki/Currency_sign_(typography)
  • TorTor Posts: 2,010
    edited 2015-02-13 04:12
    Interesting. I had no idea. I can say honestly that I have never, ever come across '¤' in print though (except printed layout descriptions of keyboards..), and I'm reading all the time.. books, magazines, all of it. Whenever I'm not at a keyboard, or outside doing something physical, I'm reading. And no '¤' seen anywhere.. that must be the most wasteful allocation of a key ever.
    I hadn't heard the 'squirrel skin' variant before. I believe I've seen it called 'sol' (sun), way back in time. If it wasn't for the fact that keyboard layouts are so easily redefined (in X11 at least) I would have looked for some ancient Egyptian curse for the one(s) responsible for letting it take the place of the $ key, the $ being so useful for assembly- and Perl programmers among others. Hm, the Wikipedia article actually indirectly indicates where it came from.. the Italian delegation to the CCITT in 1964. Well, it's had its 50 years of non-fame, time to let it go!

    -Tor
  • Heater.Heater. Posts: 21,230
    edited 2015-02-13 04:46
    I have heard it called "sol" too. But of course Unicode has it's "sun with rays" symbol[size=+5]☼[/size] which is different.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-13 07:43
    Na, I think I'm going to have figure out how to get the ¤ key to turn my desk lamp on and off.
  • potatoheadpotatohead Posts: 10,254
    edited 2015-02-13 08:24
    Seems a good use.

    As for the happy hacking keyboard, perhaps you can find a used one.

    That symbol being allocated where it is seems goofy for sure.

    Moving caps lock would be fine with me. I do end up mashing it in error enough to be a bother.

    When just writing, I touch type and a nicely sized keyboard with good feedback and that makes some noise is my preference. The one on my Apple //e Platinum is awesome. I set up the machine to write on because I like that keyboard so much. I'll probably get one of those Pi cards for it to improve on this some. Could be making posts here on that fine keyboard...

    When coding, I use a mix of touch type, copy paste, pecking around for odd chars and so forth.

    The difference is thinking time. Writing just flows. Code can, but the norm is to think a lot, then write some code, think some more... This tends to marginalize how much I really care about the keys.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-15 17:09
    Anyone up for a PASM assembler in JavaScript? Or in the extreme a Spin compiler in JS? Yes, we have OpenSpin that has been "transpiled" to JS, but it's in C++ as not many people want to work on that.

    OK. This is almost certainly never never going to be completed even as just an assembler. I just had to paste this code here because I'm too tired to think of anywhere else to keep it for now. Besides there had been talk about DIY languages, parser and compilers around here recently, so perhaps it's of interest to somebody.

    Basically, for work, I was using a parser/generator that converts a grammar specification into a parser in JS. Think YACC/Bison. It's pegjs as seen here http://pegjs.org/. The resulting parser code can be used in a browser or in node.js.

    Being unable to sleep I found myself writing a grammar specification for PASM. In no time at all I found I had a parser that recognizes enough PASM to accept all the PASM from Kye's serial driver and emit a JSON data structure containing all the details of all the instructions. This data structure could be easily used to generate the actual binary instructions.

    The grammar specification is below. If you go to http://pegjs.org/online you can play with it. Just paste the spec into the grammar editor window and then start typing PASM into the input window. You should see your instructions parsed into an array of structures that look like this:

    Edit: Now added quaternary number and parsing of DAT, org and fit.
       {
          "instruction": {
             "operation": "neg",
             "dest": "phsa",
             "src": {
                "literal": "#",
                "value": 1
             },
             "efects": [ ],
             "label": "init"
          }
       },
    

    The PASM grammar spec:
    {
      function isKeyword (s) {return false}
    }
    
    start
      = program
    
    program
      = lines
    
    lines
      = line*
    
    line
      = nonBlankLine
      / blankLine
    
    nonBlankLine
      = white* s:pasmStatement white* "\n"?
        {
          return s;
        }
      / "DAT"i white* "\n"?
        {
          return {dat_block: true}
        }
      
    blankLine
      = white* "\n"
          {
            return {bankLine: true};
          }
      / white+
          {
            return {bankLine: true};
          }
      / white* "'" c:[a-zA-Z0-9/ ']*  "\n"
          {
            return {comment: c.join("")};
          }
    
    pasmStatement
      = l:label white c:condition white i:instruction
          {
            i.label = l;
            i.condition = c;
            return {instruction:i};
          }
      / l:label white i:instruction
          {
            i.label = l;
            return {instruction:i};
          }
      / c:condition white i:instruction
          {
            i.condition = c;
            return {instruction:i};
          }
      / i:instruction
          {
            return {instruction:i}
          }
      / o:org
      / f:fit
      / l:label
          {
            return {instruction: {label: l}};
          }
      
    fit
      = "fit"i white e:expression
      {
        return {org: e}
      }
      / "fit"i
      {
        return {org: 0}
      }
    
    org
      = "org"i white e:expression
      {
        return {org: e}
      }
      / "org"i
      {
        return {org: 0}
      }
    
    expression
      = number
    
    label
      = l:[a-zA-Z0-9_]+
        !{
          return isKeyword(l.join(""));
        }
        {
          return l.join("");
        }
    
    instruction
      = o:op0 e:effectList
        {
          return {operation:o, effects:e}
        }
      / o:op1 white s:src e:effectList 
        {
          return {operation:o, src:s, efects:e}
        }
      / o:op2 white? d:dest white? "," white? s:src e:effectList
        {
          return {operation:o, dest:d, src:s, efects:e}
        }
    
    src
      = l:"#"? [ ]* s:symbol
          {
            return {literal:l, value: s}
          }
      / l:"#"? [ ]* n:number
          {
            return {literal:l, value: n}
          }
    
    dest
      = symbol
      / number
    
    number
      = QuaternaryNumber
      / binaryNumber
      / hexNumber
      / decimalNumber
    
    binaryNumber
      = "%" d:[0-1]*
        {
          return parseInt(d.join(""), 2);
        }
    
    QuaternaryNumber
      = "%%" d:[0-3]+
        {
          return parseInt(d.join(""), 4);
        }
    
    decimalNumber
      = d:[0-9]*
        {
          return parseInt(d.join(""), 10);
        }
    
    hexNumber
      = "$" d:[0-9a-fA-F]*
        {
          return parseInt(d.join(""), 16);
        }
    
    symbol
      = first:[a-zA-Z_] rest:[a-zA-Z_0-9]*
        !{
          return isKeyword(first + rest.join(""));
        }
        {
          return first + rest.join("");
        }
    
    effectList
      = effectEntry*
    
    effectEntry
      = white e:effect
      {
        return e
      }
    
    effect
      = "wc"i
      / "wr"i
      / "wz"i
      / "nr"i
    
    op0
      = "nop"i
    
    op1
      = "jmp"i
    
    op2
      = "add"i
      / "sub"i
      / "jmpret"i
      / "test"i
      / "mov"i
      / "rcr"i
      / "djnz"i
      / "shr"i
      / "rdlong"i
      / "rdbyte"i
      / "neg"i
      / "and"i
      / "cmp"i
      / "wrbyte"i
      / "wrlong"i
      / "waitcnt"i
      / "tjz"i
      / "or"i
      / "ror"i
    
    white
      = [ ]+
      {
        return "WHITESPACE"
      }
    
    condition
      = "if_e"i
      / "if_ne"i
    
  • KeithEKeithE Posts: 957
    edited 2015-02-15 20:17
    Heater - I found out that there's a "mod" called scriptcraft which allows people to make Minecraft "mods" in javascript. If you want something to motivate kids to learn javascript there you go. And of course there's a way to use blocky to generate the javascript. I'm going through some of this with my younger daughter since it's ski week out here in San Jose. My nephew is going through a java class to write such things and won't he be surprised when his younger cousin can do it ;-)

    Have you ever gone through this page on Crockford's site? http://javascript.crockford.com/tdop/tdop.html

    So anyways, I may finally be motivated to learn javascript. It looks like that online book Eloquent Javascript is worth a look. I've heard good things about "Professional JavaScript for Web Developers" but 1000 pages?
  • potatoheadpotatohead Posts: 10,254
    edited 2015-02-15 22:01
    That 1K pages is probably 100 pages for the language and 900 for all the extras and their dependencies / quirks built with it.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-15 23:19
    Keith,

    Sadly I don't have any kids around here to motivate. That Minecraft thing sounds interesting.

    You might be interested in the Espruino. Epruino is a tiny, very cheap micro-controller, board that runs JavaScript. There is a dead simple Chrome browser based IDE for it. Just type a couple of lines of JS into it, hit the load button and you have a LED flashing or a servo moving. It can do all lot more than that of course. Perhaps such direct connection from program to physical world is also a motivator for youngsters. http://www.espruino.com/. Oh, and Espruino comes with a Blockly programming mode for GUI program building.

    Your daughter is a going to be way ahead in capability than your nephew :)

    I have been through Crockford's pages. And I've watch pretty much all his presentations on JS on YouTube. I just love his style.

    Anyone starting out to learn JS should watch his "JavaScript: The Good Parts" talk. https://www.youtube.com/watch?v=_DKkVvOt6dk&list=PL62E185BB8577B63D&index=4

    Then for some very interesting background history on JS, and the web and lot's of other interesting things all 8 parts of the series "Crockford on JavaScript" are essential viewing https://www.youtube.com/watch?v=JxAXlJEmNMg&list=PL7664379246A246CB

    I have never read any books on JS. Probably not a good start but there are reasons for this:

    1) There seem to be a lot of JS books, I never got a handle on what might be the good ones.

    2) Worse still I get the idea that many of these books are kind of "pre-Crockford JS The Good Parts". That is to say they are looking at the language the wrong way.

    3) Even worse still I get the idea that many of these books are written with in-browser web development in mind. My needs when I stated out was for JS on the server running under node. I did not, and still do not, want to learn about HTML and the browser DOM API and how to add click handlers to buttons etc. Blech!

    4) There were no JS books for server side programming with node.js at the time.

    No, what I wanted was a modern view of JS the language. As a language not as a means for hacking on web pages.

    So, my conclusion is that the only JS book you need is Crockford's "JavaScript: The Good Parts". A very slim volume. I'd certainly stay away from the 1000 page tomes.

    Of course if you are working in the browser that may not be sufficient.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-16 13:25
    All Java programmers who have been compelled to work on JS projects, thus causing them to become sad, miserable, depressed and suicidal, should watch this:
    https://www.youtube.com/watch?v=PSGEjv3Tqo0
  • Martin_HMartin_H Posts: 4,051
    edited 2015-02-16 14:26
    So I watched ten minutes of that insanity. He basically says remember those things that I told you were good parts, well a bunch weren't, so don't use them. He also admitted that undefined and null are a design error in the language. But hey they added tail recursion and modules so at least JS now has that going for it.

    Oh and I know how miserable I am, because I'm using JavaScript which I hate with a burning passion.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-16 21:45
    Damn, the therapy is not working :) You need to complete the course of treatment, not just the first 10 minutes.

    To be fair he does give reasons for his change in point of view regarding those "good parts". Namely the radically different performance characteristics of JS engines and memory space available in modern times.

    I'm getting increasingly worried about the new ES6 JS standard. The syntax is changing in a big way.

    There will be the hideous "class", introduced under pressure from all the bone head Java programmers that have been forced to use JS recently. The "fat arrow", "=>", syntax for functions makes things look and behave very different. The "generators" thing is weird. The ugly "let", And so on.

    When programmers get to throwing all those things together JS source is going to be totally unrecognizable as the JS we know and love today. It's going to be an unreadable, unfathomable, hideous mess. A kind of Frankenstein mash up between JS, Java (class), Scheme(tail recursion) and BASIC(let)!

    The Perl guys will love it!
  • Heater.Heater. Posts: 21,230
    edited 2015-02-16 22:19
    Meanwhile...my PASM parser in JS using the pegjs parser generator has made it to github if anyone is interested in such things.

    Nowhere near complete yet but it does correctly parse the DAT content of Kye's serial port driver.

    https://github.com/ZiCog/pasm.js
  • msrobotsmsrobots Posts: 3,704
    edited 2015-02-17 00:47
    @Heater.

    I wish I had time to do things like that. You know we have winter here in California. All people are upset. It is raining. And it is cold. About +10C in the night and +15C to +25C in the daytime. So its cold, you understand?

    People are freezing here in Northern California. Nobody goes out. The Bars are empty and people run around with big sweaters and scarfs and drive very slow because the road is wet.

    One time in the last 5 years we had snow here. 2 Days. About 5-10cm. Absolute chaos. Schools had to close because parents where not able to get the kids there.

    Living up there in northern Europe you have no clue how weather (rain) affects small towns in Nor Cal. Living most of my life in Germany and just 9 years in CA I am still astonished about this.

    Honestly. Life without snow is quite nice. Consider relocating, I told you before. Been there and done that. Quite happy about.

    So I watched that Crockford guy again. He is quite good in presentation. If you ever need to dive into CSS look for some woman called Stubbornella in youtube. She is quite as good as him and way more easy on the eyes.

    I really like the DEC64 format he mentioned. Interesting. But even with binary integers:

    Every time I browse thru the PASM instructions I hover over them addx and subx ones. Never used them, no real reason for multi long math. But it is itching me somehow every time I browse over them in the Book. There are some examples for 96 bit integers and for me it looks like quite extendable to a variable amount of longs.

    How big are 'bigints' in JavaScript? How big in other languages?

    Is there a known object in the OBEX using multi long math?

    I have no idea for what to use a - say - 20 long long integer or even a 200 long long integer. But he propeller can at least add and subtract them. Multiplication and division seem quite complicated to me but doable.

    Just brainstorming...

    Mike

    .
  • TorTor Posts: 2,010
    edited 2015-02-17 01:28
    Am I the only one who thinks that these long videos are extremely inefficient in providing information? You have to sit down for half an hour, at best, to get information that could easily be summed up in something you could read through in a few minutes. I don't know about you guys but some of this stuff is relevant for my job but there's no way I can justify wasting hours just listening to somebody.

    -Tor
  • Heater.Heater. Posts: 21,230
    edited 2015-02-17 02:54
    msrobots,
    I wish I had time to do things like that.... its cold, you understand?...People are freezing here in Northern California. Nobody goes out...
    So you have no excuse, if it's too cold to go out an play you can stay in and hack on some interesting code. Or get that soldering iron fired up !

    As Linus said "As a young guy in Helsinki in the winter there is nothing to do but drink or hack code"

    Stubbornella, oh I remember Stubbornella. I can watch her even though I intend to stay away from the mess that is CSS.
    How big are 'bigints' in JavaScript?
    It is said there is only one number type in JS, the 64 bit float. So the biggest integer you can have before going all "floaty" is 2 to the power 53 or 9007199254740992.

    JS has 53 bit ints you might think. However, being JavaScript, things are not so straightforward. If you use bitwise operators &, | etc the result will be 32 bits. Which seems a bit weird to me.

    Recently they introduced "typed arrays" into JS that directly map their elements onto 8, 16, 32, 64 bit memory spaces. So we have things like Int8Array and Uint32Array and Float64Array.
    How big in other languages?
    You need Python, unlimited size integers. Until you run out of memory!

    I don't recall anyone creating a "bigNum" object.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-17 03:07
    Tor,

    No you are not the only one. I have often thought the same about many tutorial videos and the like. Some guy droning on about something or other. Just give me the text already. Most times I give up on them unless I really can't find the info elsewhere.

    But there are reasons for watching videos besides the meat of the information in their.

    I watched Crockford because I like his style. He has a good manner. Is engaging and witty. This is entertainment as much as anything else. Perhaps that particular video was not a good example. But the "Crockford on Javascript" seires is a great show, full of humour and historical background and personal opinions. All 8 parts of it! https://www.youtube.com/watch?v=JxAXlJEmNMg&list=PL7664379246A246CB

    Then there are some classics. Like the young and very nervous Ryan Dahl introducing node.js to the world for the first time: https://www.youtube.com/watch?v=ztspvPYybIY

    Or Chandler Carruth speaking on the Clang C++ compiler [/url]
  • TorTor Posts: 2,010
    edited 2015-02-17 03:47
    I agree there can be value in watching some of those videos.. but they're mostly still redundant, at least compared to something like "The Mother of All Demos", the (restrospectively named) demo by Douglas Engelbart. Now there's something that deserved the video/film format..

    -Tor
  • Heater.Heater. Posts: 21,230
    edited 2015-02-17 04:09
    Ah yes, "The Mother of All Demos" is a spectacular production. Like some Epic movie.

    The vids I'm talking about are just your regular shows. Like the occasional good show that pops up on TV.
  • Martin_HMartin_H Posts: 4,051
    edited 2015-02-17 05:03
    Heater. wrote: »
    I'm getting increasingly worried about the new ES6 JS standard. The syntax is changing in a big way.

    That's usually a bad sign for a computer language. The problem is that it's expensive to change the installed base of code to the new format and larger projects usually hate mixed language versions due to support and consistency issues. Often it's best to wait a generation and leap frog a version or two. I've done that with several MS technologies (e.g. WinForms).

    Python's 2.7 versus 3.x split would be a good example. It fragmented the language with some packages not being available in the newer version which retarded adoption. It really seems like Python never recovered its momentum afterwards.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-17 06:02
    "it's expensive to change the installed base of code"

    In the case of JavaScript that would mean updating every browser in the world !

    There in lies the problem. Whatever new features they add to the language it has to not break anything out there.

    This looks like the same problem as C++ has. First it insisted on being backward compatible with C which many consider is already a bad start. Then it has to "work around" itself with every new feature. Resulting in the gothic horror of the language we know and love today.
  • KeithEKeithE Posts: 957
    edited 2015-02-17 20:54
    Heater - thanks for the advice. I'm aware of the Crockford book, but it doesn't seem like a good starter manual. Not really sure what direction I will go in - some of the browser stuff seems interesting, but also frustrating. So for now we'll focus on what's usable in scriptcraft. I really haven't paid any attention to java and wasn't aware that it included a scripting engine framework which I guess script craft is using. (I'm a verilog guy - talk about a frustrating language.)

    As an aside - have you watched any of the Bret Victor demo videos? e.g. Inventing on Principle? Not at all focused on javascript although he's used it in some demos. He's trying to develop principles for the next couple of decades, and most people just see the surface of his demos and try to clone them. He appears to be a really capable and thoughtful guy.
  • Heater.Heater. Posts: 21,230
    edited 2015-02-17 23:00
    KeithE,

    Yes, perhaps you are right, the Crockford book is not a beginners guide and anything to do with a web page hair pulling exercise.

    I guess that when introducing someone very young to programming it's not all about a particular language. After all they have no concept initially of what it means to "program".

    I mean some how there are some basic concepts that need to be grasped: What is a variable? What is an expression "x = 1 + 2"? What does it mean to "execute" one statement after another in sequence? What about decisions in that sequence "if"? What about doing the same sequence repetitively? And so on and so on.

    This is why the days of the 8 bit computers that started up to a BASIC prompt were so inspirational to many. The thing was just begging you to program it. Even with just a
    10 PRINT "Hello"
    20 GOTO 10
    
    The machine provided immediate feedback to your actions from the very beginning.

    This experience has been missing from the world for decades now. I'm very happy to see it return with the likes of the Arduino, the Espruino, yes and the Propeller has always been there.

    With these things one can write that two liner (almost) that gets a LED to flash. Get that immediate feed back. Get that tantalizing feeling of power over the machine.

    If the minecraft thing does that, I'm all for it.

    Yes, I have seen the famous Bret Victor "Inventing on Principle" video. That is inspirational. What he was doing there is of course made a million times easier by using a language and run time like JavaScript. How on Earth would you do it if you had to wait for a compiler to rebuild your entire program at every step of the way?

    He is not alone in doing that though. In a way JavaScript people have been doing it all along. For example look at this page http://pegjs.org/online. Never mind the details but that thing is amazing. It takes text entered into one window, generates a bunch of JavaScript code from it, then applies that generated code to the data entered in another window. It immediately gives you error messages about your input text, and then error messages from the generated code about your data. Or it shows the results. It does all that in real time as you type character by character!

    That's not as eye catching as Bret's graphical demo but basically it's doing the same thing.
  • KeithEKeithE Posts: 957
    edited 2015-02-19 10:51
    Heater - that's an interesting site. I stumbled across http://codepen.io which looks like an interesting playground for graphical work.

    And this one referred to in a book for kids: http://gamingjs.com/ice/
  • KeithEKeithE Posts: 957
    edited 2015-02-24 10:13
    Regarding the 1000 page book on Javascript - here's another instance of a ~1000 page series and it seems to be focused on the language.

    He references The Good Parts:

    "...While this subset has been famously dubbed "The Good Parts", I would implore you, dear reader, to instead consider it the "The Easy Parts", "The Safe Parts", or even "The Incomplete Parts".
    This You Don't Know JavaScript book series offers a contrary challenge: learn and deeply understand all of JavaScript, even and especially "The Tough Parts". ..."

    Kyle Simpson - https://github.com/getify/You-Dont-Know-JS

    You Don't Know JS: Up & Going - ??? pages
    You Don't Know JS: Scope & Closures - 98 pages
    You Don't Know JS: this & Object Prototypes - 174 pages
    You Don't Know JS: Types & Grammar - 198 pages
    You Don't Know JS: Async & Performance - 296 pages
    You Don't Know JS: ES6 & Beyond - 100 pages

    866 pages + ??? pages = ~1000 pages?
  • Heater.Heater. Posts: 21,230
    edited 2015-02-24 12:36
    KeithE,

    I'm all for people learning the details of what ever language they are using as best they can.

    As such, that book on JS may well be very valuable, I will check it out.

    However that derogatory view of Douglas Crockford's "Javascript the Good Parts" is uncalled for. It's kind of missing Doug's aims in writing it:

    1) For the longest time JS was regarded as that stupid, slow, scripting language that nobody could see any point in. Except they begrudgingly had to use it in the browser. JS was famed, and still is, for it's bad parts. The sloppy type system, the unexpected results of type coercion and so on. You know the stuff.

    2) Not many people were aware of the advance features it did have. Like first class functions, closures, the possibility of classless object oriented programming, it's efficient asynchronous nature, and so on. The fact that it had features of a lisp or scheme.

    3) Doug aimed to highlight those oft missed features. He did so very well.

    4) He also aimed to encourage people to be aware of and avoid the bad features. Hence his creation of jslint. Sure you can write code without semicolons for example:
    function f () {
    	return
    	2
    }
    
    Perhaps that is what your really mean to write for some odd reason. But it's not going to do what most people would expect. Just use semicolons for goodness sake.

    5) Doug's thing is all about groups of people working together to create something. The less unnecessary tricks and surprises they give each other the better.

    In the extreme most people don't know all the details of the languages they use. I'm convinced that the huge number of details in C++ and the infinite number of ways they interact with each other is not knowable by any normal human.

    Similarly, how can you claim to know JavaScript until you can write this:
    [][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()
    

    :)
Sign In or Register to comment.