Tuesday, November 5, 2019

BlogPost_202

  1. Describe one thing you're learning in class today.
Well I was not in class that day I´ll be honest but I have been learning a about how to use arrays and array methods. That and the for loops has been pretty interesting.

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

The purpose of "use strict" is to indicate that the code should be executed in "strict mode". With strict mode, you can not, for example, use undeclared variables. ... It helps you to write cleaner code, like preventing you from using undeclared variables.

3. Explain "hoisting".

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.

4. Explain the importance of standards and standards bodies.

These bodies or organizations publish documents to keep a standard so everything is described properly, it´s organized and the people involved can follow up on what they´re developing. They are important because if they didn´t exist the web would just be chaos. Everybody would do whatever they want and there wouldn´t be an organized document where you could read how to implement new coding solutions. It makes it very efficient for coders and for consumers to be able to take advantage of new technologies.

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

I have commented the code thoroughly so that I don´t get confused if I have to make a change in the future and I don´t feel familiar with the code anymore. I´ve also sometimes left commented out code with instructions on how to use it in case someone want to implement that part of the code. 

6. Why is extending built-in JavaScript objects not a good idea?

Well first because you could get confused pretty quickly and your code could behave erratically. You could also break the default functionality. It´s just not good practice. 

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

For Javascript it has more severe consequences. It´s harder to read the code and reason about it when variables seem to appear out of thin air. Also, anyone can update a global variable from any point in the program at any time. You can also encounter variable name clashes. 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home