4 ms·
In fairness to JavaScript, it is absolutely possible to write very large apps and keep them organized and maintainable. I think the issue is that JS doesn't ha
by kevincennis 13y ago
In fairness to JavaScript, it is absolutely possible to write very large apps and keep them organized and maintainable.
I think the issue is that JS doesn't have strong conventions for how to do that, so you actually need to make good choices that work well with your app.
I have no doubt that Dart makes that stuff easier, but there's nothing inherent to JavaScript that makes it unsuitable for larger applications. It just forces you to make decisions.
- rdtsc 13y ago> In fairness to JavaScript, it is absolutely possible to write very large apps and keep them organized and maintainable. I see it a bit like when Dijkstra wrote "Go To Statement Considered Harmful". I have no doubt a lot of developers at the time objected to it and said "that is wrong, it is possible to write good code using GOTO". Because they probably wrote code using GOTOs and some of that code was probably decent quality.
- nine_k 13y agoIn C it is almost customary to use `goto` as poor man's exception handler: you do `goto cleanup` from inside of nested ifs and loops if a fatal error happens and all you need is to clean up what needs cleaning and return an error code. The problem is that `goto` is easy to abuse, and, worse, easy to abuse inadvertently, e.g. you might produce a `goto` into a loop or something like that during refactoring. JavaScript is like one big `goto` in this regard.
- munificent 13y agoIt's important to remember that the "goto" Dijkstra is talking about is very different from the "goto" that C programmers use. He's talk about unstructured goto: jumping from the middle of one function to another, or across scopes. "Goto" as another local flow control construct is relatively innocuous.
- nine_k 13y agoYes: structured `goto`, in form of `break` and `continue` is widely used and usually not frowned upon.
- ithkuil 13y agoIndeed, a labeled break is like a forward goto with the label placed far away from the destination :-)
- TazeTSchnitzel 13y agoYes. He's talking about BASIC and things like it, right? 10 PRINT "hello, world" 20 GOTO 10
- username42 13y agoIndeed. Dijkstra was frequently wrong, especially when he made grand sweeping statements. GOTO is a good example, 'GOTO considered harmful' is practically biblical law amongst many programmers, but it's worth remembering that he made that statement in the context of an argument with Donald Knuth. Knuth won: (http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pd...) http://web.archive.org/web/20070927094626/http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf http://web.archive.org/web/20070927094626/http://pplab.snu.a... See also http://kerneltrap.org/node/553/2131 http://kerneltrap.org/node/553/2131 about goto http://web.archive.org/web/20051128093253/http://kerneltrap.org/node/553/2131 http://web.archive.org/web/20051128093253/http://kerneltrap....
- rdtsc 13y agoHow do you mean "Knuth won"? Can you paraphrase the paper? I couldn't find a one phrase or proof of this "winning". Here is what Dijkstra said: > "The go to statement as it stands is just too primitive; it is too much an invitation to make a mess of one's program. " How does Knuth win that? In any case, I think there is a popular understanding of that phrase. It entered folklore to mean something else and regardless if that something else is different, it does make sense. Excessive GOTOs complicate code and create a spaghetti mess. Today we don't need scientific papers on it. That is how I understand it. The general idea is that there are better construct and better paradigms out there. Not all programming construct are strictly equal in practice. Yes all languages that are Turing complete can do the same kind of things. We know the theory. But it turns out some paradigms are better than others. OO programming, despite it being hated and derided today, was a better idea that writing lots of GOTOs. Functional programming with immutable data-structures does make sense in a distributed and concurrent environment. STMs compose better than locks and mutexes and so on.
- Volpe 13y agoJavascript is the only language you can run on the browser (Dart doesn't change that). So if Javascript is "GOTO" then dart is: "function NotGoTo() { GOTO; }"
- ithkuil 13y ago"If you want to go somewhere, goto is the best way to get there." - Ken Thompson
- marrs 13y agoJavascript comes from a school that most people simply didn't attend. But it's actually ahead of the curve by about 10 years, as evidenced by the emergence of Scala and co.