Why Fundamentals Matters When Learning to Code

The MDN Web Docs, otherwise known as the Mozilla Developer Network (MDN), is perhaps one of the most frequented resources used by web developers. Seasoned developers leverage the material to comprehend the mechanics of various tools available within HTML, CSS, and/or JavaScript. Less seasoned developers rely on this resource to simply learn about these technologies. Without the proper foundational knowledge, these newer developers compound the difficulty of learning to code.

Launch School, an online school for web development and software engineering, solves this predicament via their mastery-based education. They accomplish this through the use of detailed and precise educational content. Establishing the proper foundational knowledge and developing a deep level of understanding will save beginners time in the long run.

Fundamentals Help To Understand Content Better

To get a glimpse into how knowing the fundamentals help when learning to code, we will be comparing MDN’s reference page for the Array.prototype.map() method and one of Launch School’s pages that provide similar kind of information (Course 210, Lesson 7, and Assignment 6). MDN’s material represents surface-level content whereas Launch School represents the opposite.

The Detail Matters

To begin with, MDN titles its page, “Array.prototype.map()”, whereas the Launch School titles it, “Transformation”. While MDN is clear about the method it’s referencing, Launch School instead addresses the method’s purpose when used in programming. Even beyond the title, MDN leaves out completely the terms “transform” or “transformation”. Launch School recognizes the fact that this method embodies the concept of transformation, where elements of one array are “transformed” into new elements of a new array. Thinking of methods in terms of the abstraction that they represent is a natural and useful way of looking at things to facilitate problem solving in computer programming.

On a different note, MDN does provide a useful reference of the method’s full syntax. Launch School does similar, but not as thoroughly. It leaves out any mention of the thisArg parameter. Perhaps Launch School will mention it in a later course material (beyond Course 210, Lesson 7, and Assignment 6). Though for the time being, Launch School leaves this kind of information out because doing so saves new developers from unnecessary confusion and headache.

Next, in comparing the description of the method’s return value, MDN’s explanation lacks both depth and detail compared to Launch School’s description of the method’s return value. MDN’s description states that the method’s return value is…

“A new array with each element being the result of the callback function”.

In contrast, Launch School’s states…

map returns a new Array that contains one element for each element in the original Array. Each element in the returned array contains the value returned by the callback Function for the corresponding element in the original Array.”

This description more clearly explains what map returns when it is invoked and how it does so.

Of note, MDN provides information about the quirks of map which Launch School leaves out. These details are useful when debugging. For example, MDN points out that “[callback] is not called for missing elements of the array” while Launch School does not mention this. However, Launch School leaves this out because again it isn’t something new developers should get hung up on at this stage of learning.

Precision of Language Matters

Another factor where Launch School differs from MDN is specificity of the material. The MDN page on Array.prototype.map() introduces the method by saying, “The map() method creates a new array with the result of calling a provided function on every element in the calling array.” This is succinct, but lacks specificity. Launch School emphasizes the importance of being precise; being able to understand and explain the code precisely not only shows deep understanding but it’s this level of understanding that developers can rely on during debugging or problem solving.

Another problem with this description is their loose usage of the word “result”. As taught by Launch School, this isn’t wrong, but it’s also not precise. The issue with using the word “result” when trying to explain what a method does is that “result” is too vague. It could mean multiple things; it could mean that a method “returns”, that a method has “side effects”, or that a method has both. Side effects include any logging to the JavaScript console. It also includes any changes that a JavaScript method may have on the “outside world”. For example, a mutation of an argument or a local variable in an outer scope relative to the function’s local variable scope when a method is invoked is considered a side effect. For this reason, MDN’s usage of the word “result” in this case is too vague and better would be to specify that calling the method returns a new array with each element being the value “returned” by the callback function. Being able to think about things with precision will aid new developers in being able to debug and understand more complex code later in their journeys as programmers.

Conclusion

As it was shown through this comparison, pursuing a deeper level of understanding through mastering fundamentals in web development helps to better understand the material that is out there and this ultimately saves time. There were aspects of MDN as discussed in this article that would have remained hidden to new developers if they do not have foundations put in place. To end with, Douglas Crockford, a well-known JavaScript teacher, once said in his talk titled, Crockford on JavaScript — Chapter 2: And Then There was JavaScript, “Programming is serious business, and you should have good knowledge about what you are doing.” Learning HTML, CSS, and/or JavaScript at the surface level, such as primarily through MDN’s reference guides, is not going to be an efficient way to become proficient web developers; however, the sort of education that Launch School provides would definitely be enough to help establish the needed foundation that will be greatly beneficial in your journey as a programmer.