By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,223 Members | 1,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,223 IT Pros & Developers. It's quick & easy.

Object Oriented PHP vs Java

P: n/a
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?
Jul 17 '05 #1
Share this Question
Share on Google+
54 Replies


P: n/a
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


Sounds like a topic for a post-grad paper. If I had a few months of time
and needed the credit, I'd probably answer something, but since this is
a usenet group...

;-)

Jochen
Jul 17 '05 #2

P: n/a
PHP is not fully OO, even the PHP5... but Java is OO

Savut

"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

Jul 17 '05 #3

P: n/a
Savut <we***@hotmail.com> wrote:
PHP is not fully OO, even the PHP5... but Java is OO


But even java isn't fully OO. PHP is OO, just like javascript is OO to
some degree.

--

Daniel Tryba

Jul 17 '05 #4

P: n/a
I'm going to go out on a limb here - probably every true OO developer will hate me for it:

I feel that using PHP is by default more OO than Java because of the difference in typing techniques. Java has very strong type
casting where as PHP has virtually no types at all.

Let's look at this way. Both languages support class definitions which let you encapsulate your real-world object. In both
languages you can extended a class so there is the notion of inheritance. You can over-ride member functions in each language -
which lets you create default and virtual functions.

But what you can do in PHP that you can't do in Java is pass anything to just about anything. It is the ultimate in Black Box
programming - you don't care what an object is made of - and you don't even care what the object is.

Quick example

class Zebra
{
function Zebra() {}
function printIt() { return "I'm a zebra"; }
}

class Car
{
function Car() {}
function printIt() { return "I'm a car"; }
}

function printObject($object)
{
if (function_exists($object->printIt())
print $object->printIt();
else
print "N/A";
}

$z = new Zebra();
$c = new Car();

printObject ($c);
printObject ($z);

Perfect - printObject() doesn't care what is passed to it - it only cares that it has a single member function called "printIt()"
available.

Some will argue that this is the opposite of what OOD/OOP is all about. While certainly strongly typed languages help facilitate
good structure and prevention of mistakes, I believe the Black Box approach is really the original goal of OOD/OOP. As soon as a
compiler complains that you can't pass a number where a string is required you're forcing the programmer to know the internals of
the object in question. And knowing the internals IMO breaks OOD.
-CF
"Jerry" <we******@nova.edu> wrote in message news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

Jul 17 '05 #5

P: n/a
ChronoFish <de**@chronofish.com> wrote:
Quick example

class Zebra
{
function Zebra() {}
function printIt() { return "I'm a zebra"; }
} [snip] function printObject($object)
{
if (function_exists($object->printIt())
print $object->printIt();
else
print "N/A";
}

$z = new Zebra();
printObject ($c); Perfect - printObject() doesn't care what is passed to it - it only
cares that it has a single member function called "printIt()"
available.


The java counter example (reflection) below:

Zebra.java:
public class Zebra
{
public Zebra()
{
}

public String printIt()
{
System.out.println("I'm a "+this.getClass().getName());
}

}
RetroZebra.java:
import java.lang.reflect.Method;
public class RetroZebra
{
public static void main(String args[])
{
Zebra z=new Zebra();

System.out.println(PrintObject(z));
}

public static Object PrintObject(Object o)
{
Object rc;

try
{
Method m=o.getClass().getMethod("printIt",null);

rc=m.invoke(o,null);
}
catch(Exception e)
{
rc="N/A";
}

return rc;
}
}

--

Daniel Tryba

Jul 17 '05 #6

P: n/a
Daniel Tryba <ne****************@canopus.nl> wrote:
public static void main(String args[])
{
Zebra z=new Zebra();


Ooops, offcourse it should have been:
Object z=new Zebra();

--

Daniel Tryba

Jul 17 '05 #7

P: n/a

"Savut" <we***@hotmail.com> wrote in message
news:UE*********************@news20.bellglobal.com ...
PHP is not fully OO, even the PHP5... but Java is OO

Not according to some people as it does not support multiple inheritance.

Tony Marston
http://www.tonymarston.net/
Savut

"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


Jul 17 '05 #8

P: n/a

"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


What about the question "what are the advantages and disadvantages of using
procedural techniques vs object oriented techniques?"

PHP is superior to Java because you can use a mixture of procedural and OO
techniques whereas Java forces you down the OO route whether you like it or
not (and I like it not).

But, after all, I am famous for being an OO agnostic.

Tony Marston
http://www.tonymarston.net/
Jul 17 '05 #9

P: n/a
Savut wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

>> PHP is not fully OO, even the PHP5... but Java is OO


As there is *no* commonly accepted definition of OO, I just dont
understand how you can claim such a thing.

BTW, Smalltalkers could tell you why Java is not OO !-)

Jul 17 '05 #10

P: n/a
ChronoFish wrote:
I'm going to go out on a limb here - probably every true OO developer will hate me for it:

I feel that using PHP is by default more OO than Java because of the difference in typing techniques. Java has very strong type
casting where as PHP has virtually no types at all.


(snip the rest)

This is called static typing in the case of Java, and dynamic typing in
the case of PHP. And "Dynamic vs Static Typing" is one of the Four
Standard Religious Usenet Flamewars(tm). (If you ask, the three others
are "C vs C++", "Vi(m) vs [X]Emacs", and "Windows vs *n*x"...)

My 2 cents...

Jul 17 '05 #11

P: n/a
Tony Marston wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


What about the question "what are the advantages and disadvantages of using
procedural techniques vs object oriented techniques?"

PHP is superior to Java because you can use a mixture of procedural and OO
techniques whereas Java forces you down the OO route whether you like it or
not (and I like it not).


Ho, well, just use classes as modules, with only class methods and
variables (unless you need some 'struct' or the like then use classes
with public instance variables), and you'll have Java as a pretty nice
procedural language !-)

HTH !-)
Bruno

