5 ms·
I use to hate Javascript. I attempted to build a large enterprise system using ExtJS... I ran into a number of problems. I then realized that I could accomplish
by jonpaul 16y ago
I use to hate Javascript. I attempted to build a large enterprise system using ExtJS... I ran into a number of problems. I then realized that I could accomplish the same task using GWT/GXT. It was successful. I still don't like Javascript, but I'm warming up to the idea of embracing it.
It seems to me that with the advent of Node.js and document oriented databases that use JSON for their document description, such as MongoDB, Javascript will become the world's most used language. I think Javascript's momentum is unstoppable.
Time will tell.
- wvenable 16y agoJavaScript really doesn't seem appropriate for large software. Much of the features (like, for example, prototype inheritance) makes for small code but at the cost of some complexity. Even trying to ensure some measure of public/private data requires a lot of boilerplate code. Probably adding the necessary features to JavaScript to make it more appropriate for these tasks would ruin it for the things it's really very good at.
- jrockway 16y agopublic/private is the most pointless distinction ever invented. Enforced privacy makes reuse nearly impossible. That said, I don't really think Javascript is all that special. Prototype OO sucks.
- mhansen 16y agoCan you explain why you think x sucks/is pointless?
- jrockway 16y agoEnforced privacy limits reuse but doesn't prevent any particular class of bugs (calling random private methods is no worse than calling random public methods; you should feel equally bad about both). Prototype OO precludes introspection. You have "an object", and that's as much as you can ever know.
- wvenable 16y agoYou're looking at enforced privacy from the callers perspective not the callee perspective. For the callee, the benefit is you can change or remove any private methods or private data structures and be guaranteed not to affect any callers. It's the benefit of basic encapsulation. Although I completely agree with you about Prototype OO it doesn't necessarily preclude introspection. You can find out what kind of object it is (by looking at the constructor property) and you can iterate the methods and properties. Introspection is not a problem. But there are no guarantees -- if you find out that your object is a "bicycle" there is no guarantee it has a "pedal" method even if it had one on creation.
- mnemonik 16y ago"Even trying to ensure some measure of public/private data requires a lot of boilerplate code." Just use closures. Thats less code than you would have in many other languages.
- wvenable 16y agoWhat do you think that boilerplate code is made of? Closures of course. You simply can't make large scale software using just closures.
- BenjaminCoe 16y agoI disagree, regarding JavaScript's ability to scale. It is quite easy to implement classical inheritance inside JavaScript, public and private methods really do not seem like a must have to me for code to be 'scallable'. It seems to me that these concepts are loosely enforced (or not present) in many popular web languages already.
- mnemonik 16y agoYup, look at Python. Private methods are private by convention (leading underscore), not because the interpreter enforces privacy. Python code bases scale easily, in my experience.
- BenjaminCoe 16y agoYeah, for my personal website I'm about to try out node.JS with MongoDB -- I think it will be an exciting experiment. As more frameworks grow up around technologies like these, I really think server-side JavaScript makes a ton of sense -- most importantly, it can lead to a lot more sharing of application logic between the static and client-side JS parts of a site.