A Scope of Practice #202

Describe one thing you’re learning in class today.

Today I learned about Javascript Objects. An object is a collection of properties, and a property is an association between a name (or key) and a value. Inside an object we can have an array, a number, a string, and name/value pairs. This “object” has numerous methods which a developer can call or invoke to create data flow.

What is "use strict";? What are the advantages and disadvantages to using it?

If you put “use strict”; at the top of your code (or function), then the JS is evaluated in strict mode. Strict mode throws more errors and disables some features in an effort to make your code more robust, readable, and accurate

Explain function hoisting in JavaScript.

Hoisting is a Javascript mechanism where variables and function declarations are moved to the top of their scope before code execution. Inevitably, this means that no matter where functions and variables are declared, they are moved to the top of their scope regardless of whether their scope is global or local.

Explain the importance of standards and standards bodies like ECMA.

As older tech is iterated upon, if they push towards standards, competing technologies can start to coincide and build upon each other. More developers become available to adopt the technology and more users can consume it.

When standards bodies decide on standards, they strive towards backwards-compatibility. As new tech becomes old, maintenance can stay efficient. With standards, you can be user that your site that uses positon:fixed will behave in the same manner even when new CSS rules are created and new browsers are released to support them.

There are other bodies relevant to web standards such as ISO, Ecma International. Standard bodies create the standards that make our work as developers more efficient and make the technology we take advantage of as consumers possible.

What actions have you personally taken on recent projects to increase maintainability of your code?

Making sure to try to make everything legible by indenting and commenting on everything and anything that can allow anyone reading my code to understand why i have written what I wrote.

Why is it, in general, a good idea to leave the global scope of a website as-is and never touch it?

The primary reason why global variables are discouraged in javascript is because, in javascript all code share a single global namespace, also javascript has implied global variables i.e. variables which are not explicitly declared in local scope are automatically added to global namespace. Relying too much on global variables can result in collisions between various scripts on the same page.

Austin Coding Academy