Sign in to follow this  
sathenzar

ASP.NET 2.0...is it powerful enough and if so...then

Recommended Posts

Hey everyone, I was wondering, I just got done attending a MSDN Event that talked heavily on ASP.NET 2.0. I am currently prime on PHP/MySQL programming for websites. But after seeing that presentation, I was just wondering if their were any benifiets over PHP when it comes to ASP.NET 2.0. If so, I noticed that I can't really seem to find any really good tutorials off of google for starting off. Any ideas/comments? Thanks in advance.

Share this post


Link to post
Share on other sites
Quote:
Original post by sathenzar
I was just wondering if their were any benifiets over PHP when it comes to ASP.NET 2.0.


There are many differences, and it really depends on your situation.

ASP.NET 2.0
Pros:
* Great development tools
* Lots of professional and corporate support available
* Great development tools
* Works with languages that many programmers are already familiar with
* IDE has full integration with the web server, scripting, SQL Server, stored procedure debugging, and lots of features in the "EnterpriseServices" .NET namespace.
* Did I mention the development tools?
* There are tons of built in web controls, tons of third-party controls, and it's easy to write your own.

Cons:
* Five-digit price range for software before you are done, even more in larger environments, in addition to connection and hardware costs
* Some of the stuff that happens behind your back can be expensive in terms of compute time and bandwidth.

Other concern:
* It's Microsoft. Some people don't like this, others love it.


PHP
Pros:
* No-cost software (except connection and hardware)
* No forced migrations as old versions lose vendor support
* Lots of newsgroups
* You can hire teens to write it, and pay minimum wage
* You have a wide choice of server configurations available
* If you want, you can step into the system all the way to the lowest-level kernel functions.

Cons:
* It's yet another language to learn and support
* There are some good development tools out there, but they are nothing in comparison to the VS IDE.
* Debugging is much more difficult when it crosses lines between the final HTML, CSS, scripting, database connectivity, and stored procedures.

Other concern:
* It's not Microsoft.

Share this post


Link to post
Share on other sites
First, just to cover it, you can develop with ASP.NET 1.1/2 and MSSQL for free, assuming you have an IIS server (i.e. XP Pro). You just need to download the .NET framework which includes the command line compiler (you can also download the optimizing compiler for free) and then download MSDN 2000 (SQL Server with 2GB limit, no gui tools, installer uses an ini file instead of gui). In theory you can even develop most of ASP.NET without a compiler, as long as you don't make certain types of user components and don't use code behind files.

To cover question in the title of your post, yes ASP.NET is powerful enough. If you are comparing it to PHP, then it is definitely powerful enough. The thing to really consider however is that they are two different tools. PHP occupies the same space as class ASP. ASP.NET occupies the space of Java Server Pages and other web "application" development environments (PHP and ASP classic are more targeted at individual pages, making development harder to scale without creating a twisted mess).

If you are just doing amateur stuff (i.e. MySQL powered site), then ASP.NET might be too big of a tool for the job - like bringing in a backhoe to plant some flowers in your backyard. On the other hand if you are working on an entire park, PHP is going to start feeling like a hand shovel.

Share this post


Link to post
Share on other sites
Quote:
Original post by Michalson
First, just to cover it, you can develop with ASP.NET 1.1/2 and MSSQL for free, assuming you have an IIS server (i.e. XP Pro). You just need to download the .NET framework which includes the command line compiler (you can also download the optimizing compiler for free) and then download MSDN 2000 (SQL Server with 2GB limit, no gui tools, installer uses an ini file instead of gui). In theory you can even develop most of ASP.NET without a compiler, as long as you don't make certain types of user components and don't use code behind files.


Forgot about that. [grin] That brings the total cost down to the cost of an OS with IIS server.

Of course, that means you don't get the great development tools, the integrated debugger, and difficulty with custom controls. Not spending the money takes away most of the benefits.

I do like your hand-shovel vs backhoe comparison. It's quite accurate IMO. You can get hand-shovels for practically nothing, but I assume our company could buy a few backhoes with the money we spend on MS Volume Licensing.

frob.

Share this post


Link to post
Share on other sites
lol...ok, well I guess that puts PHP in perspective. Yes, I'm building apps in PHP at the moment that are big commercial projects, I was just noticing it seemed that ASP.NET 2.0 got the job done 100 times faster with more stability in some cases. So I was just seeing what people thought on the subject. Thanks again, any other replies are welcome.

Share this post


Link to post
Share on other sites
I would've thought under most circumstances really good knowledge of SQL and your database system would be more important than PHP/ASP. Wikipedia is PHP/MySQL though so I wouldn't say they were for small projects only.

Share this post


Link to post
Share on other sites
ASP.NET implements an event model for web pages, which makes building complex forms much easier. It also enables you to use neat Java knock-off tools like NHibernate.

Have a look at Ruby on Rails as well. They have video and text tutorials.

Quote:
Debugging is much more difficult when it crosses lines between the final HTML, CSS, scripting, database connectivity, and stored procedures.
Huh?

Quote:
and then download MSDN 2000 (SQL Server with 2GB limit, no gui tools, installer uses an ini file instead of gui).
Or keep using MySQL and its free GUI tools.

Quote:
PHP and ASP classic are more targeted at individual pages, making development harder to scale without creating a twisted mess

