7 ms·
This is how people that think in oop and love java think, everything that does not have classes is unmaintable, this is very subjective.
by givan 14y ago
This is how people that think in oop and love java think, everything that does not have classes is unmaintable, this is very subjective.
- afsina 14y agoYet Google agrees with him and pushes Dart
- phpnode 14y agoI think they're covered under "think in oop and love java"
- luriel 14y agoI don't think the Go developers "think in oop", and they certainly don't love Java.
- luriel 14y agoNote that Go has no 'classes', and doesn't follow what many people consider mainstream OO principles (eg., inheritance), and many people would say this is one of the things that make it so great, specially in large projects (working out a good type hierarchy, and evolving it over time is extremely difficult and painful). The problem with JavaScript is not lack of 'classes', but a not just dynamic but also very weak type system. Add to that the callback-hell caused by the async model of things like Node.js, and you end up with something very hard to maintain quite fast.
- wcoenen 14y agoWas the argument really about classes? I would have expected this to be about the lack of namespaces. (I can't watch the video, it stops to buffer every second.)
- danmaz74 14y agoBy the way, if all you need is classes, there are many many libraries that give you those in JS (not to talk about CoffeeScript). What I really miss from a maintainability point of view with javascript, on the other hand, is better development tools (ie IDEs and testing tools). I'm pretty sure there is a big opportunity there.
- hamidpalo 14y agoIt's about the type system. Dynamic, weak typing makes writing static analysis/refactoring/etc tools extremely hard, but more importantly makes nearly any compile-time guarantees impossible. Having your app crash because of a small typo of a member name is impossible in C++/C#/Java. It happens to me almost once a day with Node/JS.
- ocharles 14y agoThis rings very true to me too, as our entire application is written in Perl. As much as I do like the language, the lack of just about any static guarantees mean we regress an awful lot. Yes, we have unit tests, but until we have 100% coverage we have gaps for regressions that a compiler could have picked up.
- gaius 14y agoAnyone doing a large project in an weakly-typed language will eventually spend more time writing unit tests than features. No-one should even be thinking about unit tests if they are not already using a language in which all code paths can be evaluated and type-checked at compile time. Why get a dog and bark yourself?
- sktrdie 14y agoThis is not why you write tests. You write tests to be sure nothing breaks when you make changes. And you should do this with any language, typed or not.
- nnythm 14y agoUsing a language with static typing means that there are a lot of tests you don't have to write. Do you remember the units trick from physics? If you forgot which equation you're supposed to use, keep on using identities until you're in the units you're supposed to be. Static typing checks that your units are correct for free.
- brazzy 14y ago
- ilaksh 14y agoYou definitely can create classes in JavaScript, its just not especially convenient. But to me its not really a critical issue, because OOP is very easy in CoffeeScript, which is my favorite language and happens to compile to JavaScript.
- masklinn 14y ago> everything that does not have classes is unmaintable Not that javascript doesn't. It doesn't have the sugar around it, and it doesn't statically check them. But javascript's OO is not "prototype-based" (that doesn't even make sense, prototypes are not a unit of reuse in Self) and it's not anything even remotely close to Self's. Javascript's OO is single-inheritance class-based with no `class` sugar but at the end of the day it behaves pretty much the same way (and offers no more features — less if anything) Python's or Ruby's class-based OO work (sans metaclasses).
- pjmlp 14y agoNo, this is what people that have real life experience from large scale applications think. I have quite some experience with most mainstream dynamic languages, and wouldn't do any large scale application with any of them. The company I work for, does large scale enterprise consultancy projects. This means: - Multiple development sites; - Some projects have up to 200 developers; - Usually several megabytes of source code; - Continuous Integration build systems with automatic unit and integration tests - Usually distributed architecture - High performance requirements No way I would advise anyone to do develop such systems in a dynamic language, let alone in JavaScript.
- mercurial 14y agoMaintaining a large PHP project written by idiots, in addition to a much smaller codebase in Javascript has convinced me of the importance of static typing for large-scale projects.