what percentage of propessional PHP developers use OOP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • macca

    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.

  • Erwin Moller

    #2
    Re: what percentage of propessional PHP developers use OOP?

    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.

    Comment

    • gosha bine

      #3
      Re: what percentage of propessional PHP developers use OOP?

      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

      Comment

      • macca

        #4
        Re: what percentage of propessional PHP developers use OOP?

        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!

        Comment

        • jussist@gmail.com

          #5
          Re: what percentage of propessional PHP developers use OOP?

          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.


          This domain name has been registered with Gandi.net. It is currently parked by the owner.



          Comment

          • peterdi@gmail.com

            #6
            Re: what percentage of propessional PHP developers use OOP?

            On Jun 27, 2:19 am, macca <ptmcna...@goog lemail.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. :)

            Comment

            Working...