![]() |
![]() |
#1 (permalink) |
Follower of Ner'Zhul
Location: Netherlands
|
[ASP/PHP] Switching from PHP to ASP.NET
Any PHP programmer here that switched to ASP.NET or have sufficient experiance with both?
Right now all my experiance with server side scripting is with PHP, which I love, but I want to do the 'evil thing' (especially seeing as I am posting this with Konqeror on my RH desktop while upgrading it to Fedora ![]() So how much are they alike? Where do they truly differ? What are some good resources (books/websites/forums/mailinglists/etc) for a n00b ASP.NET guy with PHP experiance? Also is there a way to get a RH server with Apache to properly parse ASP.NET? I heard there was a special piece of software that made this possible, but that was for a Win32 environnement...
__________________
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. - Nathaniel Borenstein |
![]() |
![]() |
#2 (permalink) |
Crazy
|
try here.
http://msdn.microsoft.com/asp.net/us...g/default.aspx As far as running ASP.NET on a RH server. Check into the MONO project, I think they are close to having ASP.NET running under Linux. http://www.go-mono.org |
![]() |
![]() |
#3 (permalink) |
Tilted
|
Working with both PHP and ASP.Net...
ASP.Net is different. Microsoft wants you to do a lot of things with their server controls, which requires frequent post-backs to the server. It's easier to set things up, but the performance is worse. And you can bang your head against the wall a lot as there are just some things the framework doesn't want you to do (such as post your server-control-using form to a different page) If you don't want to use Microsoft's server controls at all, and are fine with doing all the HTML by hand, then it's pretty much the same as PHP, but then you get to the question of: why bother? |
![]() |
![]() |
#4 (permalink) |
Insane
Location: Michigan
|
I pretty much only use ASP.net now (using c#) and unlike one of the other posts, it is so much better than PHP and even ASP, IMHO.
First, there is no good editor for php that has the "auto-complete" code. Sure, "REAL" developers don't need it, but it speeds up the development process. With ASP.net (if using Visual Studio.net), debugging is simple when it comes to testing your apps while PHP only has Zend (as far as I know) and Zend is a bunch of crappy slow code. I've used it and decided that notepad is a better php editor. Second, with php, to do a wizard, for example, you have mypage1.php, mypage2.php, mypage3.php. 3 pages of code/html that you can use panels in ASP.net and just set panel 1 visible when needed, 2 when needed, etc. Sure, you can put all your code in 1 php file, but try to read it as a new developer on the project and understand it. If you do this with 1 php file, you have to have something that states what step you are in, just one more variable to have to track all over the damn place. Thirdly, ASP.net is compiled when you deploy it. Sure, there are decompilers, but you can reverse engineer just about anything if you are good enough. PHP? Only Zend (again, crappy, buggy, slow software) can compile your php so some dumbass on your server can't copy your work. Then there is displaying raw data. You can use a datagrid, datalist, repeater, etc. If you do your code right, you can display a table from a database in 5 lines of code. PHP? Not a chance, you have to do loops and echoing html back to the browser. PHP has it's uses, but sorry, ASP.net is nice. The #1 reason to use ASP.net? If you need any application/services support, your apps and site can use the SAME CLASSES (example: a credit card charge routine, adding a customer to your database, etc). Try making a reliabe service for Linux out of PHP. |
![]() |
![]() |
#5 (permalink) | |
Crazy
|
A Correction and some more technical details.
Quote:
ASP.NET also supports a code-behind model, this allows the developer to put the inline ASP.NET code in a separate physical file. All of the code-behind pages for an ASP.NET application can be compiled into a single DLL and distributed along with the ASP.NET web pages. The web pages are still compiled automatically on first access, but if you are only changing the code behind code, usually where the business logic for an application is kept, you can just distribute the compiled code behind dll. The web pages will be re-linked to the code-behind dll. ASP.NET 2.0 will allow you to pre-compile the ASP.NET web pages. The biggest advantages ASP.NET has over PHP is the event-driven model and the viewstate model. Instead of having to write code to detect which button the user pressed, you wire the event handlers for each button to the button they handle. ...HTML code... Code:
<asp:button id="myButton" runat="server" text="click me"/> <input type="text" runat="server" id="txtBox"/> Code:
public void myButton_OnClick(object sender, System.EventArgs e) { Response.Write("changed the text"); this.txtBox.Text = "changed text"; } edited: because CODE tags are cool |
|
![]() |
Tags |
asp or php, aspnet, php, switching |
|
|