# asp or php

This topic is 4139 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I notice some forums use php and others use asp to manage their system. I am a fan of php so i want to know why is asp used instead here and elsewhere over php. Does asp offer advantages over open source? Thank god perl wasn't used!

##### Share on other sites
Not all servers support PHP just as not all servers support ASP. Sometimes the developers of a piece of software are simply more familiar with one language over another.

ASP applications are also not necessarily closed source.

##### Share on other sites
Is there real advantage to asp over php other than availability , and what main servers don't use php?

##### Share on other sites
Often if you are writing a system for a client, they will request that you create it in a specific language.

I think ASP integrates with .NET languages, so if you have lots of .NET backend tools it might be useful. Also PHP is pretty slow (unless you have the Zend platform/optimizer on your sever) so its not as good for high-CPU-usage applications.

For example, if someone wanted a forum written for them, but they dont have any PHP coders, it will be hard for them to maintain the system, so they might ask for it to be written in ASP so their dotNet coders can maintain it.

Another example may be that you paid lots of money for your nice ASP server and dont want to admit that you could have just used an open-source system and saved yourself thousands of dollars, so you maintain a state of denial and stick with your inferior proprietary system for the sake of protecting your ego (Sorry, just having a jab at stupid bosses here, no offense intended to ASP).

##### Share on other sites
Don't forget that there are two totally different platforms that go by the name ASP: the "ASP Classic" family is now considered obsolete, at least by Microsoft; it was dominated by VBScript on the server side. ASP Classic is a very minimal programming environment and relies heavily on Microsoft's COM technology to add functionality and connect to databases, other programs, libraries, and so on.

ASP.NET is actually a totally different beast; you write your programs directly in a .Net language and they are executed as binary programs, not interpreted like ASP Classic. It's generally supposed to be faster, but also has significantly more bandwidth overhead when using more advanced features, and it is very easy to create horribly crippled and inefficient applications if you don't know what you're doing. ASP.NET also has a different development model and philosophy than ASP Classic and PHP.

ASP Classic was a pretty piss-poor platform, IMHO; the only real reason to use it is if you have a lot of code written in it already, or a lot of good ASP Classic programmers. GDNet falls into the category of lots-of-existing-code, I believe. ASP.NET is a monster and I'm fairly sure I'm going to decide to hate it one of these days. For now I merely distrust it and try to ignore the stink.

PHP is a very rapid-development language, but it's a lot like Perl in that it's mangled, inconsistent, fraught with just plain dumb pitfalls and minefields, and generally takes a lot of rote memorization before one can be an effective programmer. Its main strength is the vast scope of its standard libraries.

Also note that PHP can run on any of the major web (HTTP) servers out there, but ASP and ASP.Net only run on Microsoft's IIS. By extension, this also means they only run on Windows servers. PHP is portable; the ASPs are not. This is only really an interesting concern if you are looking to distribute your software (e.g. off-the-shelf forums software).

The advantages are pretty much purely subjective and circumstantial; if you know PHP, go with that; if you know a .Net language, go with ASP.NET; if you know VBScript or JScript, use ASP Classic.

##### Share on other sites
Quote:
 Original post by jagguyIs there real advantage to asp over php other than availability , and what main servers don't use php?

(classic) ASP does not have any known advantage over PHP except better COM support (and therefore much easier leveraging of COM components written for windows). For normal, non-com, web applications PHP was a much cleaner and slightly better supported choice. In fact, PHP was available on many more servers until Chilisoft released an ASP module for apache. Even then though, ASP is dead. ASP has not made any improvements since PHP was in version 3. Since then PHP 4 and 5 have come out and brought significant additional features to the table.