Jul 17 '05 #12

P: n/a
Bruno Desthuilliers wrote:
Savut wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

>> PHP is not fully OO, even the PHP5... but Java is OO


As there is *no* commonly accepted definition of OO, I just dont
understand how you can claim such a thing.

BTW, Smalltalkers could tell you why Java is not OO !-)


Actually, there is a commonly accepted definition...
OO implies:
polymorphism, encapsulation, and inheritance.
Jul 17 '05 #13

P: n/a
Tony Marston wrote:
"Savut" <we***@hotmail.com> wrote in message
news:UE*********************@news20.bellglobal.com ...
PHP is not fully OO, even the PHP5... but Java is OO
Not according to some people as it does not support multiple inheritance.


Multiple inheritance can be problematic and is not a staple of OOP.

Tony Marston
http://www.tonymarston.net/

Savut

"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google .com...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?



--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #14

P: n/a
Daniel Tryba wrote:
Savut <we***@hotmail.com> wrote:
PHP is not fully OO, even the PHP5... but Java is OO

But even java isn't fully OO. PHP is OO, just like javascript is OO to
some degree.


PHP4 has some OOP support. PHP5 has better OOP support. JavaScript is
not really OO since it uses anonymous functions to define methods. Not
to mention, inheritance can be tricky in JavaScript.

--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #15

P: n/a
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.
--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #16

P: n/a
The date was 21 Jan 2004 10:31:04 -0800, and we******@nova.edu (Jerry)
created the following morsel of goodness:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


It all depends on what type of project you will be working on. If you
want to create a page templating engine, go with PHP. If you want to
create an online game, use Java.

Whether you use one or the other for OOP is a moot point. You
wouldn't use PHP to create a side-scrolling adventure game, and Java,
IMHO at least, certainly is NOT the best suited language for parsing
text. They both have a reasonable OOP model to work with, but the
languages just don't seem to have the same intended uses.
Jul 17 '05 #17

P: n/a
In article <bu************@ID-30799.news.uni-berlin.de>, Agelmar wrote:
Bruno Desthuilliers wrote:
Savut wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...

What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

>> PHP is not fully OO, even the PHP5... but Java is OO


As there is *no* commonly accepted definition of OO, I just dont
understand how you can claim such a thing.

BTW, Smalltalkers could tell you why Java is not OO !-)


Actually, there is a commonly accepted definition...
OO implies:
polymorphism, encapsulation, and inheritance.


Polymorphism is available in non-OO languages. Many, including the
authors of Design Patterns, advocate delegation over inheritance.
Encapsulation can be easily achieved with modules and records.

Alan Kay defines OOP as late binding and messaging. He also noted that Java
is not what he had in mind when he coined the term, "OO".

Robert Martin sees OOP as a dependency management technique; no more, no less.

Ruby claims to be "pure-OO", but doesn't effectively enforce "information
hiding", which to some is a crucial part of "encapsulation", and to others,
a totally separate topic.

But there's one thing for sure: OO == good. So, start with "good" and
extrapolate "OO". It's much easier. =)

--
..:[ dave benjamin (rameny sp00) -:- spoomusic.com -:- ramenfest.com ]:.
: d r i n k i n g l i f e o u t o f t h e c o n t a i n e r :
Jul 17 '05 #18

P: n/a

"Dave Benjamin" <ra***@lackingtalent.com> wrote in message
news:slrnc0v21b.pop.ra***@lackingtalent.com...
In article <bu************@ID-30799.news.uni-berlin.de>, Agelmar wrote:
Bruno Desthuilliers wrote:
Savut wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...

<snip>
But there's one thing for sure: OO == good. So, start with "good" and
extrapolate "OO". It's much easier. =)


I disagree entirely. You are implying that if it is OO then it must be good,
and if it is not OO then it must be bad.

It is possible to have an OO solution that is a pile of crap, and it is also
possible to have a non-OO solution that is not.

Tony Marston
http://www.tonymarston.net/
Jul 17 '05 #19

P: n/a

"Amir Khawaja" <am**@gorebels.net> wrote in message
news:y5HPb.56603$zs4.37656@fed1read01...
Tony Marston wrote:
"Savut" <we***@hotmail.com> wrote in message
news:UE*********************@news20.bellglobal.com ...
PHP is not fully OO, even the PHP5... but Java is OO
Not according to some people as it does not support multiple

