in reply to Thoughts on naming loop LABEL:
I (try to) opt for a "rôle-based" naming style; some might call it "punning". Since the vast majority of my loops aren't labeled, there's always a reason for labelling those that are. That reason is the operation I wish to perform on it: redo, next, or last (you'll see goto doesn't really fit into this mold, but I use it even less).
Name the loop to make the "something LABEL" phrase self-explanatory. For instance, in your example you could name the loop TAG; "last TAG" means just that. So would "next TAG" and "redo TAG".
rinceWind suggests much the same thing, for seemingly different reasons. Perhaps some linguist can help us make sense of whether they are, in fact, different reasons?
I find your variable naming style somewhat inconsistent (=~ /^I do it differently$/). You name arrays in plural, but hashes in singular. Your example is biased: you give "@plural_noun", referring to the entire collection, and "$singular_noun{specific}", referring to an element. I try to keep everything singular; my arrays tend to be "@singular_noun", so that "$singular_noun[INDEX] makes singular sense. Plurality or singularity stem from my choice of line noise: $, @ or %. And I don't pluralise twice.
|
|---|