.NET/C# versus PHP

M

Michael B. Trausch

First of all, 108M websites is nowhere near all the websites in the
world. Second, there is no way to keep up with the websites - too
many go up and down daily. So right there it is a lost cause. Their
sample is inaccurate.

As a side note, web sites does not equate to servers. So they are
off again.

The "statistics" are 100% meaningless.

A single survey might be.

But the data over time speaks volumes, even if it is incomplete. And
knowing that it is incomplete means that you can (loosely) figure for
that: if you're using that data, you are either curious, or you are
looking for a very rough sense of what Web server software you may want
to use (for example). Also, looking at how spikes between various
servers correlate with inverse spikes with others is interesting, and
speaks a lot even if, again, the survey isn't 100% complete.

--- Mike
 
M

Michael B. Trausch

STATEMENT RETRACTED (read the introduction of a google hit and
replied) After submitting went back to re-read it and it was some
sort of April Fool's prank. :-( Need to do more in depth research
before replying.. My apologies.

No worries.

--- Mike
 
P

Pavel Minaev

You are talking about *very old* versions of PHP.  Neither of them has
been acceptable for *years*.  They've only been there for compatibility
purposes.

I know that my other examples are outdated. However, they are still a
part of PHP language evolution, and show the overall direction in
which it took place: quick & dirty over methodical & correct, at every
point.

You mean, a PHP program today still doesn't start with "<?php", end
with "?>", and the templating engine isn't the core and most in-your-
face part of the language?
And placing arbitrary code snippets embedded in to markup is one of the
big *advantages* of PHP - not a disadvantage!  It's much better than
having to use print statements to output stuff that never changes.

It's better yet to do proper model/view separation, so that you don't
need to mix up code and markup at all... and even in PHP land there
are dozens of MVC frameworks that let you do that (and last I checked,
it was generally considered the Right Way to do things even there).
Problem is, if one don't know about them, it's too tempting to just
scatter code around markup, same as back in ASP/JSP days.
I believe I've worked on much larger projects than you ever dreamed.
Try > 100 programmers for 4 years, in England and the east and west
coasts of the U.S. (3 groups).  Ever work on projects with > 4M LOC
written in 370 Assembler?  I have.  Ever manage projects with 25
programmers for 2 years?  I have.  Shall I continue?

Your credentials are most impressive, and so is your experience.
However, those aren't in and of themselves arguments in a discussion.
The only reason why I mentioned that I had first-hand experience with
PHP was that you asserted that I "do not know what I'm talking about".
And in many of those we had no framework - there weren't any.  But it
was still easy to make things work properly.  We had programming
guidelines and code reviews.

From my own experience, neither guidelines nor reviews are panacea.
I've worked in companies which had both, very much formalized, and yet
the code that ended up being written was only so-so.

And, of course, it still takes more time to review and correct messy
code than it takes to review and correct clean code. As a simple
example: when reviewing C++ code, you have to look for simple new-
without-delete memory leaks, but also more subtle things such as
vector<auto_ptr>, or C-style cast that ends up being reinterpret_cast
rather than static_cast and breaks things, or signed/unsigned
arithmetic mixup that ends up with non-obvious type... the list can go
on and on. When reviewing Java or C# code, none of those are issues,
so no time needs to be wasted looking on them. Are there other, Java/
C# specific problems? sure, but on the whole, it gets rid of more than
it introduces.
People have become too dependent on frameworks, IMHO.  They help mundane
programmers remain mundane.  Good programmers are good without them.

Oh, I see where you're coming from now.

Well, what can I say... if you can get an all-star team of a dozen
developers, then, sure, you can do well with pretty much anything.
When it happens, I guess it's entirely reasonable to go for whatever
toolset those developers feel most comfortable with.

But that is, shall we say, not a very frequent occurrence. High-level
languages and frameworks appeared for a reason.
Then you really don't know what you're talking about.

I would appreciate if you'd refrain from personal attacks. You do not
know what I know about, and what I don't.

For one thing, that I worked on PHP a while ago doesn't mean that I
don't keep an eye on the platform since than. Among other things,
language design theory is my hobby, so at least as far as languages
go, I try to keep up with everything that's still alive and breathing
(and then also some that isn't).
So?  It's still being marketed by Microsoft, and still active on many
platforms.

There are many legacy solutions that are still marketed for niche
applications by companies. They're still legacy.

At any rate, VBScript (or plain ASP in general, regardless of the
language) hasn't been marketed for years now, and VBScript for system
scripting has been superceded by PowerShell, which is over 2 years
old.
Let's see... C# comes to immediate mind.  A lousy attempt to fix things
which weren't broken.

If you want to debate the relative merits of C# vs whatever is your
favorite language, I'm sure we can do it in a separate thread (and in
a civil manner).

