torkell: (Default)
Thomas ([personal profile] torkell) wrote2006-07-18 10:18 pm

(no subject)

I hate PHP.

It just took me a good ten minutes to realise that I had typed $ids[i] instead of $ids[$i] in a PHP script.

And this is far from the first time I've made that mistake, which is because all the *real* programming languages I know have grown out of using prefixes to denote variables, and would not fail silently in such a case (well, VB would if you're mad enough to code without Option Explicit, but C and Java would fail noisily).

Did I mention that I hate PHP?

[identity profile] ralesk.livejournal.com 2006-07-18 09:34 pm (UTC)(link)

Perl for the win.

Perl X_X

[identity profile] olego.livejournal.com 2006-07-19 04:50 pm (UTC)(link)
Perl, mind you, isn't much better. My loyalty to it is failing: I can't write anything without looking it up. The latest problem I had was that the break keyword should actually have been the last keyword, even thought the break worked perfectly fine.

And don't even get me started on the 5 ways you can call a subroutine:

a();
&a();
a;
&a;
goto &a;

I mean, yes, all five are slightly different, but for Crissakes! And typeglobs? And automatically flattened lists UNLESS you use references, in which case it's $var{$something} or $var->$something... Grr.

[identity profile] pleaseremove.livejournal.com 2006-07-18 10:53 pm (UTC)(link)
Oh come on, you love it really.

You think thats bad, try searching for this difference in 500 lines....

({

[identity profile] brokencube.livejournal.com 2006-07-19 01:19 am (UTC)(link)
You think that's bad?

Trying to find a bug in 400 lines of code: I had accidentally written '<<' instead of '>>' ....

That was a headache and a half.

[identity profile] olego.livejournal.com 2006-07-19 04:40 pm (UTC)(link)
There's a better reason to hate PHP:

How do you spell a function name?

First, there are abnoxious names, such as nl2br. I mean, seriously, what the fsck? Sounds like Netherlands 2 Britain, for crying out loud.

Then there are functions without underscore. htmlspecialchars, for example.

Lastly, there are functions with underscores. mysql_escape_string. Actually, a better function is mysql_real_escape_string, because the first one is actually fake.

Once again, WTF!? Why do you have split, explode, and preg_split, spliti, and str_split? It's awful and ugly. So my fav. languages are C, Scheme, and JavaScript.

[identity profile] olego.livejournal.com 2006-07-20 05:27 pm (UTC)(link)
Behaves just as expected by me. Yea, I admit that the idea of global and superglobal variables is a bit quirky, but what's even more quirky is being able to use variables before defining them.

Fine, it's a scripting language, etc., etc. :-)