Blog by Sumana Harihareswara, Changeset founder

28 Dec 2013, 16:11 p.m.

console.captain'slog

Hi, reader. I wrote this in 2013 and it's now more than five years old. So it may be very out of date; the world, and I, have changed a lot since I wrote it! I'm keeping this up for historical archive purposes, but the me of today may 100% disagree with what I said then. I rarely edit posts after publishing them, but if I do, I usually leave a note in italics to mark the edit and the reason. If this post is particularly offensive or breaches someone's privacy, please contact me.

This week I started remembering JavaScript (two years ago I picked up a little bit). A few fun things:

  1. I understand @horse_js better now!
  2. I sort of understand the differences among Node, npm, ClojureScript, CoffeeScript, and random noun.js files.
  3. I paired with Tom, one of the facilitators, to port my Obama speech generator to JS. I can successfully write functions (including higher-order functions), randomly choose things using Math.random, make and use arrays and Objects, display things in a webpage, write for loops, get input from the user using prompt(), and put semicolons everywhere.
  4. The JSFiddle tutorial didn't mention a necessary step so I added it.
  5. The incrementation step in a JavaScript for loop keeps happening until the step when the run condition is no longer satisfied, so it's sort of more like a while loop? Anyway this tripped me up and gave me an off-by-one error until I grokked it.
  6. I'm glad Eloquent JavaScript is available online for free, and I'm glad that Node comes with a REPL. But, because I have been doing so much Python, it's natural for me to think that pretty basic things will work the same across lots of environments. And the textbook, as early as the first chapter, suggests doing things like print() and show() that give me stark errors in Node.
  7. Seriously, JavaScript, if I just try to add together a number and a string you might just try to make it work and give me something back? That does not strike me as the most logical choice.
    > 40+["yay", 23]
    '40yay,23'
    > 23+Object()
    '23[object Object]'
Thus, I have now watched "WAT" and enjoyed it. And I have made software put "Thank you, and may God bless NoSQL." on a webpage. So that's a good harvest.