Posted by: mozey on: June 7, 2008
I was playing around with a wordpress plugin!, i saw this jem!
$file = $file['file'];
WTF!?!?!?!?!?
++++++++++++++
UPDATE
++++++++++++++
Upon further thought!!!, i think you guys are right!, this is not the language’s fault. The variable names should have been named more clearly. NOW STOP BADGERING ME ABOUT THIS.
It’s not the language that sucks, it’s clearly the rockstar developer who wrote that code.
Because you could write that screwed up line in almost any language.
And it’s the programming languages fault when the developer decides to use bad variable names?
In python it would be
file = file['file']
so… python sucks too? ![]()
Are you saying that all dynamic variable languages suck?
Bye.
You can’t blame PHP for that. At first I thought maybe the script was uploading a file through a file form field, but that would be passed as $_FILES['fieldname']. If the field in the HTML were named file then it would be $_FILES['file'], but no. Those variables are named by the programmer, and might be ok depending on the rest of the code. It is, at least, descriptive. Much better than some code I’ve seen with variables named $rbz, $aaa, and $t.
I’m surprised you were intelligent enough to identify that WordPress was composed using PHP.
This is more appropriate for the context:
$i = $like['men'];
P.S. ever seen fight club?
** EDITED
June 7, 2008 at 6:26 pm
It’s gem, not jem. Go back to school.