File extension repetition considered harmful?

Don't Repeat Yourself is a well known software development mantra. Suppose your working on a C project and all the #include lines name header files whose name ends in dot-h. Aren't all those dot-h's repetition? They are. But you probably don't consider that as repetition because in this context it doesn't matter. However, sometimes file extensions become a bigger part of the context and then the repetition can start to hurt. For example, I have some PHP files whose names end in dot-php. The content of these PHP files contain some hardwired redirections to sibling dot-php files. These files live on my ISP's server and they run under PHP4. My ISP has upgraded to PHP5 - but only for files ending in dot-php5. Is it worth upgrading I ask myself.

No comments:

Post a comment