TalkPHP
 
 
Account Login
Latest Articles
» cURL Basics
» Securing your PHP applications Part 1
» The way the function rolls
» Database Abstraction with Zend_Db - Part 2
» CSRF POST Token Protection
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP
Reply
 
LinkBack Thread Tools Display Modes
Old 01-06-2008, 08:48 PM   #1 (permalink)
TalkPHP Loves You
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Nottingham
Posts: 1,333
Thanks: 65
Wildhoney is on a distinguished road
Wink 10 PHP Myths Dispelled

I found this on Alan's blog, to which he then linked through to the original post. So I thought I would bring it over here for anybody who wants to contribute their thoughts. I posted a comment on the original post, and so I've brought it over to TalkPHP as well because it's my take on the article.

The 10 myths which he decided to tackle are as follows:
  1. PHP is not a truly Object-Oriented Language
  2. PHP Encourages Sloppy Code
  3. PHP doesn’t follow MVC
  4. PHP is slow because it’s interpreted
  5. PHP doesn’t have a good IDE or Debugger
  6. PHP apps all look the same
  7. PHP isn’t really for “serious” developers
  8. PHP is only good for web applications
  9. PHP code is a mess of “include” and “require” statements that break easily
  10. PHP Code is rife with in-line SQL statements

My comment:

Quote:
Originally Posted by Wildhoney
I also admit that PHP has its problems. Its naming conventions for functions to name one issue. But that’s not to say it’s not a decent language, after all, I wouldn’t be running the TalkPHP community if I thought it was a bad language. It’s just I like to keep at least a little distance from everything until I can honestly say it deserves to be backed by utter certainty in my convictions. At the moment, PHP merely deserves a chance to prove itself, and that’s what it’s going to get from me.

Evidently, PHP has a way to come yet on the OOP side of things, but just like Maxon Cinema 4D in the 3D world, it’s slowly creeping up the ladder and will be ahead before you know it. Perhaps overtaking Java is an improbable, if not impossible task, I admit. But that doesn’t mean it cannot be equal.

I feel PHP 5.3 will bring us a lot more in terms of the namespaces and the alternate ternary operator, as well as all the abundance of features, both big and small, that it’s going to bring to the table.
What do we all think...?
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 01-06-2008, 10:13 PM   #2 (permalink)
The Addict
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 240
Thanks: 3
xenon is on a distinguished road
Default

Well, I'd have something to say...

1. PHP 5 is very close to it (although I don't know much about C++/Java way of "object oriented", but I suppose there's not a big difference from what I've seen).
2. every programming language "encourages sloppy code". That depends and differs from one programmer to another.
4. I would say a 10.000 line PHP application runs much more faster (that is parsed, compiled and ran) than an equally long C++ application is compiled (only compiled, not ran).
5. Perhaps Eclipse and Zend are just common text editors, then, and XDebug is their child.
6. not always true. an object-oriented php application doesn't look at all like a procedural php application.
7. perhaps or perhaps not. PHP, although, does require a lot of concentration and will to learn and then work with it, because of the multitude of the additional languages it can work with (like SQL, HTML, JavaScript and such).
8. that I agree with. But then again, that's what it was created for.
9. check (2)
10. no, it is not, if you think a bit (just a bit) before writing an application.

Probably the one who wrote this article has something against PHP or hasn't worked with it, otherwise I can't explain why COMMON programming issues are presented here.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 01-07-2008, 10:49 AM   #3 (permalink)
The Reckoner
Advanced Programmer Top Contributor 
 
Karl's Avatar
 
Join Date: Sep 2007
Posts: 429
Thanks: 22
Karl is on a distinguished road
Default

I have to agree with Xenon here, he's said pretty much everything that I would have. The guy who originally posted that list probably just doesn't like PHP. Don't get me wrong, some of his points do hold weight, but most of them seem to be based on his personal opinion rather than any real facts.
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Karl is offline  
Reply With Quote
Old 01-08-2008, 12:20 PM   #4 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 210
Thanks: 13
RobertK is on a distinguished road
Default

I must agree with Xenon and Karl, the arguments are mostly ones that have come before with many languages. And I have a few of my own comments, sorry for the verbosity.

3. PHP doesn’t follow MVC
To answer this could be long, but I'll be short. For PHP MVC is a choice, not a requirement. Unlike some other languages where things can be unnecessarily complex in a mere error page. The MVC model, Model <-> View <-> Controller, is little more than a concept that has been object oriented. The base concept is abstraction between the data, specifically large amounts of data, and the view.

Procedural PHP either follows, or doesn't follow, the MVC concept. It either has code/functions that control the varying data followed by the view creation code/functions, or it has the view creation strewn throughout the data aggregation. Event incorporated view handling with the data has separation, as this, by and large, comes from a database or the filesystem.

Object Oriented PHP follows the two options above in manner but is far more encapsulated. The objects would contain all the code for the data, view, and controller--and many libraries already provide this exact MVC framework. Even when the view and data are handled procedurally, bit by bit for page generation, the processes are still separate.

Arguably, I would say PHP is one of the few languages that is natively MVC compliant--even if only in concept, rather than strict definition. But in the end, the strictness of the MVC relationship is up to the programmer.

4. PHP is slow because it’s interpreted
Absolutely correct. But we're also talking in relative terms. Interpreted languages are slower by definition because they aren't compiled and must be interpreted. That said, I see a great many bloated walruses in many languages, especially C++ (compiled) and Java (interpreted). However, Zend makes a better toaster. It CAN be bytecode compiled from what I understand. And its efficiency competes directly with LUA.

Another argument that makes this point null-and-void is abstraction. If I give a C/C++ application and input it doesn't expect it will crash immediately--it was an error. If it doesn't crash this input was expected, and prepared against. Lets pretend you have a hard-coded CGI binary. You just lost your whole interface that touches that input. With the abstraction of PHP I can change one, maybe two, lines per function or object and make it handle any problems like this gracefully. This makes recovery less of an arcane art, and more of an impressive feature.

So, bytecode-uberspeed or interpreted-stability? I like the latter.

5. PHP doesn’t have a good IDE or Debugger
News to me. phpDesigner 2008 is a good place to start; it is a PHP IDE. It even pops up as I pause in typing to tell me when and where I've got an error, without clicking debug or starting Apache. As a hobby I use Visual Studio 2008 (with Chrome, an Object Pascal extension language) and even those errors need arcane interpretation--PHP errors are pretty obvious, even when arcane sounding.

7. PHP isn’t really for “serious” developers
It's a good thing I'm not serious then. I make plenty of jokes. Or, is that why my .NET-ASP loving uncle is so angry any time I bring up why I disagree with him?

I'm glad "it's not for serious developers"... it'd give me ulcers otherwise. I've SEEN those serious folks, and they need to lighten up. Seriously.

(Anything C can do, PHP can do better!)

8. PHP is only good for web applications
A language being good at its purpose is a bad thing? Correct me if I'm wrong, but not even Java is good at its purpose, whatever that may be. Java programmers are the first to admit to Java's many problems. But, PHP being good at what it is supposed to do is bad....

I think someone needs to see the psychiatrist.

2. PHP Encourages Sloppy Code / 9. PHP code is a mess of “include” and “require” statements that break easily / 10. PHP Code is rife with in-line SQL statements
Sure, if you write it that way. But even sloppy PHP can be understood, and isn't nearly so mind-warping as the C-Macro paradigms. And, believe it or not, even this sloppy, "bad", PHP is typically fast, efficient, and understandable!
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:37 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0