c# or PHP?

DCT Jared jsmith at datacaptech.com
Tue Feb 17 17:19:21 CST 2004


>Im faced with a conundrum here.  My job is requiring 
>me to learn some sort of server side scripting language 
>for web development.  Were flexible on what platform
>will be used, to a point.  Im planning on learning both
>eventually, but thats a ways in the distance.  My question
>is, which would be better to learn first, c#, or PHP?  Is there
>any chance that in the future c# will make PHP obsolete, 
>especially with Mono progressing so well?

This is a very good question, and I do not think there is a
definitive answer.

1. C# will not make php obsolete any time in the next 
decade. C# and php cover different domains, and php's
popularity is because it handles its niche extremely well. 
ASP is in the same niche as PHP, and although ASP is 
a solid language, it is not cross-platform like PHP so 
ASP will always lose on that front.

2. http://www.tiobe.com/tpci.htm

This website is a great resource for giving solid data
on these kinds of questions: It ranks all programming
languages, and shows their delta over time so you can
see whether they are growing or decreasing in popularity.
(PHP has a solid position, currently above C#.)

3. Netcraft shows that PHP is not slowing down any time
soon:

http://www.php.net/usage.php

4. PHP5 is a great leap forward for PHP, giving it much-
needed object-oriented credibility. Its incorporation of TinySQL
is proof that PHP is still targeting very speedy delivery of
web pages. The php Smarty Templates are very powerful, 
and there are at least a dozen very solid application 
frameworks built for PHP. I personally have used PHP to
build quite a large application, managing all of Butterball's
turkey production, and know that it is useful for more 
than just serving webpages, and has the advantage of
"working just like your browser at home," decreasing
training issues.

5. PHP is an Apache project, meaning that as long as
Apache is around, PHP will be around, and Apache is still
the world's most popular webserver.

=========================================

Those are answers to the PHP-longevity question. As for
which language of the two you should learn first?

1. C# is part of the Microsoft solution. It is cross-platform
because of Mono, but Mono is not yet finished, and it will
be much more solid in about 12 months. If you want to
get right into the development of Mono, dive in now. I am
personally holding off for about another year because I
am not that good of a programmer yet.

2. PHP is not as mature as Perl, but it can still handle
anything http-based you want to throw at it. However, you
have to learn or know HTML in order to use it, which
to some people is like learning two languages at once.
If you are already competent with HTML, I recommend
starting with PHP, because it will flow intuitively.

3. C# is very solid for anything MS-based, and increasingly 
solid for all other platforms. It can handle far more than
PHP's httpd-centered focus, and is a good introduction to 
C++, which is even more powerful.

4. C# comes with a very well-designed IDE, and it will be 
easier to learn how to code in that language. However, 
Nusphere's phpEd is a decent PHP IDE, and Zend puts 
out a nice Java-based one, too, so C#'s lead is only marginal.
The fact that you can drag-n-drop design your forms 
(instead of handcoding them in HTML) makes this lead 
more than marginal, if you do not know HTML.

5. Both PHP and C# come with their communities attached.
One is Open Source and the other is Microsoft (even given
Mono's Linux ability). I personally recommend going toward 
the Open Source route because of its inherent cross-platform 
mindset, whereas for Microsoft they always want to lock you 
in to a MS-centric solution, even if only subtly and over time.

======summary======

If it were me, I'd start with PHP and then learn C#. But I
deeply love HTML, and have since about 1989 when it wasn't
even known as HTML. If I didn't know or love HTML, I'd probably
start with C#, fearing that I might never learn PHP or the joys
of Open Source programming.

-Jared




More information about the Kclug mailing list