4 ms·
I think that's actually an unreasonably strict interpretation of OO, actually. First, lack of classes is no reason to eliminate JS, it's not Class-Oriented pro
by jholman 9y ago
I think that's actually an unreasonably strict interpretation of OO, actually.
First, lack of classes is no reason to eliminate JS, it's not Class-Oriented programming. (not that I think JS is particularly OO; certainly not "completely OO")
Second, it's not Object-Only programming, so I'm not sure why you'd rule out any language with primitives. Much as I detest Java-style OO, I think it's very clear that its orientation is towards objects.
And third, even if you want to stick to those two rules, what about Ruby? Every value is an object, it has classes, and you can't write functions (only methods).
- saghm 9y agoI didn't mean to give the impression that I didn't consider JS to be object-oriented, although I realize now I wasn't quite as clear as I originally intended. When I said "at least partially OO", I meant that I wouldn't agree with an assertion that said JS isn't OO at all, not that it's only partially OO. After all, Rust doesn't have classes, and my original point was that I think Rust is somewhat OO. Similarly, I wasn't saying that Java isn't OO either; I was attempting to make the point that I could see plausible arguments saying that either Python or Java is "more OO" than the other. Personally, I consider Java to be more OO than Python, but I'm not sure I could make a compelling counterargument to the idea that Python is more OO due to everything being an object. As for Ruby, I'm not sure I understand what you're saying; Ruby lets you just write top-level functions and variables just like you can in Python. I also think you might have misinterpreted my giving examples as being "rules"; I certainly can't come up with any objective rules to determine whether a language is OO or not. I must not have made myself very clear, but the main idea behind what I was trying to convey is that I don't think anything is "completely" object-oriented and that plenty of languages fall somewhere on the spectrum of OO languages.
- matt_kantor 9y ago> As for Ruby, I'm not sure I understand what you're saying; Ruby lets you just write top-level functions and variables just like you can in Python. I don't know much about Python, but in Ruby top-level bindings are just syntax sugar for attaching things to an object called "main". [0] [0]: https://codequizzes.wordpress.com/2014/04/23/rubys-main-object-top-level-context/ https://codequizzes.wordpress.com/2014/04/23/rubys-main-obje...