3 ms·
So despite the mostly vapid nature of this article one thing called out to me: "Given the lax nature of JavaScript, it's easy for your application to spiral in
by nsfmc 15y ago
So despite the mostly vapid nature of this article one thing called out to me:
"Given the lax nature of JavaScript, it's easy for your application to spiral into a mess of unmaintainable spaghetti code."
Let's not forget: it's entirely possible to create a mess of unmaintainable code in any language. Or, "guns don't kill people, people kill people"
The other half of this complaint i think is somewhat elitist (unwittingly so?) and it seems to do with the notion that because there is a such a low barrier to entry, that much js code is cargo-culted, but i've seen this from developers in every language. What I find even worse than cargo-cult code is Pattern Zealots going about specifically coding up Pattern X in javascript. It's like they studied Design Patterns but the point of it just went over their heads.
Knowing the principles of software development doesn't prevent you from making ridiculous decisions[1]. It seems like everyone wants checklists of coding standards or something for measuring code quality / standards compliance these days in js. But these are hollow measures if the code behind the module/black box/library is just plain wrong.
Maybe i'm missing something here, but why is this article getting voted up?
[1]: http://stackoverflow.com/questions/1635800/javascript-best-singleton-pattern http://stackoverflow.com/questions/1635800/javascript-best-s... (found when googling 'javascript singleton')
- quanticle 15y agoLet's not forget: it's entirely possible to create a mess of unmaintainable code in any language. Or, "guns don't kill people, people kill people" That's true. You can write FORTRAN in any language. However, some languages make certain classes of mistakes easier. For example, C makes it very easy leak memory. Java, with its automatic garbage collection, makes it considerably harder. Does this mean that memory leaks are impossible in Java? Of course not. But I'd still rather have memory management than not.
- nsfmc 15y agoan aside: i have been asked three times in separate technical interviews (several years apart even) how to leak memory in java (once in python).
- zlapper 15y agoI would like you to show us some examples!
- quanticle 15y agoI can't remember any Java examples at the moment, but I do recall a memory leak that I had created in C#. Registering an event handler in .Net creates a reference to the handler. This means that an event handler that doesn't un-register itself from it's event will never be garbage collected. In the context of a GUI application, this means that you have to be careful to ensure that child windows remove their event handlers when they're closed. Otherwise, your application will leak memory, as the closed windows will never be garbage collected.