Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP vs ASP.NET 1

Status
Not open for further replies.

IT4EVR

Programmer
Feb 15, 2006
462
US
This is probably an age old question that many in this forum are tired of answering.

I've been developing in the .NET realm the past few years and not too pleased with how Microsoft revamps everything every two years. Every two years you have to forget what you knew and start from ground zero. Then they force you to use new technologies (SQL Server 2005 must play with Visual Studio 2005, etc) with the new version. Could it be for the money? Who knows?

Anyway, PHP has really intrigued me but I have to ask if it's this way with PHP. Do you basically have to chuck everything you knew in the garbage can every two years and start over or do they actually build on their foundation? How often are new versions of PHP released?

Does PHP offer much in the form of OOP is that still in process?
 
This page:


will show you how often new PHP versions are released.


PHP has not, in the 5 years I've been fooling around with it, had a paradigm shift as dramatic as the change from ASP to ASP.net. And since PHP's development tends to be both user-driven and more evolutionary than revolutionary, the changes tend to be slow, methodical, and supportive of older software. The last big change was the change between 4.x and 5.x, where there were great improvements in PHP's object-oriented features. But if you look here: you will notice that version 4.x is still being supported.

If you want to find out about PHP's features, look no further than the PHP online manual, one of the best pieces of documentation out there: , particularly the section titled "Classes and Objects (PHP 5)"


Want the best answers? Ask the best questions! TANSTAAFL!
 
Thanks, you've provided a bunch to get me started.

The more I am exposed to the whims of Microsoft, the more I am beginning to believe in Open Source.
 
Just so you know PHP doesn't have a proprietary GUI like MS ASP.net does. There are many editors that provide certain functionality like syntax highlighting. But you wont find many many that give you pre-defined "DataGrid" buttons like ASP would.

Most PHP developers get down and dirty in any text editor and code.
Personally I like that I can just as easy open notepad and start coding, as much as i like being able to use any old html editor. Also PHP requires a slighlty broader knowledge of HTML than ASP does.

I know you can also code ASP in notepad, but for some reason I think its harder to do it.

Just to add a little to what Sleipnir said. PHP offers backwards support and compatibility. Meaning even though some functions may get deprecated or replaced by newer more efficient ones and its better to use the new ones, your PHP developments will most likely not catastrophically fail when you update PHP because suddenly a function ceased to exist completely. The functions remain there and are gradually deprecated. And you can have time to update your projects to the newer functions.

And even though you can use many WYSIWYG editor they are mostly used to get the html layout rather than the coding of it.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I was able to install the PHP, Apache and MySQL and everything seems to be working great. Right now I have it up running on a Windows box.

I can remember coding with Notepad back in the classic ASP days, so it's not culture shock to me.

Both of you are correct in saying that ASP.NET abstracts a lot with the IDE and the packaged controls they offer. However what you get in ease of use you lose in performance.

While at work, I'll use the ASP.NET. While I am at home having fun, I'm going to work with PHP. ;)
 
Good, And don't forget. the PHP online manual is your friend.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Oooh. vacunita's execellent advice reminde me about one very real "gotcha" to getting up to speed with PHP, particularly if you are using publications other than the PHP online manual.

PHP has a setting called "register_globals" in php.ini. If register_globals is set to "on", the values of submitted form fields appear in the global variable space. For example, a POST-method form field, '<input type="test" name="foo">', would appear in a variable $foo.

Regardless of whether the setting of register_globals is set to "on" or "off", the value from that POST-method field will always be available in the superglobal array (more info on superglobals and variable scope) $_POST, specifically, PHP would make available the form field in the previous paragraph as $_POST['foo'].

If register_globals is set to off, POST-method variables will only be available in $_POST, GET-method variables will only be available in $_GET, etc., and the default value for register_globals changed in PHP version 4.1.0 from "on" to "off" for security reasons listed here. Software written with the expectation that register_globals be set to "on" (i.e. referencing $foo instead of $_POST['foo']) will generally fail when run on a PHP intallation where register_globals is set to "off" because the variables are not where the expects them to be.

The upshot is that many books about PHP still on the shelves of booksellers are old enough that the example code in the book expects register_globals to be set to "on", while your new PHP installation will have register_globals set to "off", so that example code may not run. It's not too hard to change form-field variable references, but it's something to be aware of. It's also common-enough a problem that I put it as the first part of my FAQ in this forum about debugging PHP: faq434-2999


Want the best answers? Ask the best questions! TANSTAAFL!
 
Also it is also recommended to set short tags(starting PHP code with <? rather than <?php) OFF in your php.ini settings for portability reasons.


--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Another note when working with directories, always use foward slashes to keep compatibility between windows and other operating systems. Alot of us develop on WAMP but deploy on LAMP for production purposes.

The manual is very good about explaining which extended functions work on windows and which on linux/unix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top