Jump to content
sunstallion

PHP vs ASP.NET

Recommended Posts

First, I do not know what forum to post this topic. So, I will post it both here and in the PHP forum. I am wanting to learn either or both PHP and ASP.NET for fun and for jobs. Do you know which one is better ? which one is more marketable ?Well, I want to learn to get a job, but in the mean time at home, I want to put the extra time to speed up my skill in the same technology. So, should I rather focus on only PHP or ASP.NET or both ? Thanks

Share this post


Link to post
Share on other sites

As far as which will get you a job better, that can only be answered by you. What is the job market like in your area? You should keep yours eyes open on local job ads to see what employers want. Here (Nova Scotia) , for web development jobs, the biggest demand is for J2EE and ASP.Net and there is very little demand for PHP.And for programming jobs it is C/C++ and .Net (C#).As far aa which is better? Well that again depends. I think ASP.Net is great because it is compiled and I can hide my source code even if I distribute the program. PHP is very easy to write and I use it for small personal projects and use ASP.Net at work and for larger projects.Another plus for ASP.Net is the line of Express tools that allow error checking easily and intellisense. Also there is a growing market for ASP.Net Controls (treeviews, grids, etc) that are making development much easier.I watch a video tutorial yesterday morning on AJAX.Net. In 10 minutes (literally, I am serious) The guy had written (by hand from scratch) a web, ajax enabled, interface to insert and edit database records.

Share this post


Link to post
Share on other sites
I watch a video tutorial yesterday morning on AJAX.Net. In 10 minutes (literally, I am serious) The guy had written (by hand from scratch) a web, ajax enabled, interface to insert and edit database records.
Show us the video tutorial :)

Share this post


Link to post
Share on other sites
Makes a strong case for PHP5....if only it would compile! That is a huge thing for me. Protecting your source code when distributing for applications. Plus .Net libraries can be used for Web or Windows Apps.

Share this post


Link to post
Share on other sites

just watched that video, usually i'd use PHP and JS to do things like that, but it would take me like an hour at least!i'm going to learn ASP.NET .. obviouslly im assuming i'll need to learn ASP first? .. but .. my webserver doesn't support .NET framework (unless i give them more money) .. can i download the .NET framework to my computer and just run some files of it whilst i learn?and also something i don't know much about, in that video, he creates an SQL database just by clicking. are they stored in files or something? and how would he go about getting them onto the web if say he had an account with a webserver company that supported .NET framework?-Thanks

Share this post


Link to post
Share on other sites
i'm going to learn ASP.NET .. obviouslly im assuming i'll need to learn ASP first? can i download the .NET framework to my computer and just run some files of it whilst i learn?and also something i don't know much about, in that video, he creates an SQL database just by clicking. are they stored in files or something? and how would he go about getting them onto the web if say he had an account with a webserver company that supported .NET framework?-Thanks
You do not need to learn asp first to learn asp.net but it would help you out a bit if you knew it.Yes you can download .NET Framework and start making .net applications on you computer if you have iis installed. (search .net framework on microsoft.com)SQL Databases are not like "Access" for example. MSSQL is a database on your hosting companys computer and you connect to into via an ip, username, password and send commands to update it, or use a sql tool to connect and modify on the fly.

Share this post


Link to post
Share on other sites

actually learning ASP first will teach you bad habits when moving to .Net. You are incuraged to use the OOP style of .Net as apposed to the procedural style of ASP.

Share this post


Link to post
Share on other sites

Going for PHP:

  • Its totally opensource (it runs on apache or IIS)
  • It's more common than ASP (in terms of raw number of websites using it)
  • It's easier to learn from HTML
  • It comes in XAMP (the only really easy to configure server)
  • Most free CMS systems use it
  • MySQL is really easy to use with it.
  • It runs on linux

Against PHP:

  • It's butt ugly ($ gets old really fast).
  • It's only for the web (yes technically you can run it on something else, and technically you can run linux on my microwave. But neither is very useful).