Of course .NET has come out and offers ASP.NET - which has virtually no significant relation to ASP except for the way code in embedded into aspx file files ... .NET is an awesome platform, and well worth learning IF you want to devote significant time to becomming a web programmer. If on the other hand you just want to write a few small pieces of code to spice up mostly static sites ... PHP is still superior (because you don't have to be a trained PHP developer to leverage it).

Just so you know, I work full time as a corperate .NET web developer (using C# and ASP.NET). I like it a lot. But I've had experience helping people from less formal backgrounds and I don't believe it is worth changing from PHP to ASP.NET unless / until you have a desire to focus more of your time on developing. If you are in fact a full time PHP developer and expert, then you also might not need / want to change - because over half of your skills would not transition in the short term.

##### Share on other sites
I have only done a little .net stuff but it looks like a hard profession to get into to be honest. You can't learn about .net in college to any great level so where do you have the time to train to do it?
Learning .net in your own time isn't going to get those must have few years experinece in .net jobs.

I prefer open source to be honest but never say never.

On a side note I really dislike perl as it is so messy compared to c++, and over 100 lines of code of perl isn't something I wish to debug or understand. With so many alternative newer web technologies around I can't see why you still want to purse perl.

##### Share on other sites
/slightly off topic
I'm going to try out Ruby on rails, which is steadily gaining popularity.

##### Share on other sites
Quote:
 Original post by ApochPiQAlso note that PHP can run on any of the major web (HTTP) servers out there, but ASP and ASP.Net only run on Microsoft's IIS.
Not true on either count. There are solutions in the form of Sun's Chilisoft ASP for ASP "classic", or Mono for ASP.NET. If you're using PHP, you'd probably be better off running it on top of ASP.NET using Phalanger.

I'm not sure about the concern about the lack of open-source software on the .NET side - the CLI which .NET is built around is an open standard, hence 3rd-party implementations away from Microsoft's own, such as Mono.

.NET is obscenely easy to get to grips with, given the high quality of the development tools and documentation. I especially don't see what "learning it in college" has to do with anything. [wink]

##### Share on other sites
The benefit of ASP over PHP is that ASP is much simpler.

PHP gives you horrible verbose errors like this:
Parse error: parse error, unexpected T_VARIABLE, expecting '(' in welcome.php on line 2

Whereas ASP gives you nice, simple errors:
Provider error '80004005'Unspecified error

;)

##### Share on other sites
Quote:
 Original post by KylotanThe benefit of ASP over PHP is that ASP is much simpler.PHP gives you horrible verbose errors like this:Parse error: parse error, unexpected T_VARIABLE, expecting '(' in welcome.php on line 2Whereas ASP gives you nice, simple errors:Provider error '80004005'Unspecified error;)
Don't forget that PHP errors aren't always in English. [wink] Nothing like a Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM to get you reaching for the closest Hebrew→English dictionary.

##### Share on other sites
Can someone explain to me how to get asp.net ;do you ned to pay for it or is it free?
Do you need to run it with IIS server winxp prof (which I have winxp home and apache)?

##### Share on other sites
Quote:
 Original post by jagguyCan someone explain to me how to get asp.net ;do you ned to pay for it or is it free?Do you need to run it with IIS server winxp prof (which I have winxp home and apache)?
You do not really need to pay for any of Microsoft's .NET tools - if you install the framework, for example, you get all of the usual compilers with it (eg csc.exe) anyway. There are free versions of Visual Studio which can be downloaded here - if looking at web development, Visual Web Developer is probably what you want.

The Mono page on ASP.NET is probably the best place to look for information for running applications away from IIS - for Apache they provide the mod_mono module. The Mono project has its own set of tools, if you do not feel like using the Microsoft-provided ones.

##### Share on other sites
First off let me state im a big proponent of .NET, though I have, in fact, used PHP much more extensively then I have ASP.NET. That being said:

1. The #1 reason for the widespread use of ASP.NET is the corporate ideology known as MKB (Microsoft Knows Best). As a game developer you should know as well as anyone that companies with the goal of profit in mind dont generaly like change to much. You would be blown away if you knew the number of \$5000+ accounting and banking programs that are still using legacy (what most of us would see as estoric) languages. Dispite nerdy fandom and the large amass of languages availiable today, most are not used in large scale production enviornments for just this reason. They are more of the tools of entrepenuers and hackers, not established businesses, which stick to what they started with.

2. In alot of enviornments open source just doesent work. I know that may sound a bit silly, but in reality, no financial, governmental, or military solution really allows opensource to trickle into their apps to easily (beyond being highly discouraged) Of course, the 15% of developers employed in those fields, who are familiar in those technologies, will push those onto the companies they console or start. Neverending cycle right there.

3. ASP.NET provides a completely different paridigm from PHP. Despite the advances of PHP when it comes to OO development, it doesent touch the level of abstraction of ASP.NET's C# or VB.NET.

4. ASP.NET supports code-behind. This includes the creation of .dll's which run on the server, and interlop with the operating system itself. This makes ASP.NET a much more MARKETABLE system then .PHP, whos applications are typicaly forcably open source, or at least associated with it. (Yes, I am aware of the Zend Compiler)

5. Companies like to attach a face or identity attached to their backend. That way if something blows up they have someone to call, sue, or humiliate in public. Microsoft provides that image, not to mention the blue screen of death provides a great outlet for stress relief in the office.

6. .NET is compiled into an intermediatary language, then eventualy into native code before it is ran on the server. It implements caching mechanisms, and a whole load of other junk which SUPPOSIDLY makes your programs faster, though I have yet to see any benchmarks to vouch for it. PHP is an interpreted language. Now there is Zend Optimizer which is an availiable mod that turns your PHP into a form of bytecode. This gives you a huge speed increase, cachning capabilities, and a price tag that makes it no cheaper then .NET.