inheritance.
Multiple inheritance can be problematic and is not a staple of OOP.


Which is precisely why it was left out of Java, and also left out of PHP 5.

Tony Marston
http://www.tonymarston.net/
Jul 17 '05 #20

P: n/a
Agelmar wrote:
Bruno Desthuilliers wrote:
Savut wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.googl e.com...
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

>> PHP is not fully OO, even the PHP5... but Java is OO

As there is *no* commonly accepted definition of OO, I just dont
understand how you can claim such a thing.

BTW, Smalltalkers could tell you why Java is not OO !-)

Actually, there is a commonly accepted definition...
OO implies:
polymorphism, encapsulation, and inheritance.


Not so commonly accepted...
inheritence have two meanings :
- type/interface inheritence, which is about subtyping
- implementation inheritence, which is about code reuse

The first one doesn't make sens in a dynamically-typed language nor in
statically-typed-with-type-inference language (like OCaml). So it is
only useful for 'rigidly-typed' languages like Java and C++ - which BTW
are not 'pure' OOPLs (if this has any meaning) since they have
'non-object' types.

The second one is handy for code-reuse but can - and in many cases would
better - be replaced by composition/delegation.

Encapsulation largely predates OO and is of common use in procedural
(never wrote an ADT in C ?) and functional languages (ever heard of
closures ?).

Polymorphism is also independant of OO, and exists in procedural and/or
functional languages too.

So much for your 'commonly accepted definition', which doesnt define
anything IMHO : I just can't see how anyone could connect this with the
concept of objects that did not ever mentionned.

But dont take it wrong, I agree that these 3 concepts are commonly used
in OO and do have a meaning in a somewhat wider perspective.

What strikes me is that you missed the 2 real key points : objects, and
message passing with dynamic dispatch. OO is mostly and primarily about
things that we call 'objects' that have state and send messages to each
others. How some particular object react to a message depends on its
particular behavior and state.

And now this brings back the notions of encapsulation (each object carry
it's own state) and polymorphism (two different object can accept the
same message, each one reacting in it's own way).

The concept of 'type' could then be defined by the LSP : two objects
that accepts the same messages are of the same type. And the notion of
class could be defined in an almost mathematic way : a class is the set
of objects that a/ are of the same type and b/ have the same behavior
(which usually implies having the same internal structure when it comes
to implementation).

Note that inheritance has no particular meaning wrt this definition, and
so is only a code reuse facility in a dynamically typed language and a
'necessary evil' (no flame please) to support dynamic dispatch of
messages (ie polymorphism) in rigidly-typed languages.

<disclaimer>
Please note also that I would never pretend this definition being the
One And Only Revealed Truth(tm) about OO !-)
<disclaimer/>

My 2 cents...
Bruno
Jul 17 '05 #21

P: n/a
Amir Khawaja wrote:
Daniel Tryba wrote:
Savut <we***@hotmail.com> wrote:
PHP is not fully OO, even the PHP5... but Java is OO
But even java isn't fully OO. PHP is OO, just like javascript is OO to
some degree.


PHP4 has some OOP support. PHP5 has better OOP support. JavaScript is
not really OO since it uses anonymous functions to define methods.


And ? Why would this make Javascript less OO ?
(BTW, note that you can also use named functions to define methods).
Not
to mention, inheritance can be tricky in JavaScript.


For sure, unless you have a good grasp on prototype-based OOPLs !-).

But since Javascript is dynamically typed, inheritence is not needed to
support polymorphism and thus is nothing more than a code-reuse
facility, so it does not affect the 'OOness' of Javascript IMHO.

Bruno

Jul 17 '05 #22

P: n/a
Amir Khawaja wrote:
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

If you've ever had training in software development, then you would not
be asking this question.

A very useful answer. Thanks for your contribution.


Jul 17 '05 #23

P: n/a
Javascript is not at all OO because there is no concept of private and
public variable method, metamorphis and object inherence. You guys are real
newbs in programming to say so. When I said Java I mean Java like JSP not
Javascript.

Savut

"Bruno Desthuilliers" <bd*****************@free.quelquepart.fr> wrote in
message news:40**********************@news.free.fr...
Amir Khawaja wrote:
Daniel Tryba wrote:
Savut <we***@hotmail.com> wrote:

PHP is not fully OO, even the PHP5... but Java is OO

But even java isn't fully OO. PHP is OO, just like javascript is OO to
some degree.


PHP4 has some OOP support. PHP5 has better OOP support. JavaScript is
not really OO since it uses anonymous functions to define methods.


And ? Why would this make Javascript less OO ?
(BTW, note that you can also use named functions to define methods).
Not
to mention, inheritance can be tricky in JavaScript.


For sure, unless you have a good grasp on prototype-based OOPLs !-).

But since Javascript is dynamically typed, inheritence is not needed to
support polymorphism and thus is nothing more than a code-reuse
facility, so it does not affect the 'OOness' of Javascript IMHO.

Bruno

Jul 17 '05 #24

P: n/a
Savut wrote:
Javascript is not at all OO because there is no concept of private and
public variable method, metamorphis and object inherence.