For .Net

  • It's clean, in 2.0, with partial classes and code-behind separation of code and HTML.
  • It's usually, if well written, a hair faster than comparable PHP.
  • Visual Studio can write around 50% of it for you, saving you months of time.
  • Visual Studio Pwns notepad.
  • C#, VB, and Managed C++ work either in ASP.Net (web) or on your Machine.

Against .Net

  • It doesn't run on linux (meh...so ok there's mono, but who's going to trust a major web enterprise with that? I mean besides Novell.)
  • Without Visual Studio, it's really, really hard.

As for ASP:ASP and ASP.Net are remotely related, but the relationship is not a really close one. ASP is its own language. ASP.Net simply refers to the idea of IIS running stuff on the CLR to generate pages. You do not have to know ASP to learn ASP.Net, and like aspnetguy, I also discourage it, since it teaches some very, very bad habits (like lack of code separation, and total unmaintainability).MSSQL:M$'s SQL database server. The express edition is free and will do everything that anyone could need unless their company has over 100 employees. Period. Is usually considered faster and more secure than MySQL, though this is not absolutely true. Only runs on windows.SQL has nothing whatsoever with Access databases, which are all but totally outdated and reserved to the role of backwards compatibility support. Do not make anything with them, use either XML or SQL (or Oracle I IIS:M$'s webserver. Comes with windows, however, the new version, IIS6, which is the only one to run .Net 2.0, only comes with server 2003, which bites.//Matt

Share this post


Link to post
Share on other sites

WAMP is also a all-in-one webserver, not sure how easy it is to use.You can run ASp.Net 2.0 on IIS5.1, not sure about 5.0, although you are limited to 10 concurrent connections which also bites.The fact that IIS6.0 is only for winServer isn't that big of an issue, just buy hosting space, usually the same or only slightly higher than linux/php hosting.

Share this post


