473,574 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Oriented PHP vs Java

What are the advantages and disadvantages of using Object Oriented
PHP vs Java?
Jul 17 '05
54 8936
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
Tony Marston wrote:
"Jerry" <we******@nova. edu> wrote in message
news:69******** *************** ***@posting.goo gle.com...
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
Bruno Desthuilliers wrote:
Savut wrote:
"Jerry" <we******@nova. edu> wrote in message
news:69******** *************** ***@posting.goo gle.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.
Jul 17 '05 #13
Tony Marston wrote:
"Savut" <we***@hotmail. com> wrote in message
news:UE******** *************@n ews20.bellgloba l.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.g oogle.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
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
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
The date was 21 Jan 2004 10:31:04 -0800, and we******@nova.e du (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
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.goo gle.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.


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 "informatio n
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

"Dave Benjamin" <ra***@lackingt alent.com> wrote in message
news:slrnc0v21b .pop.ra***@lack ingtalent.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.goo gle.com...

<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

"Amir Khawaja" <am**@gorebels. net> wrote in message
news:y5HPb.5660 3$zs4.37656@fed 1read01...
Tony Marston wrote:
"Savut" <we***@hotmail. com> wrote in message
news:UE******** *************@n ews20.bellgloba l.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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2264
by: Ville Vainio | last post by:
Pythonic Nirvana - towards a true Object Oriented Environment ============================================================= IPython (by Francois Pinard) recently (next release - changes are still in CVS) got the basic abilities of a system shell (like bash). Actually, using it as a shell is rather comfortable. This all made me think... ...
34
7058
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. Yensao
11
9230
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
10
4964
by: bpontius | last post by:
The GES Algorithm A Surprisingly Simple Algorithm for Parallel Pattern Matching "Partially because the best algorithms presented in the literature are difficult to understand and to implement, knowledge of fast and practical algorithms is not commonplace." Hume and Sunday, "Fast String Searching", Software - Practice and Experience,...
5
3581
by: KimmoA | last post by:
Does C have a future? I'd like to think so, but nobody seems to agree with me. Of course, I don't use C in my profession, and maybe I wouldn't be using it if I had the pressure to actually produce things with deadlines and stuff. Hmm. That's a depressing thought. I can't stand OOP. Yes, it is beautiful in theory, and it might make sense for...
46
2991
by: ajba74 | last post by:
Hi fellows, I am reading some books to learn the C programming language, and sometimes I have the feeling that when somebody becomes a C expert, he must learn a more modern and object-oriented language. When I read things like "... C++ is an evolution of C ..." or "... C is a subset of C++ ..." I tend to believe that I will have to learn...
14
1441
by: Summercool | last post by:
The meaning of a = b in object oriented languages. ==================================================== I just want to confirm that in OOP, if a is an object, then b = a is only copying the reference. (to make it to the most basic form: a is 4 bytes, let's say, at memory location 0x10000000 to 0x10000003
139
5870
by: Joe Mayo | last post by:
I think I become more and more alone... Everybody tells me that C++ is better, because once a project becomes very large, I should be happy that it has been written in C++ and not C. I'm the only guy thinking that C is a great programming language and that there is no need to program things object oriented. Many people says also that they...
3
1536
by: notnorwegian | last post by:
i have some confusion over this. sure a class is basically a classification, like for example an animal or flower. and an object/instance of that class is then for example a cat. an object is an instance of a class. that i know, i also know how to program with classes etc. i am just confused about the term object-oriented.
0
7831
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8262
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8129
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6497
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5641
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2258
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1364
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.