On Thu, Nov 14, 2013 at 01:35:39AM -0600, Stan Hoeppner wrote:
> > Mere excuse for sloppiness.
>
> I find that offensive Viktor. There is a huge difference between
> arguing a point of fact and arguing a position. Above is an example of
> the former, and is a correct statement.
Sorry to hear that. Just because you're posting excuses for
sloppiness does not mean that your work is not valuable. Both are
true at the same time. The impact of the sloppiness may be minor
to insignificant, and that's what makes it mere sloppiness rather
than say negligence or incompetence which are not in question here.
Making fewer mistakes is not mere luck, it is the result of meticulous
habits. CPU efficiency has nothing to do with my comment. Anchored
expressions yield fewer surprises, and not using them habitually
is sloppy. Make anchored regular expressions a habit.
This is analogous to always putting shell "${variable}" expansions
in double quotes (except on rare occasions when you want word-splitting)
and various other ways of generally staying out of trouble.
I could mention using "set -e" in shell scripts to avoid undetected
command failures, or using:
sendmail -f "${sender}" ...
instead of:
sendmail -f"${sender}" ...
because the latter misbehaves when "${sender}" is empty.
> > Always anchor, then when possible
> > discard leading "^.*" and trailing ".*$".
>
> Yes, for people who have the time and dedication to "do it right", such
> as ourselves. Others can take shortcuts and get the job done, just as
> PHP/Perl/Java/etc heretics don't use C.
Don't under-estimate the rest of humanity, teach them.
--
Viktor.