torkell: (Default)
[personal profile] torkell
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?

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

Perl for the win.

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

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

({

Date: 2006-07-19 01:19 am (UTC)
From: [identity profile] brokencube.livejournal.com
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.

Date: 2006-07-19 04:40 pm (UTC)
From: [identity profile] olego.livejournal.com
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.

Perl X_X

Date: 2006-07-19 04:50 pm (UTC)
From: [identity profile] olego.livejournal.com
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.

Date: 2006-07-20 05:27 pm (UTC)
From: [identity profile] olego.livejournal.com
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. :-)

January 2026

S M T W T F S
     123
45678910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 8th, 2026 04:45 am
Powered by Dreamwidth Studios