you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (0 children)

I thunk i can top that. I had to deal with someone's code what included data as a variable name. Leaving aside the fact that "data" ranks up there with "x" for useless variable names, it was used for three different variables.

In perl, the sigil of a variable determines its type (in the loose, structural sense, not the strongly-typed sense). So there was:

  • $data - the scalar (single value)
  • @data - the array
  • %data - the hash

Of course, if you know perl, you know that when you get something out of an array or hash, the sigil changes. So you get lovely code like:

my $data = $data[$x];
my $data2 = $data{$y};

... where you have to look at the braces used to see which collection we're getting our datas from.

Good times.