javascript

Object Oriented Programming in JavaScript, Part 2

Last time (Traditional Object Oriented Programming in JavaScript), we showed you how to use JavaScript’s class syntax to make your code more readable and less error-prone; this time, we’ll take a look at how we can use it to do the things you’re used to in object oriented programming: inheritance, polymorphism, and more. For the workbooks, you’ll need to understand inheritance and polymorphism. The code Framework uses these features a lot. Read more…

Traditional Object Oriented Programming in JavaScript

JavaScript has many different mechanisms for doing object oriented programming. Many of them are hard to learn. Fortunately, newer versions of JavaScript (like we use in class) give us a nicer option. JavaScript ES6 introduced classes to JavaScript, which use notation similar to what you may have seen in other object oriented languages. Eloquent JavaScript has an excellent introduction in Chapter 6. However, it first shows you the old way to do objects (prototypes), which is useful, but not essential for CS559. Read more…

Typed JavaScript and CS559

JavaScript does not require you to declare the types of your variables, function arguments, objects, object properties, or much of anything. However, if you give it some hints as to what you expect (as comments in your code), you can help a reader understand your program, and software tools find mistakes. This page describes some programming practices that are recommended for CS559. We (the course staff) will try to use this in all of the example code and framework code that we provide to you. Read more…

Javascript in CS559

What’s on this page If you’re not already a JavaScript programmer, you may prefer to start at the end of the page Advice on learning JavaScript. A short explanation about the use of JavaScript in CS559 A short description of the rules for using JavaScript in CS559 The motivation for using JavaScript in CS559 The rationale for the rules about using JavaScript in CS559 A discussion of versions of JavaScript (which will explain what we’re using and help you use it) A discussion of tools you can use for JavaScript Advice on learning JavaScript - including books and online resources Basic Idea of JavaScript in CS559 You must do all of the programming assignments for CS559 in JavaScript. Read more…