<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nam Nguyen Hoang on Medium]]></title>
        <description><![CDATA[Stories by Nam Nguyen Hoang on Medium]]></description>
        <link>https://medium.com/@namnguyenhoang?source=rss-3d6b892a63e0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*I5eRgJxZaJiqcM9v.jpg</url>
            <title>Stories by Nam Nguyen Hoang on Medium</title>
            <link>https://medium.com/@namnguyenhoang?source=rss-3d6b892a63e0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 14:41:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@namnguyenhoang/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hello JavaScript]]></title>
            <link>https://medium.com/@namnguyenhoang/hello-javascript-51bdd1951c8e?source=rss-3d6b892a63e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/51bdd1951c8e</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Nam Nguyen Hoang]]></dc:creator>
            <pubDate>Sun, 20 Mar 2016 01:21:42 GMT</pubDate>
            <atom:updated>2016-03-20T01:21:42.430Z</atom:updated>
            <content:encoded><![CDATA[<h4>What we talk about when we talk about JavaScript</h4><p>JavaScript is certainly the popular and powerful language of the Web. Once thought of as a toy, JavaScript is now widely deployed programming language in history. Almost everyone with a computer or a smartphone has all the tools they need to execute JavaScript programs and to create their own. All you need is a browser and a text editor.</p><pre>console.log(&quot;Hello World&quot;);</pre><h4>What exactly is JavaScript?</h4><p>As I’ve told you before, JavaScript is some sort of programming language, but what is a programming language? In a simple way, a programming language is a series of instructions that tell the computer to do something (that something can be one of a wide variety of things, including displaying text, playing video game or hacking someone’s information :). Still not sure what is JavaScript, the below definition may help you to be aware that is.</p><blockquote><em>JavaScript® (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions. It is a prototype-based, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles. — MDN</em></blockquote><p>It has been standardized in the <a href="http://www.ecma-international.org/">ECMAScript</a> language specification. As of 2012, all modern browsers fully support ES5. ECMAScript 2015 aka ES6 published on June 17, 2015 — the next version of JavaScript adds significant new syntax for writing complex applications.</p><h4>Are Javascript and Java the same?</h4><p>The answer is No and . . .No. Do not to be confused with Java or even Javanese script, the Java- prefix doesn’t suggest that JavaScript is somehow related to Java. <strong>Java is to JavaScript as Car is to Carpet or as Ham to Hamster!</strong> Take a look at <a href="http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java">this thread on Stackoverflow</a> to make it clear.</p><h4>Is JavaScript object-oriented?</h4><p>Yes and No. JavaScript doesn’t have class prior to the release of <a href="https://strongloop.com/strongblog/an-introduction-to-javascript-es6-classes/">ES6</a> and this new keyword can arguably be the most harmful feature. JavaScript is not class-based object-oriented language like C++ or Java, it is <a href="https://en.wikipedia.org/wiki/Prototype-based_programming">prototype-based</a> with <a href="http://rosettacode.org/wiki/First-class_functions">first-class</a> functions. In a prototype-based language, an object can contain both data and behaviour. It’s a self-contained thing, to make a new object, you just call the “copy” method on an existing object. Prototypal inheritance is simpler and more flexible than class inheritance with JavaScript.</p><pre>var person = { runs: true }  <br>var superman = { flies: true }  <br>superman.__proto__ = person  // inherit  <br>alert(supermans.runs) // true</pre><h4>JavaScript is a functional language, all the way.</h4><p>As a bare-bones introduction, functional programming can be described in a single sentence: <strong>Functional programming is a style of programming in which the primary method of computation is the application of functions to arguments.</strong></p><p>If you’ve come to JavaScript with a ready interest in functional programming, then the good news is that it supports functional techniques and practices “right out of the box” — the function is a core element in JavaScript.</p><p>Why it matters? Functional programming provides a saner approach, allowing you to write elegant, readable code that raises the level of abstraction while being less prone to errors. It can be very advantageous to use JavaScript — a Internet-script language, as a functional means to manipulate the DOM (Document Object Model), sort API responses or perform other tasks on increasingly complex websites.</p><blockquote><em>Developers proficient in functional programming are going to be in large demand in the very near future.</em></blockquote><p>Here’s a list of functional programming features:</p><ul><li>First-Class Functions</li><li>High-Order Functions</li><li>Pure Functions</li><li>Closures</li><li>Immutable State</li></ul><pre>var add = function(a){  <br>  return function(b){<br>    return a + b<br>  }<br>}</pre><pre>var add2 = add(2)  <br>add2(3) // =&gt; 5</pre><h4>What can JavaScript be used for?</h4><p>JavaScript was originally created for interaction with the site was mostly limited to interacting with forms, giving feedback to the user and detecting when they do certain things. <br>Thanks to the advances made in today’s JavaScript engines, JavaScript is used for much more than input‐related tasks. In fact, advanced JavaScript‐driven applications can be created that rival the speed and functionality of conventional desktop software. Examples of such applications include essential apps for daily use such as Google Maps, Gmail and even Microsoft’s Office. These applications provide a real service. In most of these applications, JavaScript only powers the user interface, with the actual data processing being done on the server.</p><pre>&lt;script&gt;  <br>    document.getElementById(&#39;hello&#39;).innerHTML = &#39;Hello&#39;;<br>&lt;/script&gt;</pre><p>The most common use of JavaScript in client-side is to make your web site interactive, it plays nicely with HTML through the use of DOM scripting. Some simple examples of this usage are:</p><ul><li>Loading new page content or submitting data to the server via AJAX without reloading the page</li><li>Animation of page elements, fading them in and out, resizing them, moving them, etc.</li><li>Interactive content, for example games, and playing audio and video</li><li>Transmitting information about the user’s reading habits and browsing activities to various websites. Web pages frequently do this for web analytics, ad tracking, personalization or other purposes.</li></ul><blockquote><em>Web development is all about communication. In this case, communication between two parties:</em></blockquote><ul><li>Server — the party is responsible for serving pages, it is used to provide interactive web sites that interface to databases or other data stores on the server</li><li>Client — the party requests pages from the server, and displays them to the user. The client-side environment used to run scripts is usually a browser.</li></ul><h4>How does JavaScript run on a server?</h4><p>At JSConf Berlin 2009, <a href="https://en.wikipedia.org/wiki/Ryan_Dahl">Ryan Dahl</a> brought the world <a href="https://nodejs.org/">Node.js</a> which was named Technology of the Year by InfoWorld three years later. Node.js, now known to developers simply as ‘Node’, is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. <a href="https://www.npmjs.com/">npm</a>, Node’ package ecosystem, is the largest ecosystem of open source libraries in the world. At this point in time, npm has over 250,000 packages and 150,000,000 downloads per day. <br>Other server-side JavaScript environments include Jaxer and Narwhal. However, Node is a bit different from these solutions, because it is event-based rather than thread-based. Node provides purely evented, non-blocking infrastructure for building highly concurrent software and real-time applications. Node is used by IBM, Microsoft, Walmart, Netflix, LinkedIn, PayPal, and <a href="https://github.com/nodejs/node-v0.x-archive/wiki/Projects,-Applications,-and-Companies-Using-Node">a variety of compainies</a>.</p><pre>const http = require(&#39;http&#39;);</pre><pre>http.createServer( (request, response) =&gt; {  <br>  response.writeHead(200, {&#39;Content-Type&#39;: &#39;text/plain&#39;});<br>  response.end(&#39;Hello World\n&#39;);<br>}).listen(8124);</pre><pre>console.log(&#39;Server running at <a href="http://127.0.0.1:8124/&#39;);">http://127.0.0.1:8124/&#39;);</a></pre><h4>The Rise of JavaScript Frameworks</h4><p>When it comes to Web development, JavaScript frameworks have moved front and center in the mainstream in the last couple of years. It’s amazing to me how quickly JavaScript frameworks like AngularJS and Meteor and recently also React (which technically isn’t a framework) can help developers build apps that are a delight to use, faster than you ever thought possible. There are many libraries and frameworks our there. You can try Bower, Grunt, Yeoman, PM2, RequireJS, Browserify, Knockout, AngularJS, Kraken, Mach, Mongoose, Knex, Bookshelf, Faye, Q, Async.js, Underscore, Lodash and SomeFrameworks.JS in next your project. It’s super easy to get started, you just drop in a script tag into your document add some attributes to your app and magic happens. But, <strong>magic comes at a cost</strong>. When you’re working with something that’s highly abstracted, it becomes a lot more difficult to figure out where’re bugs come from. Think of a framework as a bridge that will help you code faster and easier. Did you notice I didn’t include the word “better” in the last sentence? Faster and easier doesn’t always mean better, but we will get to that later.</p><blockquote><em>The framework aims to alleviate the overhead associated with common activities performed in Web development… and they often promote code reuse.</em></blockquote><p>As developers, we all know that our industry evolves at a very fast pace. So fast, indeed, that it’s important to keep up with the new libraries, frameworks and new versions of the tools we use on a daily basis.</p><h4>Universal Javascript</h4><p><a href="https://medium.com/@mjackson/universal-javascript-4761051b7ae9#.is5u2je9o">Universal JavaScript</a> (aka <em>“Isomorphic JavaScript”</em>) means that it’s designed to run a lot of the same code on both the client and the server. Typically that includes a lot of rendering and domain logic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*LGrGQ-FAkRu-48QO.png" /></figure><p>There are many advantages to building apps this way, but the primary advantages are:</p><ul><li><strong>Cross-functional teams.</strong> Since everything is written in JavaScript, it’s easier to build teams who know how to work on both the client and server sides of the app.</li><li><strong>Write once, run everywhere.</strong> With the exception of a few library substitutions and browser polyfills, the code is shared, which means you have to write about half the code you’d write working on a non-universal app.</li><li><strong>More productive developers.</strong> Since the app is more consistent across the stack, there’s no context switching when you need to maintain application behavior on both sides of the stack. Write the behavior once, and you’re done. Context switching slows developers down significantly.</li></ul><h4>Want to learn JavaScript right now?</h4><p>I have found a list of resources to be essential reading and playing for both the JavaScript newbie and the experienced developers.</p><ul><li><a href="https://www.codecademy.com/learn/javascript">Codecademy</a> (playground)</li><li><a href="http://eloquentjavascript.net/">Eloquent JavaScript</a> (book)</li><li><a href="https://github.com/getify/You-Dont-Know-JS">You Don’t Know JS</a> (book)</li><li><a href="https://leanpub.com/understandinges6/read/">Understanding ECMAScript 6</a> (book)</li><li><a href="https://jsbin.com/">JS Bin</a> (pasting/sharing code)</li><li><a href="http://www.freecodecamp.com/">FreeCodeCamp</a> (exercises)</li><li><a href="https://egghead.io/">egghead.io</a> (online course)</li><li><a href="http://www.sitepoint.com/javascript/">Sitepoint JavaScript</a> (tutorial)</li><li><a href="http://javascriptweekly.com/">JavaScript Weekly</a> (news)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*rfMqapYTdIXozc1W.png" /></figure><p>Bookmark this post so that you can always look back at this great list that can help you succeed.</p><p>P.S. Thanks for reading this far! If you found value in this, I’d really appreciate it if you recommend this post (by clicking the button below) so other people can see it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51bdd1951c8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>