Presentation is loading. Please wait.

Presentation is loading. Please wait.

Comparing JavaScript to Other Languages

Similar presentations


Presentation on theme: "Comparing JavaScript to Other Languages"— Presentation transcript:

1 Comparing JavaScript to Other Languages

2 Topics Why did we study JavaScript?
Does programming language choice matter? Differences with other languages Some Really Exotic languages How do I decide what language to use?

3 Why Did We Study JavaScript?
Effective language for teaching all the basic computing concepts Extremely useful for designing interactive web pages Practical for you to apply even if not a CS major Syntactically similar to several other languages E.g.: C, C++, Java, PHP

4 Hello, World! Typically, in any programming language, the first example you learn displays “Hello, World!” Let’s use that as our Rosetta Stone for examining programming languages...

5 Does Programming Language Choice Matter?
Short answer: “Yes, but…” Javascript: document.write(“hello, world”); C: main( ) { printf("hello, world"); } Fortran77: PROGRAM HELLO PRINT*, ‘hello, world‘ END Lisp: (defun helloworld () (print “hello, world") ) English: Hello, world. Spanish: Hola mundo French: Salut le Monde Greek: Γεια σου κόσμε

6 Differences with other Languages
JavaScript borrows many elements from several, commonly-used languages, such as: C C++ Java PHP It shares many syntactic ideas with each language (and they, with each other)

7 Differences with other Languages
The differences are worth noting (and we will come across them in the exercise), but there is enough similarity that you can cross the boundary easily Some main differences: Client-side vs. Server-side Memory management Type-handling Type of object-oriented features (not covered)

8 (apply (quote (lambda (my_array) (for i from 0 to 4 do (setf (aref my_array i) i) (setq (a 1) (b 2) (cond (lt a b) (format nil “a < b”)) …


Download ppt "Comparing JavaScript to Other Languages"

Similar presentations


Ads by Google