Let's organise (... what I want programmers to know ...)

Steve Mynott steve at tightrope.demon.co.uk
Thu Feb 22 21:59:34 GMT 2007

On Tue, Feb 20, 2007 at 04:00:21AM -0800, Ovid typed:

> While we're at it, perhaps one of the most important things programmers
> should know (or do know, but ignore), DON'T PUT DATA IN CODE!  It kills
> me every time I need to grep through a codebase to pull out a
> hard-coded email address or company name (yeah, guess what I'm doing
> now -- kill me, please)

I thought that was the OO way :-)

More seriously I think the less evil way of doing this is it to use
constants at the top of the code.  Although I have to admit to having
given up on real Perl constants and to just using scalars in capitals
as if I were using some C preprocessor.

Maybe with the traditional "no user serviceable parts below" comment.

Of course if data is hardcoded more than once this is bad.  As are "magic
numbers" with no comments in the code.

Steve Mynott <steve at tightrope.demon.co.uk>

More information about the london.pm mailing list