3 ms·
> How many people can go read a large JS source file and make sense of what is happening quickly? not a lot, in comparison, Go is easy to read,there is no "ninj
by LocalPCGuy 11y ago
> How many people can go read a large JS source file and make sense of what is happening quickly? not a lot, in comparison, Go is easy to read,there is no "ninja trick" or metaprogramming stunts that makes code unreadable.
If written correctly, neither of those questions should be an issue.
1) JS devs shouldn't have "large" JavaScript source files, like most good programs, they should be broken into small, concise pieces.
2) JS devs shouldn't use "ninja tricks" or other BS, they should write for the next person that reads the code, again, like any language.
Yes, a lot of people still write bad JavaScript, but that is on them, not the language. It is pretty simple to write bery readable JavaScript if you so choose.
- WorldWideWayne 11y agoThe language and the environment are certainly at fault to a high degree due to the lack of standards. 1) Breaking JS up into small files actually makes it less readable because then you have to guess at the context that the JS is running in. Without static typing, it's impossible to reason about certain blocks of code without going to find blocks of code that exist in other files and so on... 2) JS devs have to use ninja tricks because without a strong standard library they have to keep reinventing the wheels that should have been included. There is no standard for how to write readable Javascript and there is too much flexibility. Isaacs, of Node.js fame, writes horribly unreadable code IMO due to the fact that he does not use semi-colons and he tends to put punctuation on the left. However, he swears by the fact that it's more readable...to him.