For this thread, let me clarify - so you imply that PHP, as a
language, is better designed than C#?
If so, it might be constructive to give some specific examples of
where you believe C# is flawed, _compared to PHP_. (and then we'll
also stay more or less on-topic)
I said nothing about Perl, Python or Ruby.  Don't put words into my mouth.

My original point was that there is no point of choosing PHP over
Perl, Python or Ruby for any reason. You replied that "the biggest
difference is that Zend is working to correct those flaws". I don't
know how else to interpret that; if I've got it wrong, I apologize,
but then please go ahead and explain what you've meant.
Every language has flaws.  Just different languages have different ones..
  There is no perfect programming language.

Indeed there isn't one, but that doesn't mean that some languages
aren't objectively better than others in general, and for a specific
purpose in particular.
 
R

rush

Personally, I love typeless, dynamic languages and think better
outside the rigid typed OO structure of Java and C#.  It does take
more discipline to code well in php, ruby, or python but I find it's
much easier to cement myself into outdated practices using a strongly
typed language.

Take a look at the Seaside/Smalltalk combo you may find it interesting
since it gives nice full OO approach backed by strong OO language
(Smalltalk).

rush
http://www.cloud208.com/
 
U

Ulf Kadner

rf said:
The vast majority of web servers run linux. .NET does not run on linux.

Sure. Its called Mono. You can use ASP.NET by Linux or Windows.

Regards, Ulf
 
U

Ulf Kadner

Pavel said:
No matter what else, .NET is definitely not slower that PHP. In every
sense.
ACK

If you need it cheap and quick and dirty, use PHP

Thats a stupid answer! Sorry. But not PHP is dirty. Most of the many
PHP-Coders make it dirty.

Best regards, Ulf
 
J

Jerry Stuckle

Michael said:
... and the argument that a sample must be biased one way or another,
regardless of how much coverage that sample provides, is used by
someone on nearly everything where samples are taken to try to debunk
information that winds up becoming well-known.

It may not be "valid," IYO, but I challenge you to find a more accurate
sampling of data for the Internet. Being that is not likely, the
Netcraft Web Server Surveys are about the best available data one can
use to see what the Internet looks like from a WWW perspective.

--- Mike

And the argument that a sample is unbiased is used by people who agree
with the results.

I didn't say whether the sample was biased or not. I said it was
scientifically invalid - which it is. Therefore, the results are invalid.

Whether there is a "more accurate" sampling or not is also immaterial.
Lack of something "more accurate" does not make this accurate.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
J

Jerry Stuckle

Michael said:
A single survey might be.

But the data over time speaks volumes, even if it is incomplete. And
knowing that it is incomplete means that you can (loosely) figure for
that: if you're using that data, you are either curious, or you are
looking for a very rough sense of what Web server software you may want
to use (for example). Also, looking at how spikes between various
servers correlate with inverse spikes with others is interesting, and
speaks a lot even if, again, the survey isn't 100% complete.

--- Mike

Garbage-In-Garbage-Out.

Not at all. The data are scientifically invalid for a number of
reasons. Therefore the results are just as invalid. So you can make
whatever conclusions you want - they will still be garbage.

Also, a survey does not need to be complete to be accurate. But it does
need a representative sample - which this doesn't have.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
J

Jerry Stuckle

Pavel said:
I know that my other examples are outdated. However, they are still a
part of PHP language evolution, and show the overall direction in
which it took place: quick & dirty over methodical & correct, at every
point.

Your outdated examples are worthless and degrade your credibility.
You mean, a PHP program today still doesn't start with "<?php", end
with "?>", and the templating engine isn't the core and most in-your-
face part of the language?

You mean a VBScript program or java scriptlet doesn't start with <% and
end with %>?

This is one of the ADVANTAGES of PHP. You can intermix it with the
html. And I don't know what you mean by the templating engine being
"the core and most in-your face". It's an interpreter which processes
the scripts. Nothing more, nothing less.
It's better yet to do proper model/view separation, so that you don't
need to mix up code and markup at all... and even in PHP land there
are dozens of MVC frameworks that let you do that (and last I checked,
it was generally considered the Right Way to do things even there).
Problem is, if one don't know about them, it's too tempting to just
scatter code around markup, same as back in ASP/JSP days.

In your opinion. Others have different opinions.

You can easily do MVC with PHP. The difference is that PHP gives you
the option. You aren't required to use it for everything.

