PBP: 026 Arrays and Hashes

The PBP suggests naming for hashes and arrays; hashes in the singular, and arrays in the plural.

In general, I agree with this, and think the reasons stated are valid.  It’s easy to do, reads well, and the few corner cases it looks funny in are pretty rare.  Arrays can be dealt with as array-sized chunks, and now hashes can be sliced, too.  But those are relatively uncommon operations, and the naming shouldn’t suffer because maybe someday someone will write odd code.

 

Tags:

Leave a Reply