The only things that you need for OO are objects/classes that can have
methods and properties. PHP4 has all those, as does Javascript.

(Strictly OT and just out of interest: What are "metamorphis" and
"inherence"? How do they relate to the concepts of polymorphism and
inheritance?)

Jochen
Jul 17 '05 #25

P: n/a
Amir Khawaja <am**@gorebels.net> wrote in message news:<R9HPb.56604$zs4.43705@fed1read01>...
Daniel Tryba wrote:
Savut <we***@hotmail.com> wrote:
PHP is not fully OO, even the PHP5... but Java is OO

But even java isn't fully OO. PHP is OO, just like javascript is OO to
some degree.


PHP4 has some OOP support. PHP5 has better OOP support. JavaScript is
not really OO since it uses anonymous functions to define methods. Not
to mention, inheritance can be tricky in JavaScript.


Java Script is has full OO support. Maybe the class less
implementation is different then what you think. A system that has
more then only OO features can always be called real OO.

But 'real' OO is a pure marketing slogan. Maybe pure'ness is far from
being a good.
Jul 17 '05 #26

P: n/a
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message news:<bu*******************@news.demon.co.uk>...

Which is precisely why it was left out of Java, and also left out of PHP 5.


No because they were to lazy to provide a good multiple inheritance
implementation like eiffel has. Java is a hacked language and not
technically a good one - no matter how many people use it.
Jul 17 '05 #27

P: n/a
Savut wrote:
(please don't top-post. Corrected)
"Bruno Desthuilliers" <bd*****************@free.quelquepart.fr> wrote in
message news:40**********************@news.free.fr...
Amir Khawaja wrote:
Daniel Tryba wrote:
Savut <we***@hotmail.com> wrote:
>PHP is not fully OO, even the PHP5... but Java is OO

But even java isn't fully OO. PHP is OO, just like javascript is OO to
some degree.
PHP4 has some OOP support. PHP5 has better OOP support. JavaScript is
not really OO since it uses anonymous functions to define methods.
And ? Why would this make Javascript less OO ?
(BTW, note that you can also use named functions to define methods).

Not
to mention, inheritance can be tricky in JavaScript.


For sure, unless you have a good grasp on prototype-based OOPLs !-).

But since Javascript is dynamically typed, inheritence is not needed to
support polymorphism and thus is nothing more than a code-reuse
facility, so it does not affect the 'OOness' of Javascript IMHO.

Javascript is not at all OO because there is no concept of private and
public variable method,
You forgot 'protected' !-)

But this is *absolutely not* needed for a language to support OO.
metamorphis
Never heard of this word...

Oh, you meant "polymorphism" ?
So you're plain wraong. Javascript support polymorphism, as any
dynamically typed OOPL.
and object inherence. I suppose you mean "inheritance" ?

Fisrt thing is that Javascript does support inheritence, since in a way
that may be somewhat special for someone that doesn't grasp the
prototype-based OO paradigm.

The second thing is that, except for polymorphism support in
'rigidly-typed'[1] languages like C++ or Java, inheritance is by no mean
necessary to OO*P* (it's a different thing when it comes to OOA/OOD).

[1] which is a shortcut for 'statically typed with no type inference
mechanism', not a value judgement.
You guys are real
newbs in programming to say so.


Er... Well, it's true that even if I started programming (for fun) in
1990, I'm only a professionnal programmer since late 1999, so one could
say I'm still a newbie.

Now, on the basis of your writing, I'd suggest that learning more about
OO, it's history, and languages like Smalltalk, CLOS, Ruby and Io would
be a good idea...
When I said Java I mean Java like JSP not
Javascript.


I use Java and Javascript since 1999, so be assured that I do know the
difference between the two languages.

Regards
Bruno

Jul 17 '05 #28

P: n/a
Lothar Scholz wrote:
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:<bu*******************@news.demon.co.uk>...

Which is precisely why it was left out of Java, and also left out of PHP
5.


No because they were to lazy to provide a good multiple inheritance
implementation like eiffel has. Java is a hacked language and not
technically a good one - no matter how many people use it.


Lothar,

Do you actually use Java?
Are you an experienced Javaprogrammer?
I ask this because you would be the first person I meet who actually uses
Java, understand the language, AND doesn't like it.

I heard people complain a lot on a lot of languages, often with good
arguments, but the only complaint about Java I heard is a steep
learningcurve in the beginning.
Most complaint about Java from programmers comes from C++ programmers, who
miss their precious functionpointers.

In my opinion Java is a great language, you guessed that probably.

I have to admit I do not know eiffel, so maybe you are just completely right
and I am wrong. But I just had to make a stand for Java here. :P

Regards,
Erwin Moller
Jul 17 '05 #29

P: n/a
Amir Khawaja wrote:
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.


Amir,

Judging by the number of interesting posts in this thread, I think things
might be a bit more complicated.

I like this discussion a lot, because I use both languages and like them
both.

I also find your posting a bit out-of-sync with your (excellent) signature:
"Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason."

Regards,
Erwin Moller
Jul 17 '05 #30

P: n/a

"Agelmar" <if**********@comcast.net> wrote in message news:bu************@ID-30799.news.uni-berlin.de...
Bruno Desthuilliers wrote:
Savut wrote:
"Jerry" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...

What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

>> PHP is not fully OO, even the PHP5... but Java is OO


As there is *no* commonly accepted definition of OO, I just dont
understand how you can claim such a thing.

BTW, Smalltalkers could tell you why Java is not OO !-)


