On Sun, May 13, 2012 at 10:48:13AM -0700, Michael G Schwern wrote:
[...]
> * Lists count from 0
>   * Everybody does it
>   * Everybody's wrong
>   * See also "let's just paste what C does"

0's good because it avoids fencepost errors. Perhaps you would prefer the
Stan Kelly-Bootle compromise of 0.5?

[...]
> * Use the same function for two totally different things.
>   * eval BLOCK; eval STRING
>   * select FILEHANDLE; select BITS, BITS, BITS, TIMEOUT

Don't forget the three forms of goto: "ugly but useful performance hack",
"break out the BASIC interpreter and fondue set, it's eighties night", and
"computed GOTO, just kill me now!"

I'd like to throw in the fun breakage caused by the combination of adding
two unnecessary bits of syntactic sugar to Perl. Somebody decided that
auto-deref would be nice, so you can do "each $hashref" and "pop $arrayref".
And then somebody else clearly huffed a bit too much PHP and decided that
hash operations should also work on arrays where possible, even if it
doesn't make sense.[0] Quick now, what does "each $foo" do, buried 94 levels
deep in the call stack of your Enterprise Quality Software?

And on the subject of Perl and hashes:

* iterators not general-purpose and only available on hashes
  * and you can only have one per hash


[0] say keys ['a'..'z'];


Reply via email to