-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweek3_technical.html
106 lines (88 loc) · 10 KB
/
week3_technical.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Melissa McCoy</title>
<link href="stylesheets/reset.css" type="text/css" rel="stylesheet">
<link href="stylesheets/blog.css" type="text/css" rel="stylesheet">
</head>
<body>
<div id="header">
<div class="container">
<div class="logo">
<h1>Melissa McCoy</h1>
<h2>Entrepreneur | Engineer | Sweets Lover</h2>
</div>
<div class="nav">
<ul>
<li><a href="about_me.html">About Me</a></li>
<li><a href="week4_cultural_blog.html">Culture</a></li>
<li><a href="week4_technical.html">Tech</a></li>
<li><a href="index.html">Home</a></li>
</ul>
</div>
</div>
</div>
<div id="content" style="height:1800px;">
<div class="container">
<h1>JavaScript: The Good, The Bad, and The Ugly</h1>
<h2>June 1, 2014</h2>
<div id="text">
<h3>Where did JavaScript come from?</h3>
<span class="caption">Reference: <a href="https://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript">W3.org</a></span>
<p><span style="font-weight:bold;">JavaScript</span> was created in 1995 by Brendan Eich who was then working at Netscape and now Mozilla. The name JavaScript was chosen as a marketing move as Java was popular at the time. After several years of the language development being passed between companies, in 2005, the open source and developer communities set to work to revolutionize what could be done with JavaScript. This community effort was sparked in 2005 when Jesse James Garrett released a white paper in which he coined the term <span style="font-weight:bold;">AjaxM</span>, and described a set of technologies, of which JavaScript was the backbone, used to create web applications where data can be loaded in the background, avoiding the need for full page reloads and resulting in more dynamic applications. This resulted in a renaissance period of JavaScript usage spearheaded by open source libraries and the communities that formed around them, with libraries such as <span style="font-weight:bold;">Prototype, jQuery, Dojo</span> and <span style="font-weight:bold;">Mootools</span> and others being released.</p>
<p>In years past JavaScript was often seen as a clumsy language most closely associated with annoying Internet pop-ups and browser incompatibility issues. Some people still shudder at the very mention of JavaScript. In the last decade, this has changed dramatically. Now JavaScript is easy to pick up because of the very flexible nature of the language, is widely standardized across common browsers and is far more useful than ever before! Because JavaScript is not a compiled language, things like memory management are not a big concern. You won't find yourself having to worry about loading and unloading content, compiling, or setting primitive data types because most of the heavy lifting is handled by the browser. </p>
<h3>Why is JS so popular?</h3>
<span class="caption">Reference: <a href="http://earthintegrate.com/10-reasons-why-javascript-is-the-best-language-for-the-web/">Earth Integrate</a></span>
<p>JS is an important language because it is the language of the web browser. Its association with the browser makes it one of the most popular programming languages in the world. At the same time, it is one of the most despised programming languages in the world. The API of the browser, the DOM, is quite awful and JS is unfairly blamed. The DOM would be painful to work with in any language. Additionally JS is despised because you're forced to use it if you want to program
<ol>
<li><span class="bullet">The Rise of AJAX:</span> AJAX was the first tool that allowed webp ages to ask the server for information without re-loading the page which made a revolutionary difference in the dynamism possible on a web page. AJAX is JavaScript based (AJAX stands for Asynchronous JavaScript and XML) and thus with the rise of AJAX came the rise of JavaScript.</li>
<li><span class="bullet">So Many JS Tools!:</span> When the open source community got involved, good things happened for JS from award-winning libraries to crown-worthy debugging tools.</li>
<li><span class="bullet">The Rise of Node.js</span> Node.js is a software platform, written in JavaScript, for scalable server-side and networking applications. Given JavaScript is asynchronous (it doesn't have to execute everything in order) unlike most server languages, Node.js offers incredible power and is growing in popularity. Luckily JavaScript is along for the ride!</li>
<li><span class="bullet">It's easy to learn</span>The amazing thing about JS is that it is possible to get work done with it without knowing much about the language, or even knowing much about programming. It is a language with enormous expressive power. </li>
</ol>
</p>
<h3>What's Good about JS?</h3>
<span class="caption">Reference: <a href="http://it-ebooks.info/read/274/">Javascript, The Good Parts</a></span>
<p> JS has some extraordinarily good parts. In JS, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders.
<ol>
<li><span class="bullet">Functions:</span> JS functions are first class objects with (mostly) lexical scoping. is the first lambda language to go mainstream. Deep down, JS has more in common with Lisp and Scheme than with JAVA. It is Lisp in C's clothing. This makes JS a remarkably powerful language.</li>
<li><span class="bullet">Loose Typing:</span> The fashion in most programming languages today demands strong typing. The theory is that strong typing allows a compiler to detect a large class of errors at compile time. The sooner we can detect and repair errors, the less they cost us. JS is a loosely typed language, so JS compilers are unable to detect type errors. This can be alarming to people who are coming to JS from strongly typed languages. But it turns out that strong typing does not eliminate the need for careful testing. And the sorts of errors that strong type checking finds are not the errors to worry about. Additionally, loose typing is liberating in that you don't need to form complex class hierarchies ad you never have to cast or wrestle with the type system to get the behavior you want.</li>
<li><span class="bullet">Dynamic Objects:</span> A controversial feature in JS is prototypal inheritance. JS has a class-free object system in which objects inherit properties directly from other objects. This is really powerful, but it is unfamiliar to classically trained programmers. If you attempt to apply classical design patters directly to JS, you will be frustrated. But if you learn to work with JS's prototyped nature, your efforts will be rewarded.</li>
<li><span class="bullet">Expressive Object Literal Notation:</span> JS has a very powerful object literal notation. Objects can be created simply by listing their components. This notation was the inspiration for JSON, the popular data interchange format. </li>
</ol>
</p>
<h3>What's not so Good about JS?</h3>
<span class="caption">Reference: <a href="http://it-ebooks.info/read/274/">Javascript, The Good Parts</a></span>
<p>
<ol>
<li><span class="bullet">Programming Model based on Global Variables:</span> Given global variables are visible in every scope, they can be a convenience in very small programs, but they quickly become unwieldy as programs get larger. Because a global variable can be changed by an part of the program at any time, they can significantly complicate the behavior of the program. Use of global variables degrades the reliability of the program that use them.</li>
<li><span class="bullet">Scope:</span> JS's syntax comes from C. In all other C-like languages, a block (a set of statements wrapped in curly braces) creates a scope. Variables declared in a block are not visible outside of the block. JS uses the block syntax, but does not provide block scope: a variable declared in a block is visible everywhere in the function containing the block. In most languages, it is generally best to declare variables at the site of first use. In JS, it's better to declare all variables at the top of each function.</li>
<li><span class="bullet">Reserved Words:</span> Most of the reserved words in JS are not used in the language. Stupid right?</li>
<li><span class="bullet">Falsy Values:</span> There are a surprisingly large set of falsy values: 0, NaN, "",false,null,undefined. While these values are all falsy, they are not interchangeable. Also, undefined and NaN are not constants - they are global variables and you can change their values which really shouldn't be possible; don't do it!</li>
</ol>
</p>
</div>
<div id ="sidebar">
<ul>
<li><a href="week1_technical.html">Week 1 - My Fave Websites</a></li>
<li><a href="week2_technical.html">Week 2 - The Display Attribute</a></li>
<li><a href="week3_technical.html">Week 3 - Why JavaScript?</a></li>
<li><a href="week4_technical.html">Week 4 - Array#match Method</a></li>
</ul>
</div>
</div>
</div>
<div id="footer">
<div class="container">
<div class="nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="week4_technical.html">Tech</a></li>
<li><a href="week4_cultural_blog.html">Culture</a></li>
<li><a href="about_me.html">About Me</a></li>
</ul>
</div>
<p>© 2014 Melissa McCoy No Rights Reserved</p>
</div>
</body></html>
<!DOCTYPE html>