But the ability to scatter pieces of code around is also an advantage.
Your credentials are most impressive, and so is your experience.
However, those aren't in and of themselves arguments in a discussion.
The only reason why I mentioned that I had first-hand experience with
PHP was that you asserted that I "do not know what I'm talking about".

You're the one who brought the subject up. And now you're saying it's
irrelevant? You're beginning to sound like a troll.
From my own experience, neither guidelines nor reviews are panacea.
I've worked in companies which had both, very much formalized, and yet
the code that ended up being written was only so-so.

Then they didn't implement the procedures correctly. Properly
integrated into the process, the procedures work. But too many
companies only give lip service to it.
And, of course, it still takes more time to review and correct messy
code than it takes to review and correct clean code. As a simple
example: when reviewing C++ code, you have to look for simple new-
without-delete memory leaks, but also more subtle things such as
vector<auto_ptr>, or C-style cast that ends up being reinterpret_cast
rather than static_cast and breaks things, or signed/unsigned
arithmetic mixup that ends up with non-obvious type... the list can go
on and on. When reviewing Java or C# code, none of those are issues,
so no time needs to be wasted looking on them. Are there other, Java/
C# specific problems? sure, but on the whole, it gets rid of more than
it introduces.

Which has nothing to do with the language. You can write clean code in
any language, and you can write messy code in any language.

Sure, you need to look for those things in C++ - each language has it's
own things to watch for. No, they aren't problems in C# or Java - but
then those languages are more limited than C++, also.
Oh, I see where you're coming from now.

Well, what can I say... if you can get an all-star team of a dozen
developers, then, sure, you can do well with pretty much anything.
When it happens, I guess it's entirely reasonable to go for whatever
toolset those developers feel most comfortable with.

But that is, shall we say, not a very frequent occurrence. High-level
languages and frameworks appeared for a reason.

You don't need all-star programmers. You just need programmers who know
good coding practices and practice them. Those programmers can use the
frameworks or not - and still write good code.

Frameworks are great crutches for mediocre programmers, however. They
allow even the worst programmer to write crappy code which runs.

Now I'm not saying that frameworks are bad - I use them myself.
However, they are only a tool which, like many tools, are misused all
too much.
I would appreciate if you'd refrain from personal attacks. You do not
know what I know about, and what I don't.

For one thing, that I worked on PHP a while ago doesn't mean that I
don't keep an eye on the platform since than. Among other things,
language design theory is my hobby, so at least as far as languages
go, I try to keep up with everything that's still alive and breathing
(and then also some that isn't).

By your own words, you have no recent experience in PHP. "Keeping an
eye on it" is not the same thing. Therefore, you have no idea what has
changed. Your own words validate you don't know what you're talking about.
There are many legacy solutions that are still marketed for niche
applications by companies. They're still legacy.

At any rate, VBScript (or plain ASP in general, regardless of the
language) hasn't been marketed for years now, and VBScript for system
scripting has been superceded by PowerShell, which is over 2 years
old.

So? It's still being used and still being supported. And last I saw,
VBScript was anything BUT a niche market. There are millions of sites
out there using it.
If you want to debate the relative merits of C# vs whatever is your
favorite language, I'm sure we can do it in a separate thread (and in
a civil manner).

You brought the subject up.
For this thread, let me clarify - so you imply that PHP, as a
language, is better designed than C#?
If so, it might be constructive to give some specific examples of
where you believe C# is flawed, _compared to PHP_. (and then we'll
also stay more or less on-topic)

No, you've already shown that you aren't worth my time. You bring up
subjects about which you know little and then dismiss things as
"irrelevant" - as you have twice in this thread. You also claim to be
able to get valid data from garbage.

I'm not going to waste my time on such nonsense.
My original point was that there is no point of choosing PHP over
Perl, Python or Ruby for any reason. You replied that "the biggest
difference is that Zend is working to correct those flaws". I don't
know how else to interpret that; if I've got it wrong, I apologize,
but then please go ahead and explain what you've meant.

Then I missed your point. And sure, there are reasons for choosing PHP
over other languages. Just like there are reasons for choosing ANY
language.
Indeed there isn't one, but that doesn't mean that some languages
aren't objectively better than others in general, and for a specific
purpose in particular.

Yep, and PHP is pretty good at what it does.

But I'm done with you, for the above reasons. I'm not interested in
having a discussion with someone such as you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 
T

Todd Carnes

