1 Q about Java and Python

Started by
6 comments, last by thugkilla 18 years, 7 months ago
Which one of them is more of an OOP suporter? In the future i would like to try to make a compiler and since OOP is said to be one of the best or the best style of programming then I think I should learn more about its style and the way it works. Thanx alot guys
Advertisement
Without directly answering your question, I'd like to make something clear:

There is no "best" style of programming.

In this case, we're referring to a programming "paradigm", and again I say there is none that is "best". Rather, a good programmer making a good program or library or API will use all of the various tools at his disposal where they make the most sense, including procedural programming, object-oriented programming, generics (templated) programming, and others. OOP makes sense in many cases, but in others procedural is much simpler and correlates better with the functionality, for example.

Thank you,
Twilight Dragon
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
First off i just heard OOP is great for Game Programming,THEN i got to the Begginers like i should and check the languages and there is NO Python i only see Java and it says:

"While not an official "sequel" to C++, Java borrows very heavily from C++ syntax. It dumps many of the more difficult C++ features to reveal a rather compact and easy-to-learn language. """""Unlike C++, Java enforces object-orientation with a heavy hand.""""" Writing a non-OO app in Java is as difficult as writing spaghetti-code in Pascal."

So asking somehting that ISNT in there shoudnt be hard to answer?
Java, and many languages (possibly Python, I don't know), fully support OOP.

If you are interested in learning about OOP, you should try reading this.

As to which supports OOP more, I can't answer. As far as I know, a language either supports OOP, or it doesn't; although it may be possible to use objects without being object oriented.
hippopotomonstrosesquippedaliophobia- the fear of big words
Quote:Original post by 2DExtremeOwner
Which one of them is more of an OOP suporter?

Who cares? A better question is which one of them lets you get your job done faster and with less trouble.
Quote:Original post by 2DExtremeOwner
OOP is said to be one of the best or the best style of programming

Said by who? Most people who say this aren't even aware of existance of non-mainstream languages like Lisp, Erlang or Haskell.

Do yourself a favor and go with Python. It supports OOP and a bunch of other things Java can't even dream of.
To answer this question requires a proper definition of OOP, and if you asked the top ten bigwigs in this area, you'd probably get at least twenty candidate answers. :/

That said:

Java is designed more to enforce the OOP style: it includes checking for public/protected/private access, and makes you wrap every bit of code into a class. Python does neither of those, but it does a much better job of exhibiting the "everything is an object" philosophy: while you can have free functions, the *function itself* is an object, and the class of an object is also an object (metaclassing), and other stuff like that. That lets you do lots of useful things like aliasing functions, dispatch to functions from text input without building a lookup yourself (reflection), etc.

This wiki page is relevant, too. There are many who argue that Smalltalk is the only language that comes close to REAL OOP, "and even then, ...".
@2DExtremeOwner: Judging by this and some other posts you've done really, I'd say you really should just learn any language. Every language has its supporters and detractors. And explaining the real differences to a non-programmer will just confuse them. Choose a language and get to the point where you can write a text-based tic-tac-toe (or similar) And then decide if you like it.

Good luck
I don't know about python ,but Java is a purely oop language.Because in Java you can't program without OOP ,but python is optional so you can use procedural or oop

This topic is closed to new replies.

Advertisement