Sunday, January 9, 2011

Sign Up Tasks

Javascript Introduction


Introduction

I am a graduate of a short 6 month postsecondary  web design and maintenance program.   In retrospect the course seemed to be more about how much can we cram into the participants heads rather then the quality of the education and true understanding of any subjects covered.  Although I’m a firm believer that you can never stop learning, I’m also a realist and admit it can be extremely difficult doing it on your own.

At the moment I can cut, paste and cobble together pieces of Javascript code with varying amounts of success.  Do I truly understand  what I’ve created?  Yes and No; if it does what I intended I’m happy.  Do I understand what each line of code does?  Rarely; if the code does the job I intended, fine. Could I logically build that piece of code on my own?  No.  Can I see or understand any errors or any potential pitfalls in the code?  Enter P2PU, Javascript 101, and my to-do tasks to gain acceptance.
 

Javascript
  • World's most misunderstood program language.
  • Nothing to do with "Java."
  • Bad early implementation:  Bad reputation.
  • Books on Javascript iniversally bad:  Difficult to learn from books.
  • Standard defined by ECMA.
  • Functional language.
  • Not a web toy!
  • Real effective language.
  • Small but sophisticated.
  • Syntactically a C family language: differs from C in its type system, identifiers simialr to C, Operator's for most part same as C language.

 History 
  • 1992:  C+++, then called Oak 
  • 1995:  Java created:  Too heavy and clumsy for browsers and web.
  • 1995:  Livescript created:  syntax based on Java, 1st scripting language in web browser, first language in web server.  Created to escape microsoft.
  • 1996:  Reversed engineered Javascript, called it Jscript, different name, same language.
  • 1996:  Netscape brought to ECMA to create standard, lost control.  Microsoft dictated development from then on.


Key Ideas:
  • Load and go delivery:  Code is delivered as text, not compiled, designed to be embedded in web pages.
  • Loose typing:  Controversial, "Strong typing" in fashion now, the language is not "untyped."
  • Objects as general containers.
  • Protypal inheritance: Distinct from classical inheritance. 
  • Lambda:  Functions as first class objects.
  • Linkage through global variables.

Values in Javascript:
  • Small set.
  • Numbers:  Only one number type - no intergers, 64 bit floating point which doesn't map well to a common "understanding of arithmetic, 
  • Strings:  no separate character type, strings are imutable - when made cannot be edited, simialr strings are egual(==) - Java got wrong, many meathods.
  • Boolean:  2 values - ture and false, subsets - :truthy" and "falsey."
  • Objects:  Everything else.
  • Two special Values:  "null" and "undefined."

Comments
  • "//" line comment.
  • /* *\ block comment.

Mistakes, Problems
  • Floating point.
  • Having separate math object.
  • List of reserved words:  Bizarre, applies list where shouldn't have.
  • Operator overload. 

To Do Task 2