Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

semantic difference between ASP and C#?

Tags:

c#

php

asp.net

Forgive me for my ignorance on this subject, but I'm a relatively seasoned php programmer who's had no experience in any other Web programming languages, except some Ruby.

I've been told some time ago that ASP and ASP.NET are somewhat equivalent to PHP since they perform basically the same tasks,i.e. handle post and get requests, can print html, access a database, and so on.

So if they're similar and in PHP I can basically do everything I need for a web app, what is the need then for another language in the Microsoft Stack, namely C#??

If I'm not mistaken, C# is one of the most sought-after language here at SO, so I'm guessing I'm missing something big here.

Could I have some clarification? Thanks in advance

like image 997
Felipe Avatar asked Jan 21 '23 11:01

Felipe


2 Answers

Ok, there are 3 layers involved here.

  1. C# <- This is a raw programming language. It can be used alone just like any other language. This would be roughly equivalent to PHP, Ruby, Perl, etc

  2. .NET <- This is a framework for natively interacting with libraries from any supported language. Without .NET, if you wanted to use a VB class in a C# application, you would need to build some kind of interface (such as a RPC via network, or a command-line wrapper, etc). With .NET, you can directly interact with a VB.NET class just how you would with other C# classes (and data, etc). Basically, it makes it easier to integrate multiple languages. There is no equivalent in PHP...

  3. ASP <- This is a framework for building web-based applications. Remember, C# and VB are (for lack of a better term) generic languages. There's nothing in-built to the language for dealing with websites. So ASP adds a layer ontop to make creating websites far easier (request handling, MVC libraries, etc). This is similar to the framework concept in PHP (such as Zend Framework).

Now, there are 2 versions of ASP. The old version (known as Classic ASP) and the new one (ASP.NET). The difference is that ASP.NET is built on top of the .NET framework. So using ASP.NET allows you to make web sites with your language of choice (as long as it has a .NET binding, such as C# or VB.NET, etc).

ASP.NET and .NET are nothing more than layers on top of an existing programming language (C# in this case, but many others are also supported). They are there to make your life easier. Everything they do can be done in straight C#, but the framework is there to abstract away the common themes and let you focus on your problem (like any good framework)...

like image 76
ircmaxell Avatar answered Jan 30 '23 15:01

ircmaxell


ASP.NET is a web development framework that you can interface with using C#(or VB.NET).

C# is just a language that as implemented for .NET

like image 27
Achilles Avatar answered Jan 30 '23 13:01

Achilles