Pavel said:
Just for the record - the specific numbers are ~30% for IIS (which is
obviously all Linux), and ~60% together for Apache (which is

IIS is Windows.
 
A

Arne Vajhøj

Jerry said:
First of all, 108M websites is nowhere near all the websites in the
world. Second, there is no way to keep up with the websites - too many
go up and down daily. So right there it is a lost cause. Their sample
is inaccurate.

Even if they will only make 90% or 95% it is still good.
As a side note, web sites does not equate to servers. So they are off
again.

No.

They claim to measure sites and they measure sites.

That is not being off.
The "statistics" are 100% meaningless.

Not at all.

Netcraft show what they claim to show.

Arne
 
A

Arne Vajhøj

rf said:
Perhaps there are proportionally more IIS servers because a single IIS
server cannot host as many web sites as an Apache server?

There are web hotels running IIS with lots of web sites.

Arne
 
A

Arne Vajhøj

Jerry said:
Who knows? It's impossible to draw any valid conclusions from
meaningless data.

But since the data are not meaningless then that is hardly relevant.

Arne
 
A

Arne Vajhøj

Pavel said:
Netcraft, which means that they do not. However, I doubt it is much
different for intranet.

They could be a bit different.

I would expect a lot of MOSS servers on the intranet.

But the numbers are still valid for internet.

And the intranet info is not available and will never be available.

Arne
 
A

Arne Vajhøj

Pavel said:
First of all, I would like to remind you that the world isn't limited
by PHP and ASP.NET. There's also Java, there's Perl, Python, and Ruby,
and there are many more exotic solutions (such as Apple's WebObjects).

I thought WebObjects were Java ??
Did it actually ever help you (i.e. did you, in the course of web
application development, had to patch PHP source code)?

Then, of course, Java is GPL'd, and Python and Ruby are under BSDL-
like licenses as well.

SUN's Java implementation is GPL for tools and JVM but GPL
with classpath exceptions for the libraries.
With respect to "learning enormous amounts of classes" - this is
equally true about PHP, but there it's "learning enormous amounts of
functions". Which is made far worse by the fact that those functions
are rather badly organized (thanks to the lack of namespaces, among
other things), and very inconsistent - you get stuff like, in the same
family of functions, the order of arguments is occasionally reversed
for no obvious reason.

PHP is very much bazaar not cathedral.

Arne
 
A

Arne Vajhøj

Michael said:
.NET is the single most cross platform technology that Microsoft has
created. It runs on more platforms and more architectures than Java
does.

Which platforms run Mono but not Java?

Arne
 
A

Arne Vajhøj

Sherm said:
The first version of IIS stored all of its vhost info in a single registry
key. For each hit, it queried the registry and then did a sequential search
through the text. You can imagine how well that scaled... I was working
in web hosting back then, and we could easily get 10 to 15x more sites
on the same hardware running NCSA or CERN httpd on *nix.

Of course, that's ancient history now -

If the alternative was CERN and NCSA then it is not exactly yesterday.
but the haters never let little
things like "facts" get in the way of their MS bashing. :)

:)

Arne
 
P

Pavel Minaev

But I'm done with you, for the above reasons.  I'm not interested in
having a discussion with someone such as you.

Never mind. I did a quick search on PHP and Python mailing lists, and
realized that my post managed to push all your buttons at once - it
looks like there's at least one "PHP vs ..." thread you participate in
regularly, wherever it appears, and the arguments from the old threads
are all oddly familiar as well. I guess this one is best left to rest.
Well, except for this one bit, which should be corrected for factual
reasons (so that no poor soul stumbles onto this thread and gets a
wrong idea):
You mean a VBScript program or java scriptlet doesn't start with <% and
end with %>?

No, they do not. When you run VBScript using its interpreter (e.g.
Windows Scripting Host), the .vbs file does not have any <%
characters, and, indeed, were they to be there, it would be a
syntactic error. Nor are they present in the code when you use
VBScript inside HTML <script> tag. They are ASP (framework /
templating engine) artifacts, not language ones - if you use e.g.
PerlScript from ActivePerl with ASP, then you'll get them in Perl,
too. But of course they aren't part of the language.

They aren't part of Java _language_ either. They are definitely part
of JSP, which is also a framework / templating engine. They are parsed
by JSP parser, and <% %> symbols aren't part of the Java scriptlet
itself, they merely indicate its boundaries.

The difference between all those examples and PHP is that for PHP, the
<?php ?> syntax is the core part of the language itself, and _every_
PHP source file is treated as text with code islands (with code
islands being ones that have to be explicitly marked), whether it
makes sense or not (which it usually doesn't).
 
J

Jerry Stuckle

Arne said:
But since the data are not meaningless then that is hardly relevant.

Arne

Sorry, Arne, the data are 100% meaningless. It is not a scientific
sample. Therefore, results are garbage.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
(e-mail address removed)
==================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top