C# Vs PHP

Started by
15 comments, last by H0bbes 19 years, 10 months ago
I like to know how is the better language to do a web page. C# is more easy to programming(in my opinion), but i don''t know if c# is more slowly when page is run. Or if is better to programming with PHP because is free and is more faster when tunning. what you advise me? I like to know is someone else can help me. Thamk you.
Advertisement
I have no programming experience with PHP, but I do know this:
1. PHP is free, ASP.NET is not free.
2. PHP is faster than ASP.NET.

tommy online: http://users.pandora.be/tommycarlier

[edited by - Tommy Carlier on May 25, 2004 5:47:00 AM]
quote:Original post by Tommy Carlier
2. PHP is faster than ASP.NET.


Do you know +/- the diferrence os speed between (PHP and ASP.NET)

And tnhak you to help me

No, I don''t. But I do know it can sometimes be a significant difference.

tommy online: http://users.pandora.be/tommycarlier
Actually, you can get ASP.net for free. Do a google search for "web matrix". It is a WYSIWYG(What you see is what you get) IDE that supports database operations, c# and vb(as well as some other languages) integration for free.
"What are you trying to tell me? That I can write an O(N^2) recursive solution for a 2-dimensional knapsack?" "No, programmer. I'm trying to tell you that when you're ready, you won't have to." -Adapted from "The Matrix"
Seriously guys, at least know something about the topic before giving a definitive answer

ASP.Net is most definitely free. What is not free, is Microsoft''s IDE for .Net development, Visual Studio.Net. But you don''t need that. As the last poster said, look for webmatrix. you can find it at www.asp.net.

Additionally, PHP is an interpreted language (I think?) and anything written for the .Net framework, i.e. ASP.Net and C#, is fully compiled. I think you''ll find that as a result, an ASP.Net website will most definitely run faster than a PHP website. Of course, a very badly written ASP.Net website could well run slower than a very efficiently written PHP website.

If you''re anti-Microsoft, then you still don''t have an issue because C# was released as an open specification and a full open-source implementation of the .Net framework is available (although under continual development). It is called Mono, and you can get it here.

Snowman | Ardaxus | Nathan

Snowman | Ardaxus | Nathan
quote:Original post by H0bbes
quote:Original post by Tommy Carlier
2. PHP is faster than ASP.NET.


Do you know +/- the diferrence os speed between (PHP and ASP.NET)

And tnhak you to help me



Usually people (especially beginners) choose something out of the blue that sounds cool, and defend it any way they can. How exactly an interpreted scripting language can be faster than (JIT-)compiled C# programs remains to be seen.

By the way, only beginners choose tools purely based on what is ''fastest''. Like with anything, speed depends much more on your design and programming skills than on the tools used.
PHP can also be compiled with some extra tools, but yes, ASP.NET code will always be compiled and not interpreted.

Unless you're going to be having tens of thousands of hits per second or doing huge computations in each page, it probably won't be noticeable anyway.

[edited by - Matei on May 25, 2004 8:30:03 AM]
Interpreted languages can be faster than compiled/jitted languages: depends on both the interpreter and the compiler.

The speed of PHP/ASP.NET depends on the speed of the underlying webserver. I don''t know if you can run ASP.NET on webservers other than IIS. I do know that IIS is not the fastest webserver. Apache running on Windows is a lot faster than IIS. Apache running on Unix/Linux is even faster.

BTW: I''m not anti-Microsoft, and I don''t even use PHP. At work, I make C#-programs (rich client/server: Windows Forms-client + ASP.NET/IIS-server).

tommy online: http://users.pandora.be/tommycarlier
I use ASP.NET for some time now and would never go back to php for several reasons:
- a compiled language supports compile time error checking
- ASP.NET is way easier to debug than php
- C# is typesafe
- true object oriented programming.
- you actually build web-applications rather than scripting some spaghetti-code (and don't tell me that php does NOT encourage/enforce a "debatable" coding style).
- separating code from layout is much easier (code-behind)

Of course, ASP.NET has some flaws for example:
- only one form per page can be runat="Server"
- ASP.NET needs a compatible server/webspace, those are not that common yet
- as the IIS stops ASP.NET application after a while, it sometimes takes a while to restart the application. Check gentlestorm.de, it might take some time before the first page appears, due to the fact that it is not visited regularly and thus stopped by the server. You will notice however, that from the second click on the page will be fast.

Still something about speed: as most bigger websites use databases, the speed of the language used does not matter that much. The database access will always take longer than interpreting the page. However, the overall serverload for interpreted websites might be larger than that for non-interpreted.

Regards,
Andre Loker

[edited by - VizOne on May 25, 2004 9:58:27 AM]
Andre Loker | Personal blog on .NET

This topic is closed to new replies.

Advertisement