Actually, there is a commonly accepted definition...
OO implies:
polymorphism, encapsulation, and inheritance.

Not to beat a dead horse (or a live one for that matter) but WHAT IS OOP?

Object Oriented Programming

That is what it is. Everything else is just fluff. You can design and program OOP with just about any language - even BASIC. It's
all in your design and discipline.

If you never publish a class do you need to have public/private parts to it? No. Would a comment be suffice? i.e.

class example
{
//Private
var m_dontUse
var m_dangerousToUse
var m_topSecret

//Public
var m_safeToUse
var m_okayToUse
var m_useMe
}

This works fine if you trust your programmers and they are disciplined enough to only use what they are "allowed" to use.

What if you release a library - if the documentation only lists the pubic members then why isn't that suffice - again if you trust
the programmers.

The point is that there is a disconnect between OOPL and OOP/OOD. Do you REALLY need C++ to do OO when you have C?

Let's not forget that C++ compilers used to be PRE-processors - they generated C code.

There is no doubt that OOPL are more convenient to use (though I was criticized in an earlier OT message for suggesting a language
construct just for convenience) the point is that OOP is about the paradigm of building your code based on real-world objects. It
has nothing to do with whether a language allows you to do some neat trickery.
-CF

Jul 17 '05 #31

P: n/a

"Amir Khawaja" <am**@gorebels.net> wrote in message news:3eHPb.56607$zs4.20188@fed1read01...
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.


That was one of the most egotistical and condescending answers I have read on this news group yet. Exactly how does that help anyone
here or in the future. If you didn't like the question - don't answer it.

I would also argue that by judging the number conversations and posts that have resulted in this question, that we need more like
it.

-CF
Jul 17 '05 #32

P: n/a

"Erwin Moller" <si******************************************@spam yourself.com> wrote in message
news:40*********************@news.xs4all.nl...
Lothar Scholz wrote:
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:<bu*******************@news.demon.co.uk>...

No because they were to lazy to provide a good multiple inheritance

implementation like eiffel has. Java is a hacked language and not
technically a good one - no matter how many people use it.


Lothar,

Do you actually use Java?
Are you an experienced Javaprogrammer?
I ask this because you would be the first person I meet who actually uses
Java, understand the language, AND doesn't like it.

I heard people complain a lot on a lot of languages, often with good
arguments, but the only complaint about Java I heard is a steep
learningcurve in the beginning.
Most complaint about Java from programmers comes from C++ programmers, who
miss their precious functionpointers.

Well here's one who has experience with Java and still doesn't like it. You were half right though - I am a C++ programmer, but it
has nothing to do with function pointers.

I don't like it because I feel like it's a encapsulation gone bad:

some.simple.functions.requires.knowing.too.many.cl asses.just.to.print("hi");

Further more there is way to much involved for deployment - though I admit that those issues have more to with JSP/Tomcat than Java
itself.

I certainly wouldn't call it a "hack" but the learning curve is steep and I just could never get comfortable with it. From a
business perspective I would immediately put it on the bottom of my list in language selection. Training is costly, maintenance is
costly, configuration is costly. And what does it buy you? A very solid system that is platform independent - if it is ever
finished.

The reason why I like PHP so much is that it just seems to work. My mind flows right along with it. Again from a business
perspective it means rapid development. You get near-platform independence. It's cheap to learn, it's cheap to deploy, and it's
cheap to maintain. Oh, and just to stay on topic, it's OO!

-CF
Jul 17 '05 #33

P: n/a
Savut <we***@hotmail.com> wrote:
Javascript is not at all OO because there is no concept of private and
public variable method, metamorphis and object inherence. You guys are real
newbs in programming to say so. When I said Java I mean Java like JSP not
Javascript.

[snipped 35 lines: please don't TOFU]

So java is not entirly OO either? Afterall with reflection one can
manipulate private/protected members from anywhere (depending on the
securitymanager).

--

Daniel Tryba

Jul 17 '05 #34

P: n/a
In article <bu*******************@news.demon.co.uk>, Tony Marston wrote:

"Dave Benjamin" <ra***@lackingtalent.com> wrote in message
news:slrnc0v21b.pop.ra***@lackingtalent.com...
In article <bu************@ID-30799.news.uni-berlin.de>, Agelmar wrote:
> Bruno Desthuilliers wrote:
>> Savut wrote:
>>> "Jerry" <we******@nova.edu> wrote in message
>>> news:69**************************@posting.google.c om...
>>>


<snip>
But there's one thing for sure: OO == good. So, start with "good" and
extrapolate "OO". It's much easier. =)


I disagree entirely. You are implying that if it is OO then it must be good,
and if it is not OO then it must be bad.


Good. I was being sarcastic. ;)

