Thoughts on Teaching Object Oriented Programming in JavaScript

I’ve been doing a series of JavaScript videos on YouTube as part of a larger effort teaching Software Development. I find that I create a video 2 to 4 times before actually recording the real one. When describing something, when I find I have to reference a basic concept, I instead stop, and record a video around that basic concept first. This has worked well, and similar to blogging/writing books, it forces you to plug all holes no matter how minute in your knowledge of a subject so you can succinctly describe it in a way that makes sense.

From a programming perspective, teaching advanced JavaScript is quite challenging because it wasn’t designed for traditional OOP concepts and large application design. Many of the more popular languages today are either built on, or support and promote OOP usage. On the same token, once you know OOP you better appreciate Functional languages, parametric polymorphism, and other dynamic language features.

Continue reading “Thoughts on Teaching Object Oriented Programming in JavaScript”

Why Multiple Files Using RequireJS vs. 1 Big One

A YouTube watcher of my channel regarding my Basics of Require JS Part 1 writes:

… main.js is a concatenated and minified version of all the js. Just wondering why do you still need requirejs if you concatenate and minify your js in a single file [via r.js].

Is there an advantage of using requirejs in this instance? Or can you just straight target main.js?

I’ve seen 2 clients now who put all of their JavaScript into a single, large file vs. using classes, modules, and packages; traditional computer science concepts that Require does its best to enable in JavaScript.

Continue reading “Why Multiple Files Using RequireJS vs. 1 Big One”

Adventures In JavaScript

Missing a comma in a class.

Firefox: “Everything’s cool, brosef!” :: empty screen ::

Chrome 1st time: “You can’t load local files, lol, eff you!” :: empty screen ::

Chrome 2nd time via sudo: “Uncaught SyntaxError: Unexpected token :”

Safari 1st time: “‘with’ statements aren’t allowed in strict mode”

Safari 2nd time: “SyntaxError: Expected token ‘}'”