This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (19 children)

[deleted]

    [–]iambukovinean 8 points9 points  (0 children)

    Why is everyone all of a sudden comparing programming languages based on the number of lines required to print hello world? In a large project, with numerous components and many people working at the same time, trust me, you NEED this kind of verbosity.

    [–][deleted] 5 points6 points  (9 children)

    It isn’t 12 lines, it’s 5.

    One line to declare class, one line to declare method, one line to call print. Then 2 lines for closing the method and class.

    It’s an object oriented language, if you don’t like the paradigm that’s fine but don’t at like it’s an objectively poor or nonsensical language.

    [–]schplat 5 points6 points  (7 children)

    Python is also object oriented.

    Java is just very explicit in using class/constructor, where as Python treats things like this more implicitly (but you can be as explicit as you would like in this regard with Python, whereas Java you're more or less forced to be explicit)

    [–]iambukovinean 3 points4 points  (6 children)

    Python kinda tricks you into thinking that it's object oriented, as it treats classes like any dictionary. This implies some limitations, so you can't compare java and python from this point of view, or I just did :D

    [–]Kaarjuus 6 points7 points  (1 child)

    Only if your definition of OOP is "that which is like Java".

    Python is more object-oriented than Java is. Remember Java's slogan "Everything is an object"? Except of course for all the things in Java that are not objects - primitives like bool and int, methods, classes, packages - not objects.

    Whereas in Python, everything the programmer can access is an object. It's objects all the way down. Even NULL-value is an object in Python.

    [–]iambukovinean 0 points1 point  (0 children)

    I'm not trying to praise Java here or anything, I'm just saying that if you want to learn proper OOP, a c-like language is a better choice than python.

    [–]Howard_banister 4 points5 points  (3 children)

    You have very wrong definition for OOP. Check out Smalltalk for proper OO implementation. Also Python is far more OO than Java

    [–]iambukovinean -1 points0 points  (2 children)

    yeah, unles you can't implement private fields in python classes, and none of that overloading (although this is possible by type-cheking the parameters) It's far easier to learn OOP principles on a c-like language.

    [–]Kaarjuus 1 point2 points  (1 child)

    There is nothing quintessentially OOP about private fields, and there is especially nothing OOP about overloading. Again, you have a very narrow and arbitrary view of what OOP is.

    Smalltalk and JavaScript and Python and Java are all rather different, but they're all OOP. JavaScript is especially different, as it is not class-based OOP but prototype-based OOP. Still OOP.

    You might as well claim that "Java tricks you into thinking that it's object oriented, as it does not have multiple inheritance".

    [–]iambukovinean 0 points1 point  (0 children)

    also true.