Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Prototypes and Inheritance in JavaScript

Forget everything you know about object-oriented programming. Instead, I want you to think about race cars. Yes – race cars. Recently I was watching the 24 Hours of Le Mans –a popular racing event in France. The fastest cars in the race are the Le Mans Prototypes. Although these cars are built by car manufacturers like Audi and Peugeot, they are not cars you’ll see on the streets and highways of your home town. They are built exclusively for high-speed endurance racing.Manufacturers put an enormous amount of money into researching, engineering, and building these prot...

5,965 0       PROTOTYPE JAVASCRIPT INHERITANCE


  JavaScript as a First Language

At Khan Academy we've been investigating teaching Computer Science to students in some new and interesting ways. The most interesting aspect of which is that we're likely going to be teaching them JavaScript as their first language.We're in a very unique position as we're primarily aiming to teach students who've been through our previous math and science-centric curriculum. Because of this we can create some rather compelling exercises and projects that never would've been feasible otherwise.The prospect of teaching the JavaScript language as a first language is actually really exciting. Teac...

5,811 0       PROTOTYPE JAVASCRIPT LEARNING FIRST LANGUAGE INHERITENCE


  Prototypes and Object Orientation

David Chisnall takes a look at the two dominant paradigms in object-oriented languages (classes and prototypes) and discusses the strengths and weaknesses of each.Two terms are quite often confused when describing programming languages:class-based and object-oriented:Simula was the first class-based language. It provided classes (actually implemented using closures) as a means of encapsulating abstract data types.Smalltalk was the first object-oriented language. It provided a mechanism for decomposing programs into subprograms that ran on a simplified model of a computer an...

2,486 0       PROTOTYPE COMPARISON OOP DIFFERENTIAL MO


  Prototypes in JavaScript

Following on from his previous article, David Chisnall explores JavaScript as an example of prototype-based object orientation. In this article, he shows how it's possible to implement more complex object models on top of this simple abstraction.My previous article, Prototypes and Object Orientation, considered the differences between class-based and prototype-based object orientation. In this article, we'll look in a bit more detail at the workings of the JavaScript object model, since it's currently the most popular prototype-based object-oriented language.What's New?In Self, you create...

2,970 0       JAVASCRIPT PROTOTYPE OBJECT ORIENTED OBJ


  5 Reasons Your Javascript Stinks

Javascript gets a bad rap on the Internet, but there are few languages that are so dynamic, so widespread, and so deeply rooted in our lives as Javascript is. The low barrier of entry leads some people to call it a script kiddie language, others scoff at the concept of a dynamic language while riding their statically typed high horse. You and Javascript just got off on the wrong foot, and now you've made it angry. Here's five reasons why your Javascript code sucks.1. You're not using a namespace.Remember in college when the teacher said you can't use global variables in your homework? Using gl...

3,049 0       PROTOTYPE JAVASCRIPT GOOD HABIT OOP