For eight months, everything I've written for the browser has been description. HTML says what things are. CSS says how they should look. The browser does all of the doing. The new course is JavaScript, and a few weeks in I can name the difference: this is the first thing I've written that makes decisions.
The closest I'd come before is spreadsheet formulas, which I write at work constantly and which absolutely compute. But a formula is one cell answering one question, forever. A program is a list of instructions that runs in order, holds on to values, and branches. The first time an if statement of mine sent the page down one path instead of the other, I sat there longer than the exercise deserved.
The class work is small things wired to real pages: click handlers, string drills, a form that validates itself. jQuery carries most of it, ES5 style, var and function and script tags, save and refresh to run; there's a newer flavor of the language, but not in this classroom. $('.submit-btn') reads like CSS that grew verbs, and for about a week it felt like magic. Then my first real bug taught me there is no magic anywhere in this.
The bug: my validation function approved everything, including a completely empty form. I read the code ten times and it read correct ten times. So I did the only thing I had, which was console.log after every line, refresh, and read down the column of output in Chrome until a value went wrong. Archaeology. The dig turned up a single = where I meant ==. Instead of comparing the field against an empty string, I was assigning the empty string into it, so the check could never come up true and every form sailed through. One character. Most of an evening.
A typo in CSS gets you an ugly page. A typo in JavaScript gets you a lie that runs. I'll take the trade.
— Lo