Jump to content

Archived

This topic is now archived and is closed to further replies.

JustinK101

PHP OOP Rant / Good PHP IDE

Recommended Posts

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.

[b]Example number one:[/b]
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.

[b]Example number two:[/b]
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.

[b]Example number three:[/b]
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I totally agree with wisewood....as far as your questions goes....Zend has a very good IDE for PHP....

Share this post


Link to post
Share on other sites
Zend is a brillient IDE for php.

As for your rant on OOP in php. You speak of defining member variables with the [i]var[/i] 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.