Earlier quoted context omitted.
I bet as soon as you attempt to implement a DOM manipulation standard for Python you'd introduce all the same cross-browser incompatibilities as Java has. Also, in many ways Javascript is superior to Python. Closures are the only examples I know of off the top of my head.
Python has as much support for closures as javascript. The only significant feature in this respect that it is missing (that I am aware of) is multi-statement, in-expression lambdas. Javascript's syntactic nicety is higher there, but on balance I think python's is far superior. Both great languages, though.
Why I'm Becomming a JavaScript Convert
31–38 of 38 posts
Re: Why I'm Becomming a JavaScript Convert
#32Earlier quoted context omitted.
public/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.
Can you explain why you think x sucks/is pointless?
Prototype OO precludes introspection. You have "an object", and that's as much as you can ever know.
Re: Why I'm Becomming a JavaScript Convert
#33Earlier quoted context omitted.
Can you explain why you think x sucks/is pointless?
Enforced 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.
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.
Re: Why I'm Becomming a JavaScript Convert
#34I 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…
Re: Why I'm Becomming a JavaScript Convert
#35Earlier quoted context omitted.
I bet as soon as you attempt to implement a DOM manipulation standard for Python you'd introduce all the same cross-browser incompatibilities as Java has. Also, in many ways Javascript is superior to Python. Closures are the only examples I know of off the top of my head.
Java != JavaScript
Re: Why I'm Becomming a JavaScript Convert
#36Earlier quoted context omitted.
I bet as soon as you attempt to implement a DOM manipulation standard for Python you'd introduce all the same cross-browser incompatibilities as Java has. Also, in many ways Javascript is superior to Python. Closures are the only examples I know of off the top of my head.
Python has as much support for closures as javascript. The only significant feature in this respect that it is missing (that I am aware of) is multi-statement, in-expression lambdas. Javascript's syntactic nicety is higher there, but on balance I think python's is far superior. Both great languages, though.
Re: Why I'm Becomming a JavaScript Convert
#37Earlier quoted context omitted.
"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.
What do you think that boilerplate code is made of? Closures of course. You simply can't make large scale software using just closures.
Re: Why I'm Becomming a JavaScript Convert
#38Earlier quoted context omitted.
What do you think that boilerplate code is made of? Closures of course. You simply can't make large scale software using just closures.
I 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.
Python code bases scale easily, in my experience.