PHP vs. ASP.NET Part 2
All alone in a sea of information...
Monday, January 31, 2005 by Zoomba | Discussion: Websites
After the little piece of advice from mick_k, I was able to get a large chunk of my current task done. Now however I'm facing a new problem in my transition from PHP to ASP.NET but this time it has nothing to do with the languages or technology. In fact this is purely an information problem. Namely, where do I go for help?
With PHP, the official site is an amazing resource for how to get functions and commands to work right. Each and every bit of the language has an online manual entry that gives the syntax, the programmer manual definition plus a few REAL examples of how it could be implemented. Then on every entry there is space for user comments where people share their own solutions and implementations. The official reference is a bounty of information that is much more practical than academic. Then there's the flood of online PHP help and resource sites out there. PHPBuilder.com is one of my all-time favorites for its forums and great code library.
The same does not hold true for the ASP.NET, C# or VB.NET MSDN sites. It's all a programmer reference that shows the syntax in cryptic programmer-ese that scares away the casual coder or complete newcomer. Even the official forums and "community" site GotDotNet.com are of limited use. the ASP.NET forums are moderated, you can't even post a question or respond to a question without someone reviewing it and approving it. Makes it take forever for simple questions to be addressed. Their community site supposedly has tons of sample code, but the interface is so cumbersome and the descriptions so vague, that you really have to work hard to find anything related to what you need.
In terms of books for the two. I have the PHP Bible for PHP4 and ASP.NET Unleashed 2nd Edition for ASP.NET. Both have been highly recommended by their respective communities as the best books for anyone learning the language and looking for a good reference book. I can honestly say that ASP.NET Unleashed 2nd Edition does not do the job as well as the PHP Bible does. For one, it assumes you know the chosen underlying programming language (this is a failing of ASP.NET IMO) and doesn't really explain how to work between normal pages and ASP.NET. ASP.NET is great and all, but there are many times you'll likely have to move around with static pages too. The language and writing style of PHP Bible is also infinitely more readable.
Why is it that PHP, a free language and server implementation that has but a small company (Zend) backing it has so many better resources of information that ASP.NET, a language that is supported by Microsoft and ties in to their biggest development initiative in recent memory (.NET) is harder to find good information on? Is it the added layer of complexity when working with ASP.NET that prevents this? In order to do what I'm doing right now I also needed a book on C# to program the logic behind the scenes. C# sites are even harder to come by.
Online resources are incredibly important for developers both new and old. They should be easy to find, and comprehensive in the information they present. To those of you who have worked on either side (PHP or ASP.NET) What are your favorite resource sites and books? What was the greatest help to you when you were first learning?
Spread the joy
Reply #2 Tuesday, February 1, 2005 11:19 AM
Ive never used php, but is there any kind of editor for php kinda like visual studio for .net? Becuase VS.NET helps alot in coding. Also does php have built in controls? I know asp.net does and you can build your own.
ASP.NET hasnt been out as long as php has it? Maybe thats why there arnt as many resources out.
Reply #3 Tuesday, February 1, 2005 1:57 PM
Yeah, PHP has been around longer, but even when comparing the official manuals of each online, the PHP one is far and above better simply because it provides actual examples of how a given function or command works. We're using the PHP reference manual style as a model to fashion an information resource site where I work.
Reply #4 Tuesday, February 1, 2005 6:27 PM
The response to Part 1 here was better than I could have possibly expected. I was given a very simple answer to what I thought was a complex problem based on what every ASP.NET help site out there told me. What my ASP.NET book told me was a page and a half of code to do, a helpful reader (mick_k) showed me was really just one line. I'm a huge fan of collaboration and seeking out knowledge and advice from a community... it makes everyone's life so much easier when they hit a roadblock. |
Very true. This is why I advocate so much for people to have links to favorite articles and posts. It might be a little awkward, but you can search a few user sites to see some real helpful article favorites on their sites.
Your writing about what your going through when the need arises to switch from PHP to ASP.NET is also very helpful to those in the future who might go through the same thing.
This is also why I really want people to be more interactive with the site and why I write those user page articles.
Anyway, that was sort of off topic...
Reply #5 Wednesday, February 2, 2005 12:23 PM
One thing that i liked about about coldfusion is the fuse actions, which made templates possible. Ive yet to make or see anything like that in asp.net 1.1, I know asp.net 2.0 has master files that make it possible. Does php have somthing where you can make one file as the default layout and you can make pages that are included but just telling a different query string, for exmaple...
yada.com?index.cfm?page=main
yada.com?index.cfm?page=second
Reply #6 Wednesday, February 2, 2005 12:47 PM
Reply #7 Wednesday, February 2, 2005 2:05 PM
Reply #8 Wednesday, February 2, 2005 8:33 PM
Reply #9 Wednesday, February 2, 2005 9:30 PM
I myself am a Perl coder, but in the process of learning PHP and ASP.NET. Having been coding in Perl for such a long time, PHP really seems simple, while ASP.NET, on the contrary, is a bit confusing to me.
Really, dynamic web page is very easy: user provides data through a form then submit, script takes the code and rips off all the fields, manipulate a little bit then spit it out. I just don't understand why Microsoft wants to make it so complicated! ...Oh well, that's my own problem I guess.
Also, I've noticed that for the same action, ASP.NET seems to take a little bit longer time than PHP and Perl. I tried to optimize my code but doesn't seem to be effective. I'm not sure but I hope this is not a nature of it...
Reply #10 Wednesday, February 2, 2005 10:07 PM
Reply #11 Thursday, February 3, 2005 1:25 AM
Reply #12 Thursday, February 17, 2005 11:11 AM
Well, let me tell you the #1 "thing" i like about asp.net, and maybe you PHP people can tell me if there is something equivelant.
Caching technologies.
By Simply caching data server side our server is allowed to breath a little bit better now by simply caching certain types of data for merely 1 minute at a time and with a higher profile site, that cached data can be hit hundreds of thousands of time before actually going back to the database to re-cache things.
Asp.net also allows cache callbacks or should i say vb.net and C#. This feature compliments caching because i can do such things like when a cached item expires, a callback will fire and i can have the code automatically refill itself. So theorhetically, the user should never have to wait for a live query to fire, it should just be pulling the data from memory.
Another side feature of asp.net i like is the fact of managed code. So, if one portion of my team likes to write in C#, another in C++ (written in the .net framework), and the rest in vb.net, i can link to their libraries with little effort. I'm sure php has some of these things or similar things built in.
And i will say this, and maybe not be agreed upon by many, but i love visual studio .net. Debugging a web application to me is priceless. I don't have to do things like writing print statements everywhere to see how well my code is running then having to worry if i have any of them left behind. Does php have this? if so that's great. Break points, stepping in and out of methods to me makes the development process much easier and honestly keeps me sane more than half the time. Now i know what your thinking which is "well just write it right the first time and you don't need to debug!" yea great theory, but i am not that seasoned enough to write flawlessly!
The msdn is also easily accessable once installed. Simply highligthing some text then hitting F1 and having explinations and code examples has helped quite a bit.
That's my 2 cents on asp.net as well as the tools provided. Hopefully this helps those who are thinking of getting into it!
Flyin
Reply #13 Thursday, February 17, 2005 3:34 PM
I tent to agree with Zoomba, however in that .NET lacks really really solid tutorials and code examples for the novice .NET coder like myself. I've found it to be more the frustrating learning this particular language on my own. I'm not a guy who loves asking others around me for advice on how to do something (even though this might be the logical solution), so learning a new language like .NET can be quite time consuming. Often, in reality, you can't just ask the guy next to you what the solution is, so you have to rely on some other forms of research. I've found many dead-ends in doing research, only to find that what I wanted to do isn't as possible as I once hoped to do, or it would take a really long time (and some more learning) to do quickly. Most of the time, I’m not even sure where to start, or if the technology even exists to do it.
Hopefully, this will change in time as more and more developers embrace .net technologies, and communities begin reaching out to new .net developers in hopes of answer some of life’s most difficult questions... with real world examples.
George
Reply #14 Thursday, February 17, 2005 3:41 PM
If in the future I puzzle out the table stuff, I'll go back and redo my current application so it is done right. But there's so little of actual use out there to help me, it may be quite a while.
Reply #15 Friday, February 18, 2005 1:09 AM
Reply #16 Friday, February 18, 2005 10:21 AM
Well, my answer to the asp.net controls thing is simple for me, but maybe in other peoples cases not so easy. Lets say you have a form where people sign up to your site. All fields are filled correctly and the data is posted, well for me in asp.net, the values of the fields are all maintained in viewstate while i handle the button click event, if there is something i do not like about the inputted info, i simply throw an exception and report back some errors and i don't have to worry about re-putting back the info they submitted because it's all contained within the viewstate.
I see what your saying, and the example i gave is the very basic one, but let me give you one more that i feel helps me in saving time.
Lets take the repeater control for a moment. Now let me first say i am not the best web designer, we have other resources for that, so when i get a mockup, and need live data applied to it in a repeating fashion, i will use a repeater obviously.
The main "thing" i feel repeater gives me is that i do not have to convert the html into string format using a string builder or appending text onto a string object. I simply wrap a repeater around the key html that will be looped and repeated.
Simple scenario, lets say we want to completely revamp the way we are displaying the data. Well, i would then have to get the mockup back from the design guy, parse it to my liking then put it in string format so that i can display it. Well, if i used a repeater, i don't have to waste time creating strings out of things because the contents remain in the .aspx or .ascx portion not in the code. Also, for those who use vs.net, you get intellisense which comes in handy.
This are my reasons for liking asp.net, i'm sure they don't appeal to all. If i knew more about php, i could make a stronger example, but unfortunately i've only seen a little bit, and from what examples i saw from a live project, it looked like pure spaghetti code, maybe that was the best solution, although i wouldn't know!
Flyin
Reply #17 Friday, February 18, 2005 10:22 AM
(not sure about all of this...) PHP can do caching, but it has to be coder-implemented; not an automatic thing. For example, one method would be to output an HTML file every 2 hours (or whatever time you choose) and load that instead of grabbing everything from the database again. I know there are better methods for caching in PHP that do exist, but I'm afraid I don't know much about it. |
right, but again, all scripting languages have this capability, that's in the eyes of the coder. But like you said i'm sure they have something!
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!
Reply #1 Monday, January 31, 2005 1:49 PM
Link
It's Code Newbie and has various forums for different computer languages. There are a few basic tutes and I have always found it to be a friendly place.