Jump to content

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!
Link to comment
https://forums.phpfreaks.com/topic/10486-php-oop-rant-good-php-ide/
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.
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.
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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.