11 points · by ideamonk · 17y ago · 25 comments
While other alternatives like PHP, PHP based frameworks (CI,Symfony,Zend), then Rails etc... really make the job easier when compared to asp.net.
While in PHP you would be writing 5 to the point lines to do something, in asp.net the same would need you to have things that are irrelevant to the goal, in the code...
have a look - <%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToLongDateString();
}
</script><html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Sample page</title> </head> <body> <form id="form1" runat="server"> <div> The current time is: <asp:Label runat="server" id="Label1" /> </div> </form>
</body> </html>
Now how much of PHP would the same code require ?! So, Why would anyone go for asp.net?
I understand that number of lines doesn't matter after reading some great comments, but don't you thing it slows down quick learning in some way... because you've to go through big chunks of code that do simple tasks... while on this front, other languages make learning really easy and fun with short straightforward codes.
I can create my own DSL whose sole purpose in life is to send dates to a browser, and all it takes is a file with the character "x" in it; that doesn't make my language any better than Rails, ASP.NET, php or anything else. Different languages and platforms exist to solve different problems and cater to different markets.
Asp.net is also very attractive to the legions of .Net developers who may not have much exposure to the web way. It mostly abstracts web interactions away, so that it's not a huge leap to go from client/server applications to web apps.
Sure, there is a lot of code in the final result, but the IDE helps automate a lot of that, and in combination with ReSharper, it's not a bad environment to work in.
Does $abstraction make things easier because you don't have to learn about $technology, or does it make things easier because it eliminates the repetitive parts of $technology?
Keep in mind, the former reason is entirely fine/admirable -- so long as the abstraction is not unnecessarily leaky. Why learn something you don't have to?
I hav skepticism over Cappuccino because, as someone who does a lot of web and Obj-C/Cocoa development, I see a lot of my Mac dev friends attracted to it not for its merits as a solution for making web apps, but because they don't want to learn anything about web technology. Still, I have a lot higher opinion of Cappucino than ASP.NET :)
Because they have an existing investment in C# and/or the microsoft stack, and a team of developers who know C#/visual studio. In that situation it's pretty hard to sell PHP.
ASP.NET is an oddball. It's roots, as many have pointed out, were to make web programming look like windows programming. That's the crappy part.
The good part is that there is a heckuva lot of power under the hood if you take the time to learn the mechanics of things. I can move from a drag-n-drop GUI programming of the web into all kinds of other things depending on my whims. I can go XAML, or Silverlight. I can go straight functional with F# or some of the other functional languages for .NET.
And it all runs inside the same IDE with IntelliSense and debugging and machine-level inspection if I want it. And all the applications, no matter what their language, can easily interoperate with each other. And if I stick to ASP.NET 1.1, I can run on *nix boxes all day long.
The list goes on.
Please don't misunderstand me. I don't have the religion, so I'm not trying to pump it up more than it is. It has real problems as an architecture because the winform idea doesn't fit into web programming. Having said that, however, a good programmer can crank out ASP.NET applications as fast as anybody else in any other platform. For exploratory web application programming it's on par with any other platform. The new team stuff looks pretty cool.
I find that most people who dis ASP.NET failed at learning it or are just blowing off steam. To say the same thing a different way, by the time you've wasted years figuring out where all the alligators are, you don't see what the big deal is any more.
Biggest plus? I can almost go to Seven-Eleven and pick up good ASP.NET programmers. The market has a lot of them (cheap). Biggest minus? Just because a bunch of stuff is hidden doesn't mean it goes away! Great ASP.NET programmers can crank out Javascript, CGI, and StoredProc code with the best of them. By "helping", Microsoft makes it a real pain to get under the hood and take total control (but it's very possible to do once you get the hang of it)
BTW, your example? You drag a label onto the form, double-click on it and type one line of code in. I'd argue that it only takes one line of code (and about 5 seconds) to accomplish. The rest is framework fluff.
If you really want to torture yourself, pick up a couple of good ASP.NET internals books and make yourself read them. After that, the other problems turn out to be fairly easy.
Glad to help if you need any. Just drop me an email.
The .NET development environment.
Visual Studio is dead simple to install and use. Add-ins have been easy to install, too. (I'm looking at you, Eclipse!) The .NET Framework has great breadth and depth. It integrates well with MS SQL Server. There are plenty of quality 3rd party tools/libraries that work with the stack. API documentation is easy to get to. Building install packages is a snap. Visual designers can make building/understanding components or the database schema easier. Code generation from the designers can fill in boiler-plate stuff yet still leave it visible if you need to dig around in there by hand.
As for ASP.NET WebForms (which is the sample you've given), it was meant to make it easier for Windows Forms developers to do web page design. WebForms imitates the WinForms structure and calling conventions, so you can make a working web page act more like a desktop app in terms of the programming model. Obviously, you run into limitations rather quickly because the WebForms abstraction is very leaky.
ASP.NET MVC would be a good pick for new projects if you are already an experienced web developer. You get all the benefits of the .NET stack without the limitations of WebForms. You get control over the markup that gets generated and it does a good job with separation of concerns. I recommend.
I think it was intended to make it easy for Visual Basic developers (which is a huge market btw) to develop web apps.
Microsoft is also offering some pretty good hosting platforms for startups, and usually you can pick up licenses for low cost. EC2 now is also offering Windows instances for easy cloud hosting.
That said, I've done ASP.NET professionally for about 5 years, and 2 years ago switched to Ruby / Rails / Merb and have found the transition to be a huge improvement. The open source world has a better atmosphere, and I believe better talent overall.
The worst thing about ASP.NET is the corporate culture, where unskilled VB coders adopt it, and use it to build really badly developed websites.
Also, ASP.NET pretty much requires Windows. Trying to develop it on Mono, or on a Mac (with Vmware) is an effort in futility. If you go ASP.NET, make sure you're comfortable with Windows. This was one issue that I had a major problem with. Command line scripting and build tools in Windows are generally aweful. This will limit any good developer's productivity.
In my day job, i use ASP.Net MVC framework because we're an all Microsoft shop. And although i recognize the danger of proprietary systems in the medical field, I am unable to change anything at this time.
Also i find that Microsoft products work best with other Microsoft products so SQL Server with Windows Server 2003 and ASP.Net along with Active Directory and so on...
But, echo'ing the other comments, using a limited metric such as number of lines to implement a feature is a bad idea. Try it out on some application and then you'd be better equipped to dismiss or recommend it.
How many security holes have been found in the asp.net stack vs the php stack? I recall seeing a php security issue on reddit or news.y about once a month (anecdotal of course). But you don't have those problems with asp.net.
Yes php provides simplicity in the language but complexity in the configuration. You have to be pretty handy with *nix to get it all working right. Remember facebook showing all it's code to the world?
Asp.net windows configuration can be easier especially if you have a windows background.
In the end though, if you know php use that. If you know python use that.
- One of the best available development environments (Visual Studio)
- C# is much better for structuring your code base for large teams and long lived projects
- If you're really using a database, SQL Server is way, way better than mysql.
I prefer Rails myself, but I manage a team who prefers .Net, and I can see the advantages.
I agree with other posters, Webforms are horrible and wrong, but MVC could make .Net one of the best Web dev platforms.
Its logical to build upon framework already tested and tried, so coming up with something new would've been a waste of time n resources, whereas the current .net scenario provides nice integration as i notice..
another point that comes to my mind is that -- Things couldn't be kept more simpler than that, as you can't sell simplicity at high price.