Link to post
Share on other sites
Here (Nova Scotia) , for web development jobs, the biggest demand is for J2EE and ASP.Net and there is very little demand for PHP.And for programming jobs it is C/C++ and .Net (C#).
Yes, I here of a lot of people in to C/C++ & C#.Especially in my family and friends, I'm still so young though, so not me. Maybe someday though I'll be like the rest. I here further out like Lunenburg(Honeybee Studios) and places like that have a lot.

Share this post


Link to post
Share on other sites

yes, I would love to work for a place like HB, I have been slacking on my C++ practice...I need to get back into it.

Share this post


Link to post
Share on other sites

Right now though, JAVA has been my goal, and I am taking a course from Fanshawe in January. I've never really dealt with OOP so this will be new, and confusing to me.

Share this post


Link to post
Share on other sites

I've heard of Flex before, I thought it was Flix at first, but it has some sort of connection with AS3?

Share this post


Link to post
Share on other sites

XAMP= X (os)+ Apache + MySQL + PHP. XAMP in a generic term which includes both WAMP and LAMP.C++ as a web language is not where it's at. while it is certainly possible to use Managed C++ (which, frankly, isn't even real c++ anymore) under .Net (in fact it's possible to run Cobol under .Net and use it if you like), it was not designed for that purpose, and is thus a bit counterproductive. C# and VB are much better options in this sense.

Share this post


Link to post
Share on other sites

Can you elaborate on "Managed C++ isn't really C++ anymore", I am fairly new to C++ and am not sure what that means.

Share this post


Link to post
Share on other sites

I like PHP too but it can't beat the logic and presentation seperation that ASp.Net offers.Why does it look ugly to you? C# is based on C/Java (PHP is based on C) or you can use VB plus it offers and always has offered superior OOP.I do agree however that ASP is horrible...it is a waste of time for anyone new to learn it, IMO.

Share this post


Link to post
Share on other sites
First, I do not know what forum to post this topic. So, I will post it both here and in the PHP forum. I am wanting to learn either or both PHP and ASP.NET for fun and for jobs. Do you know which one is better ? which one is more marketable ?Well, I want to learn to get a job, but in the mean time at home, I want to put the extra time to speed up my skill in the same technology. So, should I rather focus on only PHP or ASP.NET or both ? Thanks
I programmed in PHP a long time ago, back in the early days of PHP3 and PHP4.PHP is good because its easy to install, its cross-platform compatible, and its free.It lets newbies connect to a database in a single line of code with its mysql_* family of functions, but as a consequence it lacks a data abstraction layer such as ADODB or <asp:sqlsource> found in other languages (I don't consider that good programming practice). It has some nuances that encourage bad programming habits, such as not requiring variable declaration before using them, lacking datatypes. It has some odd features like magic_quotes and register_globals that reduce code portability and open security holes. It also has some unintuitive typecasting, for instance:
if ((string)"false" == (int)0) echo "true\n";// returns true for some reason

To fix that problem, you have to use the triple equality operator, ===, which is just strange syntax.I made the switch from PHP to Classic ASP for a few reasons:- PHP variable don't need to be initialized before use. With ASP, you can force variable declaration by including <% Option Explicit %> at the top of every page. With .Net, you're required to declare variables before use.- PHP arrays are very slow, and software I write tends to be very array dependent. I learned a while ago that PHP arrays are really balanced trees that emulate an associative array, its a very different data structure than a linear array. An array is really a key/value pair, and $array[1] isn't the first element in an array, its a key/value pair where the key is "1". I consider that a disadvantage for two reasons. You get a little flexibility out of PHP's "array" syntax, but you pay a performance penalty. In Big O notation, php "arrays" execute in O(log n) time for any array lookup, whereas arrays in every other program execute in O(1) time (<--- best case performance). ASP and .Net arrays are linear arrays, so lookups occur in O(1) time.- Regex in ASP is easier.PHP has some major advantages over ASP when it comes to important functions like sending mail, uploading, manipulating images. With Classic ASP, you need to use COM objects for those purposes, which means you either have to buy those objects or hope they are included with your host. PHP's has those functions built in.I made the switch from ASP to ASP.Net for lots of reasons:- Code behind rocks. Less spaghetti code.- Compiled code helps to hide your source code from other developers who use your product. Compiled code also runs faster.- I write about 90% less code than I did before. Especially with VS.Net, I can create entire database-driven, AJAX-enabled sites without having to write a single line of code, those functions are encapsulated in the .Net controls.- Regex is EXTREMELY powerful: balanced expressions and named captures are a godsend. If you don't have a lot of experience working with Regex, or you've never tried to parse text with nested code, then you can't appreciate just how powerful the regex engine is.- Good XML support.- Try/Catch blocks are MUCH better than "on error resume next".- Lots and lots of namespaces for handling common functions like MD5 and SHA512 hashing, generic functions (similar to C++ template<t> structure).- Some web controls intrinsically support membership. The most challenging part of programming large websites is handling user accounts, user roles, security; .Net does it for you, and it saves you A LOT of time.- Very good object-oriented language, and the controls respond to events (like "click" events, "state changed" events, etc.).ASP.Net lets you use VB.Net, C#, J#, and a lot of other languages, but I prefer the Visual Basic flavor as my default language because blocks of code are easier to read than curly braces. A "}" can mean "end while", "end if", "end sub", "end function", but but "end if" only means "end if". Also, C#, for whatever reason, doesn't allow programmers to functions with optional / default parameters; that ability is maintained in VB.net. I like being able to declare optional parameters rather than a bunch of overloaded functions, so I stick VB.net for convenience and readability.There are a lot of plusses to ASP.net, and the future of all web development is moving in a .Net direction. So, saying that you know PHP and .Net looks good on a resume, but I generally think .Net is the best choice for developers.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...