If you use good development practices, it's not that hard to make PHP projects that scale. The problem is that PHP and ASP attract the lowest common denominator, so examples of good code are few and far between.

Quote:
If you are just doing amateur stuff (i.e. MySQL powered site)
Heh.

[Edited by - igni ferroque on October 6, 2005 10:37:20 PM]

Share this post


Link to post
Share on other sites
To extend Michalson's point, ASP.NET development can also be done with Apache and mod_mono. Mono is not as mature as Microsoft's equivalents, but it is wholly free and _does_ work (I'm using it for my personal site). Additionally it can be run on Linux or most other free OSes. Hence, the cost required for software licenses can be as little as nothing. :-) Just my two cents on the issue.

-bodisiw

Share this post


Link to post
Share on other sites
It's really dependent on whether you *like* the ASPNET "Page is view and controller" model.

It's a sort of semi-templated driven system where the view (the ASPNET page) still contains a lot of logic (like things like datagrids).

You'd normally put most of your code in the "Codebehind" class for each page (or other classes you'd created) - but it will still be heavily intertwined with the ASPNET stuff.

Whether a purely templated model with no logic in the template is better, is entirely a matter of opinion.

In general the .NET libraries are excellent and C# is a good language. All the problems I've had is with some of the ASPNET components not doing what I wanted, and stuff like DataGrid, Repeater, DataSets etc.

---

I use Smarty in PHP, as well as using ASPNET and "Classic" ASP. "Classic ASP" is obviously massively inferior, lacking a number of error handling / debug features. It also cannot be run independently from the web server and it's difficult to reuse code.

Whether "Ruby on rails" or something is a good way of doing things - I've not really had a look it it yet.

Mark

Share this post


Link to post
Share on other sites
I second the Ruby on Rails recommendation. The important part of Rails is Ruby. Ruby is a very, very powerful and flexible language. It's possible to do much with few lines of code, and that's why some people claim a 10x productivity improvement over things like Java Struts or ASP.NET. Ruby on Rails has great documentation, ever-growing support, is slowly gaining ground in companies.

Share this post


Link to post
Share on other sites
Quote:
Original post by igni ferroque
Quote:
Debugging is much more difficult when it crosses lines between the final HTML, CSS, scripting, database connectivity, and stored procedures.
Huh?

When using Visual Studio + IE + SQL Server, you can debug things like your scripting and stored procedures within the IDE.

You can set breakpoints in your client-side scripts in web pages, assuming you have "Disable debugging scripts" turned off in your IE settings. I wish there was a way to do this in other browsers. I can debug scripts in some browsers like Firefox, but that means I need to change from the Visual Studio IDE into another program and work with the DOM rather than editing the code in-place.

If you've ever worked on serious database apps, you can appreciate why it is important to be able to look in to stored procedures easily. I can't find any other IDE that can do it, not Emacs/GDB nor Anjuta, or any others. You can transparently step from your code that calls database functions into stored procedures (assuming you have things configured properly).


Share this post


Link to post
Share on other sites
Wow, well I appreciate all the feedback so far, there are a lot of interesting comments. Well one more thing that's an issue I heard was security with ASP.NET is much better then PHP. I don't know b/c I don't know ASP.NET yet, I only know PHP when it comes to the two. ASP.NET is supposivly able to compile into dlls, which lowers your chance of getting your code exploited. Is this true? Lastly, is it possible to run apache and have it configured to run ASP.NET 2.0? Or do you have to use IIS and designate a directory under apache and have that run as an IIS site? Thanks in advance and for all the replies so far.

Share this post


Link to post
Share on other sites
Even when compared to classic ASP PHP has some security concerns, mostly as a result of it's "data as code" features, but also due to some misfeatures designed to speed up coding (though many of those have been phased out, even though online tutorials and books still reference them).

For example here is one way PHPs "features" can be exploited (phpBB changed the code a while ago, so don't bother trying it. I'm intentionally trying to limit details so that this won't be a "script kiddie ready" exploit explanation)

When phpBB (a popular PHP based forum) stores your login in your cookie it encrypts the data as a hash. When phpBB attempts to login someone based on their cookie, it compares the correct hash for that user with the hash provided in the cookie. If they are the same, the user is logged in.

The hash itself is secure, what is not secure is this innocent looking PHP code:

if( $sessiondata['autologinid'] == $auto_login_key ) // This is not safe

The reason being is that the cookie can be modified such that the cookies value will be seen as a boolean instead of a string (PHP like classic ASP uses variants, which "know" what type their data is, but can switch the type or even do operations on other types). Now even with variants this wouldn't be a problem in other languages that support variant types (comparing a boolean to a string), except that in PHP data can also change code.

In this case, because $sessiondata['autologinid'] is stored as a boolean, the designers of PHP decided it should silently change the code to this:

if( $sessiondata['autologinid'] )

This means you simply need to change your cookie value to a boolean true, and suddenly you can specify any userid and it will consider your login as valid.

Because of this and many other "gotchas", it can be very, very hard to make PHP code that is truly secure, as every line of code could have hidden/obscure effects or interpretations. It's just like trying to verify that an obfuscated c program is secure. phpBB and other open source PHP forums are constantly hit with new exploits, 90% of which are either SQL injections and PHP data as code injections (even some of the SQL injections are actually made possible because PHP changed the way the values were submitted due to the type or value of some user provided data)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this