I remember when I started visiting the BASIC forum on Compuserve, there would be the occasional zealot who would drop by and suggest VB was for wimps and real programmers used C/C++. Some 10-15 years later and the same type of mentality exists.
Each is a tool which solves a certain problem better than others.
When comparing ASP.NET to PHP you are almost comparing apples to oranges. One is propritary the other open source. One has support for an advanced editor, the other forces you as a developer to find one you like.
Personally, I switched from ASP to PHP because from what I could tell at the time (some ten years ago) PHP seemed more flexibile and Linux hosting was half the price. Although ASP was probably superior as a language/technology at the time (Microsoft always has awesome IDE's) I desired the flexibility of open source. I actually think it was the requirement to buy a Mailer activeX control in order to send mail in ASP that finally forced me to switch to PHP.
I liked PHP because of it's resembelence to C syntax. So that is nother reason one might choose PHP over ASP.
My point is, there are many factors that will influence any developers choice in development language, not just the language itself. Technical, political, emotional, etc.
I like open source, not because it's free (although that helps) but because of the flexibility I am offered. I love being able to take multiple small tools and construct my own tool chain. Closed source tools tend to try and be everything to everyone and you end up with monolithic giants -- although this happens frequently in PHP applications (ie: SugarCRM).
I would like to see operator overloading similar to C++ in PHP -- I have some cool ideas I'd like to implement that require that funcitonality.
I would also like to see forced type checking. I don't think loosely typed languages are very sexy. If I pass an object where a function expects a string I wanna know about it cause that leads to annoying bugs which can be difficult to find. Basically type hinting should be type checking and everything should be an object.
Not everyone would agree with me on that one, many PHP developers still insist on writing procedural code. While there was a time I would argue until my face turned blue that using procedural code was the devils work...I would be wrong to do so. Whatever works for you as a developer you do, even if it's considered bad practice by others. Hell I do have a single functions.php file in my own projects where I have generic functions that would look ugly when called statically inside a class.
__autoload()
a2b() - Array to Bitfield
b2a() - Bitfield to Array
deep_stripslashes()
And about 20 other functions. So I can see why some might still want to keep proecudral programming live and well.
PHP is by far the more popular web programming langauge. I think Python and Ruby have their place but their position is not to trump PHP but instead satisyf those who cannot live in a PHP environment.
I can't remember which one but I'm sure one was based partly on Smalltalk which I believe is a purely OO language (I think it's Jenk who uses it regularly so he can agree or correct me if I'm wrong).
Use whatever tools floats your boat. I've always been a huge C++ fan and I still am...I love that language but there are many things you can accomplish more elegantly in PHP and I don't mean just web applications. The fact that PHP lets you do something like:
Code: Select all
<?php
include 'somefile.php';
$res = mysql_query('SELECT * FROM table');
// TODO: Iterate over resultset
foreach($arr as $record){
echo '<div>Some record</div>';
}
Is such a bad practice except in all but the simplest cases...but it's what attracts newbies to web programming because you don't need to learn about headers and HTTP you just GO...
PHP is an excellent learner's language as the basic syntax is all one needs to understand to get rolling. However it also offers the developer plenty of room for improvement and has countless frameworks one can use if your so inclined to test the water.
Basically I don't personally think any language is superior to the other. Like when comparing PHP frameworks I guess. They each solve problems from a different perspective...maybe some are more security focused, whereas others are more RAD focused and other more on good design.
What language you pick really relies on what YOUR requirements, desires, expectations and long term goals are...
Cheers