--
..:[ dave benjamin (rameny sp00) -:- spoomusic.com -:- ramenfest.com ]:.
: d r i n k i n g l i f e o u t o f t h e c o n t a i n e r :
Jul 17 '05 #35

P: n/a
Erwin Moller <si******************************************@spam yourself.com> wrote in message news:<40*********************@news.xs4all.nl>...
Amir Khawaja wrote:
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.


Amir,

Judging by the number of interesting posts in this thread, I think things
might be a bit more complicated.

I like this discussion a lot, because I use both languages and like them
both.


I think, Amir is right to some extent. It is really irritating if
*programmers* ask what is best among the two *without* actually trying
them. It is also real unfortunate to see people _pushing_ their own
ideas by quoting their years of experience to win the discussion. It
is also sad thing to see, such trolls are often encouraged in this
c.l.p which is not common among other groups say c.l.c or c.l.j

Personally I liked the discussion 'coz I tried both of them as
you. But, IMHO, it is wrong to ecourage such never tried people's
query.

p.s.: This is *no* rant; this is just my personal opinion. Obviously,
YMMV

--
"We live to die; We die to live"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #36

P: n/a
ChronoFish wrote:
"Amir Khawaja" <am**@gorebels.net> wrote in message news:3eHPb.56607$zs4.20188@fed1read01...
Jerry wrote:

What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.

That was one of the most egotistical and condescending answers I have read on this news group yet. Exactly how does that help anyone
here or in the future. If you didn't like the question - don't answer it.

I would also argue that by judging the number conversations and posts that have resulted in this question, that we need more like
it.

-CF


ChronoFish,

Yes, admittedly, that response is a little condescending. However, it
was made to point out to the original author that the question is
severely flawed. It was not meant to be mean spirited in any way or
form. I decided to be blunt as opposed to be politically correct.

--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #37

P: n/a
Erwin Moller wrote:
Amir Khawaja wrote:

Jerry wrote:

What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.

Amir,

Judging by the number of interesting posts in this thread, I think things
might be a bit more complicated.

I like this discussion a lot, because I use both languages and like them
both.

I also find your posting a bit out-of-sync with your (excellent) signature:
"Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason."

Regards,
Erwin Moller


Erwin,

Indeed it is out of sync. It was intentional. Please see my response to
ChronoFish's post.

--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #38

P: n/a
Bruno Desthuilliers wrote:
Amir Khawaja wrote:
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would
not be asking this question.

A very useful answer. Thanks for your contribution.


You're welcome :P

--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #39

P: n/a
it was over a year ago but i seem to remember php objects could get
messy when applying functions to groups of them where javas containers
have been fairly cute for two or three years - its just time as things
are added - but when java first grew it was all about the buzz - and
it seems php has definitely got it now - so bring on the future for
the pair
Jul 17 '05 #40

P: n/a
Jerry:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


After years of argument and fighting it should be fairly evident that there
is no clear definition of what OO really is. However, the invention of "OO"
brought several nice features into the world of programming, what features
you decide to use is really up to you and the problem at hand. Also,
different languages have chosen different sets of features, and of course
the developers of the different languages are going to fight over what
features are the most OO. But in the end, nobody knows what OO is because
there exists no clear definition as for example the definition of the
relational model.

If you're going to use a language you must use the language to the max. If
you choose PHP you shouldn't confine yourself to using only the "OO"
features of PHP, that would be insane, in Java you're forced to do that,
you're forced to use one style of programming. So why compare the OO
features of PHP vs. Java? What you should do is look at what you want to
achieve, and decide which of PHP or Java seems more approriate.

A language should be chosen because it fits the problem at hand. I think
most programming tasks today can be solved with languages like PHP, Perl,
Python and Ruby rather than the low-level dinosaurs like C++ and Java,
which one you choose should be dictated by past experience as well as the
task at hand, these are after all languages with different strengths and
weaknesses. I believe generality always comes at a price, sure C++ can be
used for everything, but PHP is much faster to use when all you want is to
generate a few simple webpages.

I think we will see more and more of this. Programming languages should be
viewed as tools, and while it is probably possible to solve every problem
with the same tool, it makes much more sense to choose specialized tools
that makes solving the problem easier.

I also think it's a good thing to keep learning new languages even if you
don't need to, it opens your eyes to different ways of doing things, and
the more techniques you know the more aptly you can operate as a craftsman.
Whenever you are faced with a novel problem you have a much vaster body of
knowledge to draw from. If you're stuck with one language and the
aforementioned problem can't be solved with any of the well known idioms of
your pet language you might be stuck. If you know more languages you might
just know that this sort of problem is frequently tackled by language X.

André Nęss
Jul 17 '05 #41

P: n/a
Erwin Moller <si******************************************@spam yourself.com> wrote or quoted:
Lothar Scholz wrote:
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
Which is precisely why it was left out of Java, and also left out of PHP
5.


No because they were to lazy to provide a good multiple inheritance
implementation like eiffel has. Java is a hacked language and not
technically a good one - no matter how many people use it.


