2013-02-06

Learning JavaScript via other languages

Looking back on my life, three programming languages prepared me well for JavaScript (which has some challenging aspects):
  • Scheme: In my first semester of Informatics, I had the great fortune of being taught Scheme via the classic “Structure and Interpretation of Computer Programs” (free online). Due to Scheme, JavaScript has closures [1]. Furthermore, Racket (a Scheme dialect) inspired ECMAScript 6’s approach to privacy, private symbols [2].
  • Self: Later, I took a cursory look at prototype-based object-oriented languages. One paper was especially insightful: “Organizing Programs Without Classes”. Class-based languages have two relationships: instance-of (between objects and classes) and subclass-of (between classes). Prototype-based languages manage with just one relationship: has-prototype (between objects). How you organize things is still very similar in both kinds of languages, as the very readable paper explains, via the programming language Self (another one of JavaScript’s original influences).
  • Java: Java holds three leassons for JavaScript. First, it helps with most of its syntax – the original mandate for JavaScript was that its syntax had to look like Java’s [1]. Second, it helps with object-oriented programming, even though it sometimes feels a bit rigid. The book “Effective Java” (affiliate link) is a great primer on Java issues, many of which are relevant for other OOP languages. Third, you get an idea of what good IDEs can do. JavaScript still has some catching up to do in this area.
While there are other languages that can teach you something about JavaScript, these three stood out for me.

References

  1. JavaScript: how it all began
  2. Private data for objects in JavaScript

5 comments:

sumit kher said...

I am basically not a programmer and I am comparatively new to Java technology , so I was wondering what all topics should be covered up if i have to start java from the start and has any one

studied or got any info regarding this 6 week java training online course http://www.wiziq.com/course/12145-the-6-week-complete-java-primer-with-training-certificate and should we also have knowledge of C language before we further move on to Advance Java topics??

sumit kher said...

I am basically not a programmer and I am comparatively new to Java technology , so I was wondering what all topics should be covered up if i have to start java from the start and has any one

studied or got any info regarding this 6 week java training online course http://www.wiziq.com/course/12145-the-6-week-complete-java-primer-with-training-certificate and should we also have knowledge of C language before we further move on to Advance Java

vijay kumar said...

NICE BLOG!!! Thanks for sharing useful information about FNT Softwre Solutions and being one of best Software Training institute in Bangalore we agree that this blog is very useful for the students who are searching for best software courses, I would really like to come back again right here for like wise good articles or blog posts. Thanks for sharing...Java training company bangalore.

Jacob Russell said...

So you mean that if we learn these other languages first we can understand JavaScript more easily.

Axel Rauschmayer said...

Yes, I think so. Or you already know JavaScript and gain a deeper understanding by taking a look at these languages.

Web Analytics