Why java is not 100% object oriented programming language?

Why java is not 100% object oriented programming language?Thanx in advance.
[89 byte] By [iamegara] at [2007-11-27 8:16:18]
# 1
Why do you think it's not?
prometheuzza at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 2
> Why java is not 100% object oriented programming language?Now this is an interesting question for a change. I bet this hasn't been asked before. I'm so excited, I just can't wait for answer ...
quittea at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 3
Yes java is not 100% Object Oriented Programming Language. I have some sort of points but not enough clarification thats why i put this in forum.
iamegara at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 4
> Yes java is not 100% Object Oriented Programming> Language. I have some sort of points but not enough> clarification thats why i put this in forum.What points?
prometheuzza at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 5

On "purity" as a measure of object-orientedness:

However, this definition is problematic in that it implies that "purity" is a valid concept. Yet, there is no accepted definition of the term "pure OO language". Despite years of discussion and argument on the net, and in other circles, I have never seen anyone present a definition of a "pure OOPL" that met with general agreement by others.

-- Robert Martin, founder, CEO, and president of Object Mentor Inc., software industry leader.

On the value of using "purity" as a measure of a programming language:

I will not go into the discussion about ``purity'' beyond mentioning that I think that a general purpose programming language ought to and can support more than one programming style (``paradigm'').

-- Bjarne Stroustrup, designer and implementer of the C++ programming language, etc.

On the alleged "purity continuum":

OO language experts divide OOPLs into two categories, hybrid languages and pure OO languages. Hybrid languages are based on some non-OO model that has been enhanced with OO concepts. C++ (a superset of C), Ada 95, and CLOS (an object-enhanced version of LISP) are hybrid languages. Pure OO languages are based entirely on OO principles; Smalltalk, Eiffel, Java, and Simula are pure OO languages.

-- Carnegie Mellon Software Engineering Institute

~

yawmarka at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 6
Well i guess a purist view about a 100% OOP language would be "Everything is an object", whereas in Java we can use primitive data types like int,float etc... convincing?
relaxedgalaxya at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 7
The same discussion goes on whenever this question is asked, and I estimate it gets asked about once per week. The whole debate is academic, and the real question is "who cares?" ...
quittea at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 8
> convincing?Nope.~
yawmarka at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 9
Because there is no definitive agreement on what 100% OO actually means. In any case, suppose we did finally all agree on what it meant, and Java either did or didn't measure up. What then? Everything would just be the same as before
georgemca at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 10
> The whole debate is academic, and the real question is "who cares?" ...A handful of professors, apparently. :o)~
yawmarka at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 11
> A handful of professors, apparently. :o)Yes, and they just won't stop, which makes me want to cry a bit ...
quittea at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 12

> Well i guess a purist view about a 100% OOP language

> would be "Everything is an object", whereas in Java

> we can use primitive data types like int,float etc...

> convincing?

I never understood this argument because if you say this then you are also saying that C++ is also not a pure OO language.

All objects eventually boil down to hard DATA and plain ol' data is best represented by its basic type, generally a number of some kind.

To say Java is not a pure OO language because it has primitive data types seems nitpicky.

You can have a String object, which boils down to a collection of characters, each character being a number that maps to its associated Unicode character.

So the underlying data of a String object is essentially numbers, and those numbers are interpreted by the compiler as char's.

Everything boils down to a primitive type of some sort.

maple_shafta at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 13

> > Well i guess a purist view about a 100% OOP

> language

> > would be "Everything is an object", whereas in

> Java

> > we can use primitive data types like int,float

> etc...

> > convincing?

>

> I never understood this argument because if you say

> this then you are also saying that C++ is also not a

> pure OO language.

>

> All objects eventually boil down to hard DATA and

> plain ol' data is best represented by its basic type,

> generally a number of some kind.

>

> To say Java is not a pure OO language because it has

> primitive data types seems nitpicky.

>

> You can have a String object, which boils down to a

> collection of characters, each character being a

> number that maps to its associated Unicode

> character.

>

> So the underlying data of a String object is

> essentially numbers, and those numbers are

> interpreted by the compiler as char's.

>

> Everything boils down to a primitive type of some

> sort.

But they point isn't how the data's represented on hardware, it's how the language abstracts that representation away from you. When you handle a String object, you aren't handling a bunch or raw bytes, you're handling an object. The semantics are different between C char*, a primitive, a class, etc.

That being said, I completely agree that anyone outside of language design or compiler theory has no need of an answer for this question.

hunter9000a at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 14
> That being said, I completely agree that anyone> outside of language design or compiler theory has no> need of an answer for this question.And even then they would not get "an answer", but rather a whole lot of conflicting conjecture.
masijade.a at 2007-7-12 20:01:11 > top of Java-index,Java Essentials,Java Programming...
# 15

> > That being said, I completely agree that anyone

> > outside of language design or compiler theory has

> no

> > need of an answer for this question.

>

> And even then they would not get "an answer", but

> rather a whole lot of conflicting conjecture.

But how else are theory guys supposed to get degrees? ;P

hunter9000a at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 16

"Enough is enough ... I have had it with these <expletive deleted> snakes on this <expletive delted> plane." Oh wait wrong line.

