PHP OOP Rant / Good PHP IDE
Posted 26 May 2006 - 07:52 AM
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);
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!
Posted 26 May 2006 - 08:20 AM
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.
Posted 26 May 2006 - 08:41 AM
--: FUTURE IS LINUX :--
Posted 26 May 2006 - 09:11 AM
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.
Posted 26 May 2006 - 09:26 AM
"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";
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.
Posted 26 May 2006 - 05:57 PM
Donations gratefully received
|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