Lothar,

Do you actually use Java?
Are you an experienced Javaprogrammer?
I ask this because you would be the first person I meet who actually uses
Java, understand the language, AND doesn't like it.


Get out more.

Java has a fudged primitive type system, lacks named function
arguments, enumerations, doesn't have generic types yet, is
proprietary Sun microsystems technology - and is full of fudges.

It's better than C++, Javascript and PHP - but that's not saying much.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #42

P: n/a
Your duplicitous nature leads me to believe
you are always seeking to put someone down
for something or else you are a control freak.

You say that response is 'a little' condescending.

How is it that this single question has generated
so MUCH healthy response?

How then could the question be 'severely flawed'
as you bluntly write.

In this case, if you have any face left (covered with
egg by now) you should retract your arrogrance.

Do you have the guts to do it?

The author
"Amir Khawaja" <am**@gorebels.net> wrote in message
news:B73Qb.43502$Ar1.5202@fed1read04...
ChronoFish wrote:
"Amir Khawaja" <am**@gorebels.net> wrote in message news:3eHPb.56607$zs4.20188@fed1read01...
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?

If you've ever had training in software development, then you would not
be asking this question.

That was one of the most egotistical and condescending answers I have read on this news group yet. Exactly how does that help anyone here or in the future. If you didn't like the question - don't answer it.
I would also argue that by judging the number conversations and posts that have resulted in this question, that we need more like it.

-CF


ChronoFish,

Yes, admittedly, that response is a little condescending. However, it
was made to point out to the original author that the question is
severely flawed. It was not meant to be mean spirited in any way or
form. I decided to be blunt as opposed to be politically correct.

--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan

Jul 17 '05 #43

P: n/a
Where did all the assumption arise that
the author has 'never tried programming'

This is complete arrogrance on your part.

Needless to say, in the community of programmers,
there is arrogance just as there in every other
walk of life....
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:ab**************************@posting.google.c om...
Erwin Moller

<si******************************************@spam yourself.com> wrote in
message news:<40*********************@news.xs4all.nl>...
Amir Khawaja wrote:
Jerry wrote:

> What are the advantages and disadvantages of using Object Oriented
> PHP vs Java?

If you've ever had training in software development, then you would not be asking this question.


Amir,

Judging by the number of interesting posts in this thread, I think things might be a bit more complicated.

I like this discussion a lot, because I use both languages and like them
both.


I think, Amir is right to some extent. It is really irritating if
*programmers* ask what is best among the two *without* actually trying
them. It is also real unfortunate to see people _pushing_ their own
ideas by quoting their years of experience to win the discussion. It
is also sad thing to see, such trolls are often encouraged in this
c.l.p which is not common among other groups say c.l.c or c.l.j

Personally I liked the discussion 'coz I tried both of them as
you. But, IMHO, it is wrong to ecourage such never tried people's
query.

p.s.: This is *no* rant; this is just my personal opinion. Obviously,
YMMV

--
"We live to die; We die to live"
Email: rrjanbiah-at-Y!com

Jul 17 '05 #44

P: n/a
Would you like to see some of my software development? Or is that a
question from
someone who has no training in such a discipline?

Did you start Sun Microsystems of something?
"Amir Khawaja" <am**@gorebels.net> wrote in message
news:3eHPb.56607$zs4.20188@fed1read01...
Jerry wrote:
What are the advantages and disadvantages of using Object Oriented
PHP vs Java?


If you've ever had training in software development, then you would not
be asking this question.
--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan

Jul 17 '05 #45

P: n/a
bdjw wrote:
Your duplicitous nature leads me to believe
you are always seeking to put someone down
for something or else you are a control freak.

You say that response is 'a little' condescending.

How is it that this single question has generated
so MUCH healthy response?

How then could the question be 'severely flawed'
as you bluntly write.

In this case, if you have any face left (covered with
egg by now) you should retract your arrogrance.

Do you have the guts to do it?

The author


Duplicitous? That is such a strong word to use since I do not know you
personally. I am far from being such an individual. As a matter of fact,
I pride myself in being an upstanding, generous, and helpful citizen.
For you to accuse me of being a deceitful person shows the
characteristics you possess within you. First and foremost, one should
always be open to criticism. As I can see from your harsh remarks, you
do not take to commentary as well. My remark was neither crude nor
judgmental.
--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #46

P: n/a
bdjw wrote:
Would you like to see some of my software development? Or is that a
question from
someone who has no training in such a discipline?

Yes, I do have formal training in software development.

Did you start Sun Microsystems of something?


No, I did not start Sun Microsystems.

--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan
Jul 17 '05 #47

P: n/a
[top-post fixed]

"bdjw" <je*************@earthlink.net> wrote in message news:<%g******************@newsread2.news.pas.eart hlink.net>...
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:ab**************************@posting.google.c om...
Erwin Moller <si******************************************@spam yourself.com> wrote in
message news:<40*********************@news.xs4all.nl>...
Amir Khawaja wrote:

> Jerry wrote:
>
>> What are the advantages and disadvantages of using Object Oriented
>> PHP vs Java?
>
> If you've ever had training in software development, then you would not > be asking this question.
>
>