This entire question misses the point in my opinion and by extension the statement made by Carnagie Melon is wide of the mark as well. OO is not about language it is not about platform and is the language or platform OO? Object orientation in software development is about us, the developers and how WE think about and approach software development. It is also not a boolean question are you or are you not? It is a scale ranging from the purely procedural to the utterly oop and everywhere in between.

If you want my view of PURE OOP here it is. (If you don't well that's just tough you're going to get it anyway you're welcome to stop reading.) In the truly OOP mindset a software system is not a program. It is an ecosystem in which organisms are born, live, interact with other organisms, spawn new organisms, evolve and die. The expression of this ecosystem is in the bits and bytes of code. I contend that it is not whether the language or platform is OOP that matters. Cells have primative data types, but cells have behavior and a lifecycle as well so are they OOP by my definition of the term yes they are. What matters is how the developer THINKS about the system.

In my opinion if a developer looks to the language or to the platform or to anything external for object orientation then it is a veneer, an artificial thing put on rather than true object orientation. In a very zen way of looking at it, OO comes from within not from the language.

Now all of that said, it is a true statement that some languages and some platforms are more conducive to developing software in this manner. I'm not disagreeing with that in the slightest bit (Java sits on the OOP end of the scale but is not purely OOP not that it really matters). Languages and platforms that allow multiple events to go on simultaneously are more conducive to OO development than linear languages and platforms, but that doesn't mean that the developer cannot build a system that meets my definition of pure OO.

I'm quite certain that lots of you are going to read this and be convinced that I'm off my rocker (which is very possible) but before you discount the thought out of hand do this, find a pond a small one works best and watch it around dusk (The time spent in peaceful reflection alone will be worth the time spent) and think about applying the things that you see in how the organisms in that small environment interact to your software development and see where that leads you from a philosophical standpoint.

Just my 2 krupplenicks on the subject. Your milage may of course vary.

PS.

puckstopper31a at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 17

> question is "who cares?" ...

I care. Java is supposed to be a general-purpose langauge. Object-orientation (though I fancy myself I use it a lot) is not the answer to every problem. Java is more widely useful because it also allows you to write non-OO code.

BTW, in C++ you can (reasonably) write huge programs with hardly a single class or object in it (save cin and cout and a few more), so I suppose you have a case for labeling that non-pure OO. You can hardly do the same in Java, so the relationship between Java and OO is more dependent on your definitions and/or inclination.

OleVVa at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 18

Being ironic, a pure OO language shouldn't only be entirely object based, it should also provide language primitives to implement the most common design patterns!

If only it was possible to declare:

public listener ActionListener using ActionEvent;

and have all the standard methods be available:

public void addActionListener(ActionListener...);

public void removeActionListener(ActionListener...);

protected void fireActionEvent(ActionEvent...);

PS:

OleVV, ever heard of printf and scanf? You don't even need cin and cout.

Dalzhima at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 19
> You can hardly do the same in JavaSure you can. You can write all kinds of procedural gobbledygook with Java.~
yawmarka at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 20
> > You can hardly do the same in Java> > Sure you can. You can write all kinds of procedural> gobbledygook with Java.> > ~Just take a look at some of the 400-line-main-method "classes" some people post around here.
hunter9000a at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 21

> This entire question misses the point in my opinion

> and by extension the statement made by Carnagie Melon

> is wide of the mark as well.

I agree. The Carnegie Mellon quote was in my cut-n-paste response file in reaction to one of Ulrika's lectures about there being a continuum of OO-ness.

~

yawmarka at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 22

> > You can hardly do the same in Java

>

> Sure you can. You can write all kinds of procedural

> gobbledygook with Java.

>

> ~

Good grief, yeh. Where I used to work we had a Java API over the top of one of our server products, and that was little more than a bit of 'C' shoehorned through javac. Nasty business

georgemca at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 23

> This entire question misses the point in my opinion

> and by extension the statement made by Carnagie Melon

> is wide of the mark as well.

I agree. The Carnegie Mellon quote was in my cut-n-paste response file in reaction to one of Ulrika's lectures about there being a continuum of OO-ness. I find it a bit silly to suggest that such-and-such a language is 100% OO, as if there were languages that were 87.5% OO or 52.673% OO.

~

yawmarka at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 24

> > This entire question misses the point in my

> opinion

> > and by extension the statement made by Carnagie

> Melon

> > is wide of the mark as well.

>

> I agree. The Carnegie Mellon quote was in my

> cut-n-paste response file in reaction to one of

> Ulrika's lectures about there being a continuum of

> OO-ness. I find it a bit silly to suggest that

> such-and-such a language is 100% OO, as if there were

> languages that were 87.5% OO or 52.673% OO.

>

> ~

*nods like a bobble head doll* It's not a question of how oo is the language but how oo is the implementation of the language and that is and always will be on the shoulders of the developers.

PS.

puckstopper31a at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...
# 25

> > > You can hardly do the same in Java

> >

> > Sure you can. You can write all kinds of

> procedural

> > gobbledygook with Java.

> >

> > ~

>

> Good grief, yeh. Where I used to work we had a Java

> API over the top of one of our server products, and

> that was little more than a bit of 'C' shoehorned

> through javac. Nasty business

Hunter and George, I hesitatingly take your point. I think mine was that doing without objects and with only 1 class inevitably leads to unreasonably nasty business in Java, something you should avoid. The same is not always the case in C++.

OleVVa at 2007-7-21 22:34:58 > top of Java-index,Java Essentials,Java Programming...