The basics

During my first dozen weeks as a beginning student of software engineering at Learners Guild, I had considerable discretion in selecting topics. I used that discretion to emphasize the “fundamentals” of web technologies: HTTP, HTML, CSS, and JavaScript, one by one. This was by choice, and it was also consistent with the Guild’s recent curricular reorganization, in which new Learners are gently steered toward fundamentals for the first 12–18 weeks of their study.

This means I forewent some opportunities to work on the many related technologies that tie these fundamentals together and power complex real-world applications. Instead, I strove to assimilate basic truths.

Truths such as: ['x', 'y', 'z'] is not equal to ['x', 'y', 'z'].

That’s right. They are not equal. You see, ['x', 'y', 'z'] is an “object” containing 3 properties, named 0, 1, and 2. 0 has the value 'x', 1 has the value 'y', and 2 has the value 'z'. Why, then, are the above expressions not equal? They sure look equal. Here’s why: The mere act of putting the expression ['x', 'y', 'z'] into one’s code causes JavaScript to create an object containing those 3 properties with those 3 values. But, if I ask JavaScript whether the objects represented by those two expressions are equal, I am putting them both into my code, since that’s how to ask it that question. I ask: ['x', 'y', 'z'] === ['x', 'y', 'z'], and JavaScript dutifully creates the 2 objects in order to process my statement. Since it has created 2 objects, storing them in 2 different locations, it considers my statement false, not true. (You and I may have the same iPhone, but we don’t have the same iPhone.) The === operator asks whether they are the same object, not whether they have the same number of properties with the same names and values.

Of course, there are methods for asking JavaScript whether the objects are identical in the names and values of their properties. But, unless we know that mere equality isn’t the relevant fact, we won’t look up those methods, and we’ll simply get the wrong answer.

In my 13 weeks at the Guild, I must have learned hundreds of such fundamentals. I have then forgotten many of them again, too, but repeated practice does, indeed, turn many of them into habits and intuitions.

Getting real

My week 13 ended on 4 August, and during that week I began to migrate, incrementally, toward practicality. I learned how to process forms that users fill out on the web, how to make a web page get information from a server, how to make a website read and write “cookies” on the computers of its visitors, and how to let users create encrypted passwords.

I began to learn, too, how to make a web page that behaves like a calculator. That project kept me busy for another week. I’ll blog about it in a subsequent installment.

In principle, all that emphasis on fundamentals should allow me to be more productive as the work continues to shift toward practical applications. But, in any case, I didn’t mind the immersion into abstract rules. Reality is overrated.