|
|
|
|
|
by forgotpwtomain
3297 days ago
|
|
This is the kind of attitude that leads to low quality, scrappy code, akin to copy and pasting Stackoverflow; I don't believe that a developer should need a great memory but they should have a good understanding which examples do not provide. I really like that the MDN docs are well specified and hope it stays that way. |
|
Nobody is arguing that we should be taking snippets and examples verbatim and use them 100% of the time without understanding them, just that there is value in having those snippets and examples available.
I know damn well how arrays work in javascript, from how they are implemented and what structures they use in memory at smaller sizes all the way up to the difference between a missing element in a sparse array to a dense array with an undefined value in it.
But sometimes I just want the snippet from MDN that "densifies" a sparse array. I know how it works, I can re-write it myself if needed, but I know that the one on MDN works and I won't hit any unexpected edge case because I forgot about some arcane bullshit thing.
Not to mention that when I'm first learning a new language or syntax I personally do MUCH better seeing examples of the code and being able to step through them to get the basics down (where I can then dive deeper into the system to understand the edge cases, hopefully with examples themselves to make sure I get the point).