<?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 Kenny on Medium]]></title>
        <description><![CDATA[Stories by Kenny on Medium]]></description>
        <link>https://medium.com/@kennyyang19?source=rss-4e73936e08e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*S_PBFt15N9_qvCHE</url>
            <title>Stories by Kenny on Medium</title>
            <link>https://medium.com/@kennyyang19?source=rss-4e73936e08e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:30:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kennyyang19/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[What is Lexical Scoping?]]></title>
            <link>https://medium.com/@kennyyang19/what-is-lexical-scoping-1ff56f9ddd84?source=rss-4e73936e08e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ff56f9ddd84</guid>
            <dc:creator><![CDATA[Kenny]]></dc:creator>
            <pubDate>Thu, 06 Sep 2018 05:40:30 GMT</pubDate>
            <atom:updated>2018-09-11T01:42:25.255Z</atom:updated>
            <content:encoded><![CDATA[<p>In Javascript, each declared function creates its <strong>own</strong> scope. The scope of an inner function contains the scope of a parent function.</p><h4>Lexical Scope Example</h4><pre>let val = 2<br>function multiply(x) {<br>   let result = val * x <br>   return result<br> }<br> console.log(&#39;answer:&#39;, multiply(6)) // answer: 12</pre><p>We have variables defined in the local execution context and variables in the global execution context. One complexity of JavaScript is how it looks for variables. If it can’t find a variable in its local execution context, it will look for it in its calling context. And if not found there in it calling context, it is looking in the global execution context. (And if it does not find it there, it’s undefined). The function has access to variables that are defined in its calling context. The formal name of this phenomenon is the lexical scope.</p><p>Here is another example:</p><pre><strong>var</strong> outerFunction  = <strong>function</strong>(){<br> <br>   <strong>if</strong>(<strong>true</strong>){<br>      <strong>var</strong> x = 5;<br>      //<em>console.log(y); //ReferenceError: y not defined</em><br>   }<br> <br>   <strong>var</strong> nestedFunction = <strong>function</strong>() {<br> <br>      <strong>if</strong>(<strong>true</strong>){<br>         <strong>var</strong> y = 7;<br>         console.log(x); <em>//x will still be known prints 5</em><br>      }<br> <br>      <strong>if</strong>(<strong>true</strong>){<br>         console.log(y); <em>//prints 7</em><br>       }<br>   }<br>   <strong>return</strong> nestedFunction;<br>}<br> <br><strong>var</strong> myFunction = outerFunction();<br>myFunction();</pre><p>In this example, the variable <em>x</em> is available everywhere inside of outerFunction(). Also, the variable <em>y</em> is available everywhere within the nestedFunction(), but neither are available outside of the function where they were defined.</p><p>The reason for this can be explained by lexical scoping. The scope of variables is defined by their position in source code. In order to resolve variables, JavaScript starts at the innermost scope and searches outwards until it finds the variable it was looking for. Lexical scoping is nice, because we can easily figure out what the value of a variable will be by looking at the code; whereas in dynamic scoping, the meaning of a variable can change at runtime, making it more difficult.</p><p>This ties in the topic of closure — a function which is able to remember and access its lexical scope even when that function is executing outside its lexical scope.</p><p>Lexical scope is the scope model used by the JavaScript language, which differs to some other languages which use dynamic scope. Lexical scope is the scope defined at lexing time.</p><h3>Lexing time?</h3><p>This dives into the mechanics of how the JavaScript engine works. Even though Javascript is known as an interpreted language, it compiles code immediately before executing it. For example the statement: var a = 3; is split into two separate steps at lexing time:</p><ul><li>var a This declares the variable in the scope, before code execution.</li><li>a = 3 This assigns the value 3 to the variable a, if it is found in the available scope.</li></ul><p>The lexing phase of compilation determines where and how all identifiers are declared, and thus how they will be looked up during execution. This is the same mechanism which results in “hoisting” variables. The variables are not actually moved within the source code, the declarations simply occur during the lexing phase and so the JavaScript engine is aware of these before execution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ff56f9ddd84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Drupal?]]></title>
            <link>https://medium.com/@kennyyang19/what-is-drupal-41cc3aba4958?source=rss-4e73936e08e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/41cc3aba4958</guid>
            <dc:creator><![CDATA[Kenny]]></dc:creator>
            <pubDate>Tue, 31 Jul 2018 05:06:48 GMT</pubDate>
            <atom:updated>2018-08-02T07:11:43.032Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUyVBAXRiJ6Xdienk00plQ.png" /><figcaption>Source: Drupal.com</figcaption></figure><p>Drupal is a popular free open source Content Management System (CMS) software. It is written in PHP and distributed under the GNU General Public License, which guarantees users the freedom to run, study, share and modify the software. It is used to make applications and websites and basically simplifies the online management of content and users. Some of its features include easy content authoring, reliable performance, and excellent security. It uses various functionalities like poll managements, graphic modification tools, user managements and advanced menu managements etc.</p><h3>What are the advantages?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u81nx2hq8mTIvaEy-7qrvw.png" /><figcaption>Drupal Advantages</figcaption></figure><h3><strong>Some Major highlights of Drupal</strong></h3><ol><li><strong>It is an open source software</strong></li></ol><p>In Drupal, the core software, contributed modules, and large number of themes are all free. This help reduce web development costs for businesses and users.</p><p><strong>2. It is customizable</strong></p><p>Features, operations, layouts, and designs are all customizable and gives developers a wide variety of selections to choose from to address their clients’ needs.</p><p><strong>3. Facilitates rapid deployment</strong></p><p>Allows companies to deploy core features and functionality rapidly.</p><p><strong>4. It gives extensive API support</strong></p><p>Social networking sites like Facebook, Twitter and Google analytics provide an extensive API support for Drupal. Developers can create custom modules by using such API.</p><p><strong>5. It is mobile friendly</strong></p><p>Smart device users can view Drupal websites the same as that of desktop users.</p><h3>Wordpress vs Joomla vs Drupal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GrrM2O9vR47iUL5fCRwKA.png" /></figure><p>Cost is around the same for all three platforms. Drupal is the most complex out the three because it requires a working knowledge of PHP, HTML and other programming languages to make any meaningful changes. Drupal comes with the steepest learning curve and requires the most knowledge.</p><ul><li><strong>WordPress</strong> — It is beginner friendly and easy to use. You can make a highly functional website suitable with no prior programming knowledge. Like Drupal, WordPress is customizable, secure, mobile friendly, easy to localize and collaborate on as well as easy to pass on to clients. It has the largest community and ecosystem but can be a challenge to scale.</li><li><strong>Joomla</strong> — In terms of user friendliness and scalability, Joomla places in between Wordpress and Drupal. It is mainly known to be used for social networking and e-commerce companies. It has a steeper learning curve than Wordpress, but it’s still widely used by popular brands.</li><li><strong>Drupal</strong> — It is used to build large sites with various features and customizations. Also, it offers a lot of power, capability and scalability(more robust back-end), but hard to use for beginners. It requires prior programming experience, such that companies may hire developers to utilize Drupal.</li></ul><h3><strong>Some companies using Drupal</strong></h3><ol><li><strong>Tesla</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4G1aAhrTydeMURDtQEeDA.png" /></figure><p><strong>2. GE</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gikTPY9n8b7q1lo066cGMQ.png" /></figure><p><strong>3. Whole Foods</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zuYZGcrTcKgXw5GhFnzfBg.png" /></figure><p><strong>4. The Economist</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLce5sP9YKJGTQ_7d5PqFQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41cc3aba4958" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>