|
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 5
Members:
Number of Users Online:
Welcome to our newest member, |
|
 |

05-16-2008, 01:15 PM
|
|
Junior Member
|
|
Join Date: May 2008
Posts: 9
|
|
PHP lovers and haters; should I use PHP? If not, why, and suggest an alternative?
Ok so whenever I ask about languages, I always get the most convoluted answers ever. I have been doing PHP programming for about a year, but on and off and nothing serious. I read an article about why PHP sucks, and it really hit home, especially one of the statements.
"A lot of open source projects are written in it, such as Joomla, Wordpress, and MediaWiki. All of their code is hideous, and half of the time there’s random HTML in the middle of their scripts because, of course, we’re working with webpages and why would you ever want to abstract the output from the logic?"
The sarcasm and utter truth from this comment make me laugh. I have been reading some of the best books from some of the best programmers, and the code is always going in and out of PHP, HTML inside and out in a confusiong manner.
I basically want to know your opinion of PHP (and if not a high one, an alternate language and why) but no one ever gives any specifics so I thought I would bring up a good point .
first commenter; thank you for not elaborating on that AT ALL, as per my question asked for. You had absolutely no response to my qualm about PHP; did you even read my question? Major thumbs down. If you answer a question like that, and advocate PHP, it really makes me wonder if only flaky people really support PHP. So thanks for a couple of things; for not answering my question, and strengthening my doubts about PHP.
Greyman; on the contrary, I actually quite like PHP. But this is not what the question is about; I asked for an in-depth and honest opinion about PHP, and good reasons WHY. The first commenter merely said "Oh PHP is just given a bad name because of bad coders" /end of comment.
It wouldn't be all that bad, if I wouldn't had put in my main question, that I wanted elaboration, reasons, because all people give are short answers that mean absolutely nothing. The 2 gentlemen who posted answers after you had the answers I were looking for; you are completely off base and like the first commenter, fail at actually answering questions. I would suggest you look at how the 2 answerers (following you and the first commenter) gave me in-depth answers that you seemingly can't, and don't let the door hit you on the way out.
|

05-16-2008, 01:25 PM
|
|
Junior Member
|
|
Join Date: May 2008
Posts: 1
|
|
What's your problem?
If you don't like PHP then don't use it. I'm pretty sure nobody gives a damn. Calling people names because they like something you don't is juvenile.
Or were you just having problems with PHP and the first comment really hit home about the type of programmer you think you are.
|

05-16-2008, 05:17 PM
|
|
Junior Member
|
|
Join Date: May 2008
Posts: 2
|
|
PHP itself is a great coding language. Some people just do a really craptastic job of implimenting it. That's not the fault of the language... it's the fault of the programmer.
|

05-16-2008, 08:35 PM
|
|
Junior Member
|
|
Join Date: May 2008
Posts: 8
|
|
Well, you asked for it...
The fact that there's a lot of crappy PHP code around can be explained simply by the language popularity. Compared to the alternatives, the language and the execution environment are very accessible and it's extremely easy to begin programming with PHP.
There are a lot of entry-level and amateur programmers doing it out there, and there are also lots of non-programmers doing it. This leads to significant amount of convoluted, atrocious and non-maintainable PHP code.
There is also a great deal of high-quality PHP code. Drupal is specific example.
Similar phenomemon happened with Visual Basic, before they went into .Net business, which effectively scared away many not-so-sophisticated programmers.
Why PHP is so popular as web language, is another question. I think it was the result of natural selection. If you look at the competition, ASP is pretty easy too, but it's proprietary and largely unportable technology. Perl is powerful, but has much higher learning curve - you need to be serious geek to speak Perl fluently. Java-based web platforms are also powerful, but are quite complicated for average programmer.
PHP was designed for HTML generation, unlike other general-purpose languages. And it doesn't suck at it and is very convenient.
Generation of web pages with full abstraction of HTML presentation from the logic exists only in the ideal world. In the real world applications, there will be HTML sprinkled here and there in the code. It is not necessarily a bad thing. Some applications do it better, some worse, but that's not the fault of the technology in case of PHP. And PHP handles mixing of HTML with the code gracefully, in my opinion, or at least not worse then other languages.
The language itself and execution platform are very powerful and perform quite well in many tasks. I personally like PHP and used it in many projects. It's not suited for 100% of web applications of course, but honestly, PHP's portability and ease of use can't be beaten.
I have my share of grievances, though. References in PHP are just not right - it's almost impossible to figure them out. Name scoping is another thing that is difficult, though they addressed that in recent versions. Nothing major besides that. Those don't outweight the pros, though, and overall I am happy with PHP.
Hope this helps.
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|