Amir,

Judging by the number of interesting posts in this thread, I think things might be a bit more complicated.

I like this discussion a lot, because I use both languages and like them
both.


I think, Amir is right to some extent. It is really irritating if
*programmers* ask what is best among the two *without* actually trying
them. It is also real unfortunate to see people _pushing_ their own
ideas by quoting their years of experience to win the discussion. It
is also sad thing to see, such trolls are often encouraged in this
c.l.p which is not common among other groups say c.l.c or c.l.j

Personally I liked the discussion 'coz I tried both of them as
you. But, IMHO, it is wrong to ecourage such never tried people's
query.

p.s.: This is *no* rant; this is just my personal opinion. Obviously,
YMMV

Where did all the assumption arise that
the author has 'never tried programming'
'coz the question is complete moronic and vague. Read the response
for your questions from some good regulars. I could also see your post
(even better version of this) in comp.lang.java.developer which never
attracted those people.
This is complete arrogrance on your part.

Needless to say, in the community of programmers,
there is arrogance just as there in every other
walk of life....


I think, you have poor eye sight to read what I said. Anyway, if you
took it arrogrance, I don't mind.

--
"We live to die; We die to live"
Email: rrjanbiah-at-Y!com
Jul 17 '05 #48

P: n/a

"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:ab**************************@posting.google.c om...
[top-post fixed]

"bdjw" <je*************@earthlink.net> wrote in message news:<%g******************@newsread2.news.pas.eart hlink.net>...
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:ab**************************@posting.google.c om...
Erwin Moller

<si******************************************@spam yourself.com> wrote in
message news:<40*********************@news.xs4all.nl>...
> Amir Khawaja wrote:
>
> > Jerry wrote:
> >
> >> What are the advantages and disadvantages of using Object Oriented > >> PHP vs Java?
> >
> > If you've ever had training in software development, then you would
not
> > be asking this question.
> >
> >
>
> Amir,
>
> Judging by the number of interesting posts in this thread, I think

things
> might be a bit more complicated.
>
> I like this discussion a lot, because I use both languages and like
them > both.

I think, Amir is right to some extent. It is really irritating if
*programmers* ask what is best among the two *without* actually trying
them. It is also real unfortunate to see people _pushing_ their own
ideas by quoting their years of experience to win the discussion. It
is also sad thing to see, such trolls are often encouraged in this
c.l.p which is not common among other groups say c.l.c or c.l.j

Personally I liked the discussion 'coz I tried both of them as
you. But, IMHO, it is wrong to ecourage such never tried people's
query.

p.s.: This is *no* rant; this is just my personal opinion. Obviously,
YMMV

Where did all the assumption arise that
the author has 'never tried programming'


'coz the question is complete moronic and vague.

Pretty strong and judgmental reaction, especially given
the other responders (41 posts!)
You just want to keep this silly pseudo flame going
coz you're bored.
See ya'

Read the response for your questions from some good regulars. I could also see your post
(even better version of this) in comp.lang.java.developer which never
attracted those people.


Those people have not responded to almost all of the
most recent posts lately, not just this one.
This is complete arrogrance on your part.

Needless to say, in the community of programmers,
there is arrogance just as there in every other
walk of life....


I think, you have poor eye sight to read what I said. Anyway, if you
took it arrogrance, I don't mind.

--
"We live to die; We die to live"
Email: rrjanbiah-at-Y!com

Jul 17 '05 #49

P: n/a

"Amir Khawaja" <am**@gorebels.net> wrote in message
news:T5kQb.43609$Ar1.21930@fed1read04...
bdjw wrote:
Your duplicitous nature leads me to believe
you are always seeking to put someone down
for something or else you are a control freak.

You say that response is 'a little' condescending.

How is it that this single question has generated
so MUCH healthy response?

How then could the question be 'severely flawed'
as you bluntly write.

In this case, if you have any face left (covered with
egg by now) you should retract your arrogrance.

Do you have the guts to do it?

The author

Duplicitous? That is such a strong word to use since I do not know you
personally. I am far from being such an individual. As a matter of fact,
I pride myself in being an upstanding, generous, and helpful citizen.


So do I.
For you to accuse me of being a deceitful person shows the
characteristics you possess within you. And you are not possessing of being open to criticism?

First and foremost, one should always be open to criticism. As I can see from your harsh remarks, you
do not take to commentary as well. My remark was neither crude nor
judgmental.
REally, not blunt? Why were you the only one who
reacted that way ( besides your R. Rajesh Jeba Anbiah)
Somethings amiss here....

I simply have never done OO PHP. I have done alot
of Java programming. Are you so high and mighty that
you can't lower yourself to the level of those "below"
your level of expertise?
Maybe you're too good for this forum.


--
Amir Khawaja.

----------------------------------
Rules are written for those who lack the ability to truly reason, But
for those who can, the rules become nothing more than guidelines, And
live their lives governed not by rules but by reason.
- James McGuigan

Jul 17 '05 #50

54 Replies

This discussion thread is closed

Replies have been disabled for this discussion.