7. While companies hate big change, they love trends. The major trends right now are AJAX and Web Services. Microsofts implementation of a server side ajax "generator" (previously called Atlas) is smooth as silk, and .NET was practicaly BUILT for web services (php was DEFINITLY not). I dont know of a comparison PHP library , extension, etc that operates nearly as nice (if someone knows something, please point it out). Needless to say, Microsofts .NET initiative is OOTB (out of the box) Internet 2.0 Compatable, whereas PHP's design is lacking in that structure. It does help that microsoft has positioned itself on so many of these boards to make them a force to be reconed with of course.

8. .NET costs more, which is a plus for big companies. As silly as it sounds, alot of companies believe software that is FREE or CHEAP ___HAS___ to come second fiddle to the expensive counterparts. Though I will aggree that for transaction based databases MySQL is NO COMPARISON to MSSQL with their T-SQL syntax.

9. I could go on and on, but my hands are turning to mush. Bye

##### Share on other sites
tHANKS FOR ALL THE INFORMATION, IT ALL GETS READ.

As well as leaving my caps lock on.

Can you interact witha mysql database with asp.net ?

Is the main function of asp.net to access databases and provide some Scripts for web pages. There seems many functions of asp.net so I am wonderig how much do you actually use in most common problems?

##### Share on other sites
Quote:
 Original post by jagguyCan you interact witha mysql database with asp.net ?
Yes, you can.

Quote:
 Is the main function of asp.net to access databases and provide some Scripts for web pages. There seems many functions of asp.net so I am wonderig how much do you actually use in most common problems?
.NET is a massive library designed to cover most programming tasks, be it string manipulation, file handling, network communications, database interaction, collection management, drawing, ...

MSDN is really the best place to look to see what .NET provides. I'm not so hot on the web side of .NET, so I'm not really up to date on the useful web-specific components.

##### Share on other sites
Where are some good asp.net forums as I have some questions .
It seems hard to view a webpage as it keeps on crashing whenever view in browser from visual express WD ide. I haven't downloaded the module for asp work on my apache so I am hopig that's it or the MS VEWD is quite unstable to use

##### Share on other sites
PHP is a horrible language. People generally don't argue this point. And people who do don't need to do much more than educate themselves and they agree. I've never seen a language so blatantly bad in every respect in actual use. In fact it's the perfect poster-boy for the argument "popular doesn't equal good". When C++ programmers claim that C++ must be good because so many people use it, you can just point to PHP and they'll have to shut up. Nobody who has any experience with various languages will ever defend PHP.

I won't do another list of specific reasons for why PHP sucks. I'm sure you can go to your favourite wiki article or whatever and you'll likely find a list of the major flaws in the language. Note that there's probably at least a half a dozen major flaws which if found in another language would be reason enough to not use it. PHP is just full of really horrible misstakes and is probably beyond repair.

ASP.Net is better. Much better. Python is better. ROR is better. Any language is better than PHP. The only thing PHP is good for is for a punchline.

This might seem like a troll, but I just can't be bothered to state what everyone who knows their shit just agrees without argument. PHP is plainly a really bad language. Spend fifteen minutes googling, and I'm sure you'll find people who've taken the time to be a bit more systematic in their criticism than I.

##### Share on other sites
I've used all three, PHP and Classic ASP off and on over the last few years, and ASP.NET more recently.

For my part, if it was down to the first two, it would be PHP for sure. It's sometimes awkward, but there's so much documentation available, and I still find it much easier to work with than Classic ASP.

If you add ASP.NET to the mix, Classic ASP would definitely be out. ASP.NET versus PHP would be very subjective, and would greatly depend on the situation.

Although I've been working with ASP.NET a lot lately, and I love it. It seems so much easier to get work done than in Classic ASP, what with the framework and all. I also like the codebehind way of seperating markup from code.

ASP.NET makes a lot of things easier to do. So much work had to be done manually in Classic, but .NET automates a lot of functionality, such as databinding form controls. I've discovered numerous differences in how to get things done between the two...If I may be so bold, I've done some writing on my site about it.

##### Share on other sites
sounds like i need to use the 2 to make up my own mind. ASP.net seems to have a larger range of functions than php.

Nothing can be as bad a perl the language which is messy and horrible to look at. Anything meaningful will take loads of code and waking up to see 100lines if perl code is , yuk!
With so many technologies around why perl isn't ditched I don't know. Perl is a throwback from cobol days and things shoud have moved on.

I want to learn asp.net. What I want to do initially is connect to a database like mysql and display data and do basic operations.

I went looking for a book on learning asp.net and they expensive with all sorts of obscure topics on the subject.

Is there some good websites around to learn from or anything like a book for basics etc. Also do you need to know c# in order to do asp.net or is it bettre you do know it?

[Edited by - jagguy on October 21, 2006 1:19:26 AM]