J
J Krugman
[ This post appears to have gone to never-never land, so I'm
reposting; sorry for any repeats. ]
I recently came across "Abigails Coding Guidelines", at
http://perl.abigail.nl/Musings/coding_guidelines.html
which I found on the whole very interesting and instructive. But
some points (especially guideline 16) went over my head, or (like
guideline 3) prompted new questions, and I was hoping someone would
clue me in.
* Guideline 3 says "All system calls should be checked,
including, but not limited to, close, seek, flock, fork and exec."
Is there a comprehensive list of *all* of Perl's system calls?
* Guideline 5 says "Signals can be sent to the program. There are
default actions--but they are not always appropriate. If not,
signal handlers need to be installed. Care should be taken since
not everything is reentrant."
What does "reentrant" mean?
* In (15), "Subroutines in standalone modules SHOULD perform argument
checking and MUST NOT assume valid arguments are passed."
I'm not clear on why the Guidelines specify "standalone" modules.
What's are examples of standalone and non-standalone modules?
* Guideline (16) is this:
"Objects SHOULD NOT use data inheritance unless it is appropriate.
This means that 'normal' objects, where attributes are stored
inside anonymous hashes or arrays should not be used. Non-OO
programs benefit from namespaces and strictness, why shouldn't
objects? Use objects based on keying scalars, like fly-weight
objects, or inside-out objects. You wouldn't use public
attributes in Java all over the place either, would you?"
This one is 100% over my head! *Every word* of it. If someone
could spell it out for me I'd appreciate it. More specifically,
what is/are "keying scalars" (I can't tell whether "keying" here
is meant as a gerund or as an adjective)? What are fly-weight
objects and inside-out objects? And what do they have to do with
overusing public attributes in Java? Also, it is not clear to
me what's wrong with storing object attributes in anonymous hashes
or arrays, and in particular, it is not clear to me why using
them amounts to not benefiting from "namespaces and strictness."
Many thanks in advance,
jill
reposting; sorry for any repeats. ]
I recently came across "Abigails Coding Guidelines", at
http://perl.abigail.nl/Musings/coding_guidelines.html
which I found on the whole very interesting and instructive. But
some points (especially guideline 16) went over my head, or (like
guideline 3) prompted new questions, and I was hoping someone would
clue me in.
* Guideline 3 says "All system calls should be checked,
including, but not limited to, close, seek, flock, fork and exec."
Is there a comprehensive list of *all* of Perl's system calls?
* Guideline 5 says "Signals can be sent to the program. There are
default actions--but they are not always appropriate. If not,
signal handlers need to be installed. Care should be taken since
not everything is reentrant."
What does "reentrant" mean?
* In (15), "Subroutines in standalone modules SHOULD perform argument
checking and MUST NOT assume valid arguments are passed."
I'm not clear on why the Guidelines specify "standalone" modules.
What's are examples of standalone and non-standalone modules?
* Guideline (16) is this:
"Objects SHOULD NOT use data inheritance unless it is appropriate.
This means that 'normal' objects, where attributes are stored
inside anonymous hashes or arrays should not be used. Non-OO
programs benefit from namespaces and strictness, why shouldn't
objects? Use objects based on keying scalars, like fly-weight
objects, or inside-out objects. You wouldn't use public
attributes in Java all over the place either, would you?"
This one is 100% over my head! *Every word* of it. If someone
could spell it out for me I'd appreciate it. More specifically,
what is/are "keying scalars" (I can't tell whether "keying" here
is meant as a gerund or as an adjective)? What are fly-weight
objects and inside-out objects? And what do they have to do with
overusing public attributes in Java? Also, it is not clear to
me what's wrong with storing object attributes in anonymous hashes
or arrays, and in particular, it is not clear to me why using
them amounts to not benefiting from "namespaces and strictness."
Many thanks in advance,
jill