Jump to content


Photo

PHP OOP Rant / Good PHP IDE


  • Please log in to reply
5 replies to this topic

#1 JustinK101

JustinK101
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego, California, US

Posted 26 May 2006 - 07:52 AM

Hello all,

Firstly, let me say I have been programming web applications using php/mysql for about three years now. PHP is a great language, though I honestly can't see how in the world they can call it Object Oriented.

Example number one:
Almost every freaken method takes parameters variables which the method is acting on. Really makes it confusing and honestly ugly. Examples:

substr($string, 0, 1);
array_push($array, $value);

Is it me, or if PHP were OO shouldnt it be: $string->substr(0,1); and $array->push($value);

By the way, what's up with the ->, how about sticking with the dot like every other decent language.

Example number two:
Classes in php are just plain ugly. When you instanciate a new object like so, this is outside of any function:

$languageObject = new language();

Ok that's all fine and dandy, but if you want to use $languageObject in any methods/functions you have to define it global in the method. Hello, is it me, or is that repetitive as hell. I defined the object globally for a reason, and not in a function.

Example number three:
Ugly construction of classes. You have to call member variables var. Umm inst that implied, again not sure why. No ability to have constructor overloading. Wow, inst that a major componet of OO languages, overloaded functions.

PHP is solid, though I recently came across M$ Studio 2005 using ASP and C# and I must admit I really like design time interface and C# as a language dominates PHP. C# is very eligant and supports GET and SET methods which are very nice. C# is truely a OOP language.

The point of my rant, I find myself coding everything by hand, there must be a better resource. A good IDE that does HTML and PHP, and does syntax highlighting and supports the M$ equal of inti-sense. I just think it takes too long to do things in PHP by hand, I really want a GUI design tool that is effective. Oh by the way Dreamwaver doesnt count.

So, are there any GOOD IDE's for PHP, I have heard Eclipse has a plugin for PHP, but I have heard its not very good. I know there are some commerical products, but any decent free ones? Thanks!

#2 wisewood

wisewood
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts
  • LocationRotherham, England

Posted 26 May 2006 - 08:20 AM

You'd be better off putting your question at the top of the rant instead of the bottom, i cant see many people being bothered to read through that whole thing.

This is a PHP help forum, people come here to help and be helped, so sitting down and reading what is 99% rant about the short-comings of PHP wont appeal to most.
wisewood: proven fact, I am both wise, and wooden.

#3 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 26 May 2006 - 08:41 AM

I totally agree with wisewood....as far as your questions goes....Zend has a very good IDE for PHP....
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 26 May 2006 - 09:11 AM

Zend is a brillient IDE for php.

As for your rant on OOP in php. You speak of defining member variables with the var keyword, and the ability of C# to use GET and SET methods. Sounds to me like your whole review was based on php4. php5 has allot more OOP functionality.

And as for everything being an object. Not every OOP language works this way. If that where the case, then id'e say Ruby is about the only pure OOP language.

#5 JustinK101

JustinK101
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego, California, US

Posted 26 May 2006 - 09:26 AM

Thorpe,

"And as for everything being an object. Not every OOP language works this way. If that where the case, then id'e say Ruby is about the only pure OOP language."

My rant, was that ALL useful methods, string functions, array functions, etc, dont get called from objects. I know this is how php is, and going to stay, but just curious why they would stray away from OOP design for such functions.

Clearly lets do the example of substring.

$myString = "some text here";
$myString->subStr(0,1);

That is much more elligant and clean approach versus using parameter inputs. Just my 2 cents.

How much is Zend by the way? I am doing a little more research and apparently Dreamweaver inst that bad, its does some cool database stuff with recordsets and such I never played with.

#6 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 26 May 2006 - 05:57 PM

Nusphere's PHPEd is an excellent IDE also.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users