473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

what percentage of propessional PHP developers use OOP?

Hi, ive been working with PHP for about a year and a half now, and
have always been able to do everything i need with procedural code and
a nice UD function include.

However, i have always worked for myself (freelance) on my projects
and never in a developmental job but was thinking of changing this.

Is it likely that i will have to start coding using OOP to fit in?
Cheers.

Jun 27 '07 #1
5 3019
macca wrote:
Hi, ive been working with PHP for about a year and a half now, and
have always been able to do everything i need with procedural code and
a nice UD function include.

However, i have always worked for myself (freelance) on my projects
and never in a developmental job but was thinking of changing this.

Is it likely that i will have to start coding using OOP to fit in?
Who knows. Do they expect you to be a master at OOP?

You don't need OOP to be a good, clean PHP programmer.
But you must be able to implement other people's classes. SO you need to kow
at least how to USE classes, even if you don't design them yourself.

Re-use of code:
An advantage of bundling your code into classes is that it is slightly
cleaner than a bunch of functions, but not much. (in my opinion)
You can make classes that hold certain functionality you need often.
But then again, you can make a few functions with similar functionality, and
bundle them too.
So that is mainly a matter of taste/experience.

On the other hand: If you take that developmental job, why not take the
oppertunity to broaden your horizons and dive straight into OOP?
PHP's implementation of OOP is very straightforward.
In my opinion they took the good bits of Java, and left the unneeded
complicated stuff out.
So if you go OOP, PHP is a nice start (version 5 of course, not 4).

Just my 2 cent.
Good luck.

Regards,
Erwin Moller
>

Cheers.
Jun 27 '07 #2
On 27.06.2007 15:15 Erwin Moller wrote:
>
Lets forget about it. I shouldn't write while irritated. ;-)

[Erwin offers a beer.]

Regards,
Erwin Moller

Ok, peace. ;)))

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Jun 27 '07 #3
Thanks for the input guys,

I can see the appeal of OOP in some situations, such as re-usability
of code, class libraries and such,

I have once or twice i actually tried it out (for curiosity mostly)
however i cant help but think that it takes l-o-n-g-e-r to code in OOP
and in situations where i have deadlines to meet i can bang out the
required code using proc code and functions (just as portable/re-
usable in my oppinion) faster.

Now before someone jumps in and says "yes, its slower at first but
it's re-usable code" - so are functions.

Ive also read somewhere that an OOP php script actually executes
slower than proc. Yet another factor that could potentially put me
off.

Not to mention the complexity of OOP over proc (i'm not saying that i
can't do it, just that Im a busy man and its not something you learn
overnight).
Still, if everyone else is doing it I'd better jump on the band waggon
or get left behind.

It wouldnt be good if I got that first pro PHP dev job and was asked
to do

"Something nice and easy for your first day - just finish off this
class for us will ya?"

Ha ha!

Suppose I would have learned it all in the end anyway - may as well be
sooner rather than than later!

Jun 27 '07 #4
I'm earning my cents mostly by programming java atm, but do a lot of
php as well. The reason I like PHP OOP, is that you can use PHP OOP
where it's useful, and procedural code where it's useful. So you can
efficiently mix these two, which IMHO is the power of PHP OOP.

I do like a lot of OOP, and started to think, if EVERYTHING in PHP
would need to be done OOP ... what a nightmare.

--
Jussi

Deep abstraction kills strong typing.

http://disczero.com
http://naamio.net
http://hoffburger.com

Jun 28 '07 #5
On Jun 27, 2:19 am, macca <ptmcna...@googlemail.comwrote:
Hi, ive been working with PHP for about a year and a half now, and
have always been able to do everything i need with procedural code and
a nice UD function include.

However, i have always worked for myself (freelance) on my projects
and never in a developmental job but was thinking of changing this.

Is it likely that i will have to start coding using OOP to fit in?

Cheers.
I love to use OOP in my PHP projects because I believe in separating
logic from design and an OOP approach really helps.

A lot of PHP frameworks use an MVC design pattern and without OOP this
would not be easily accomplished.

It is much easyer to debug JUST php or JUST html/css with a little php
in it then a mish mash of html and php.

Just my 2 cents. :)

Jun 30 '07 #6

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

Similar topics

7
by: Conax | last post by:
Hello, This is actually a general programming question but I don't know which newsgroup best to put it so please pardon me. I've always been looking for the best way to get an accurate...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
2
by: thomasamillergoogle | last post by:
I am going to be distributing a shareware application soon and would like to know what percentage of MS OS machines have the framework installed. I have looked in multiple places (google,...
22
by: Les Juby | last post by:
I am trying to adjust the window/table size of a website (www.worklaw.co.za) which has made use of DIV tags with its settings embedded in an CSS file. The client wants its width and height to...
5
by: yezi | last post by:
HI , all : I want to control the event gap onto microsecond level , so I called the function : nanosleep(&req, &req); according to the description of this function, I should set the ...
0
by: fake ID | last post by:
Since you can't search for these symbols used in asp.net "<%#" or '<%=' I thought i'd post this to make things a little easier to find. Potential search word combinations: -lessthan Percentage...
133
by: Alan Silver | last post by:
Hello, Just wondered what range of browsers, versions and OSs people are using to test pages. Also, since I don't have access to a Mac, will I have problems not being able to test on any Mac...
39
by: VidTheKid | last post by:
THE PROBLEM The % symbol is too vague when defining dimensions in CSS and HTML. It can relate to an inherited value, a measure of the containing element (which can differ between box models) or...
4
by: Micheal | last post by:
Greetings Access Group, Being relatively new to Access, I try to work through problems on my own and have been very successful, although I have a conundrum that I have been working on for two days...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.