The old File.rename not working again. . . .

B

Bill Kelly

From: "Jay Levitt said:
I'm talking about what wikipedia calls an "unnamed numerical constant". It
took me a few seconds to realize that "10" was the length of "%!PS-Adobe".
Is PS.length (or size, if you prefer) longer to type? Yes. Is it likely
to change? No. Is it more explanatory? Yes. Will it still work when you
copy and paste this code to search for a different magic phrase? Yes.

Agreed 100%

From a readability standpoint I'd put it in the same category as
using, say, 90 instead of ?Z.

Or using 1246774599 instead of 'JPEG'.unpack("N").

The number of characters typed (golfing aside) shouldn't even enter
into consideration in cases like these.


Regards,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top