Semantic difference between ASP and C #?

Forgive me for my ignorance about this, but I'm a pretty experienced php programmer who has no experience in any other web programming languages ​​besides some Ruby.

I was told that ASP and ASP.NET are somewhat equivalent to PHP, since they perform basically the same tasks, i.e. process the message and receive requests, print html, access the database, etc.

So, if they are similar, and in PHP I can basically do everything I need for a web application, then why do I need another language in Microsoft Stack, namely C #?

If I'm not mistaken, C # is one of the most requested languages ​​here in SO, so I guess I'm missing something big here.

May I have a clarification? thanks in advance

+4
source share
6 answers

Well, there are 3 layers involved.

  • C# <- This is a raw programming language. It can be used separately, like any other language. This will be roughly equivalent to PHP, Ruby, Perl, etc.

  • .NET <- This is the basis for a natural interaction with libraries from any supported language. Without .NET, if you want to use a VB class in a C # application, you will need to build some kind of interface (for example, RPC via a network or command line shell, etc.). With .NET, you can interact directly with the VB.NET class, as you would with other C # classes (and data, etc.). In principle, this simplifies the integration of several languages. There is no equivalent in PHP ...

  • ASP <- This is the basis for building web applications. Remember that C # and VB (due to the lack of a better term) generate languages. There is no built-in language for working with websites. Thus, ASP adds an ontop layer to simplify the creation of sites (query processing, MVC libraries, etc.). This is similar to the concept of structure in PHP (e.g. 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 platform. Thus, using ASP.NET allows you to create websites with your chosen language (if 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 that they do can be done in direct C #, but in the frame there is an abstraction of common topics and you can focus on your problem (for example, any good structure) ...

+5
source

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

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

+1
source

PHP and asp / asp.net are similar in this aspect ... but when it comes to website implementation, they are very different. In PHP you can integrate php code with html, which makes it very simple for a dynamic web page. On the other hand, asp.net is a simple MS-way to create html, and it is also easy and convenient to place and implement the server and client side script / code. You need to know C # or VB to implement the code on the server side of .NET.

+1
source

As Achilles said, ASP.NET is a structure that has many interesting features, etc. This is not a language. You do not write things in .NET or ASP.NET. You write code using one of the .NET compatible languages, such as C #.

As an example of the difference, you can bypass .NET at all and write your C # code in a Mono project, which is a .NET platform, but not with Microsoft.

To clarify, you can write aspx pages, but you will use a combination of HTML and ASP.NET controls, or, depending on the case, if you use MVC, you will use a combination of HTML and C # code on this aspx page.

+1
source

I think you are confusing something.

There is an ASP - often referred to as the classic ASP now. It is a dynamic, PHP-like web language. PHP and classic ASP are very similar.

There is ASP.Net that relies on a base language such as C # or Vb.net.

As for your question about why you choose one or the other:

PHP / Classic ASP and ASP.Net:

.NET and ASP vs PHP

http://www.beansoftware.com/ASP.NET-Tutorials/Classic-ASP-vs-ASP.NET.aspx

+1
source

to write an asp.net page, you need a language like C # or vb.net.

0
source

Source: https://habr.com/ru/post/1339904/


All Articles