r/AskProgramming • • Aug 26 '26

Architecture Is it bad to use an already-existing file extension when designing project files?

I'm working on a program which involves creating project files which store project data in a specific structure, as well as the project manifest. Currently, I have the project file set up as a ".dcproj" to keep with a specific naming scheme. However, upon doing some searching, it turns out that .dcproj is already used in a couple of places, although they're pretty esoteric.

https://learn.microsoft.com/en-us/visualstudio/containers/docker-compose-properties?view=visualstudio
https://fileinfo.com/extension/dcproj

I know I can just ignore the other uses and go with what I have, but is it bad practice? Intuitively, file extensions would have to be reused all the time with the limited number of characters we have to create them. For example, the .M file extension is used in at least four places.

https://en.wikipedia.org/wiki/List_of_filename_extensions_(M%E2%80%93R)s

6 Upvotes

11 comments sorted by

7

u/aocregacc Aug 26 '26

good idea to look around and think about whether people might want to use those other tools alongside yours in the same directory. If you think that's unlikely there's nothing wrong with using the same extension imo.

On the other hand if your users are not expected to directly interact with these files a lot, you can easily make the extension a bit more verbose and make collisions much less likely.

1

u/BrianEatsBees Aug 26 '26

I would think it's extremely unlikely. These project files are probably going to be stored in their own directory, I'm not exactly sure where yet but probably in Documents under it's dedicated folder, pretty similar to how other projects like mine do. I'm not entirely sure what Docker Compose does but it seems to be its own programming tool, and my guess is the userbase would be unlikely to overlap, but not impossible. My project is definitely more obscure.

3

u/JeLuF Aug 27 '26

The directory isn't that relevant. As a user, I want to double click a file in Explorer to start its associated application. If two applications try to register the same suffix, for one of them, the wrong app will start.

I'd consider e.g. .dcpj instead, which doesn't seem to be in use.

7

u/jaynabonne Aug 26 '26

The only concern I'd have is whether you want to get into file associations for double clicking and whether something like Visual Studio takes those over. It could get a bit confusing if different apps are battling over who "owns" the extension on a particular computer.

2

u/BrianEatsBees Aug 26 '26

I can see that. Might be a better idea to slightly revise the file extension. I think .dcmproj would be acceptable and still fall in line with the naming scheme. I'll give it some thought. I probably do want to set up the file association.

1

u/rlebeau47 Aug 26 '26

Even if multiple apps register the same extension, Windows will just ask the user which app to use when double clicking on a file.

1

u/Koltaia30 Aug 26 '26

If it's rare enough then it's okay

1

u/Koltaia30 Aug 26 '26

If there is one project file per project then you could just have it as dcproj.txt or just dcproj. The name of the folder could describe the name of the project. This is especially useful if you follow a standardized file format such as .json, .xml or something 

1

u/IcyUnderstanding8203 Aug 26 '26

Let's be honest, it's kind of impossible to find an umised extension. Just avoid the most common one (jpg/png/gif/pdf/xlsx/docx/....) if yours is not that much common it will be fine.

1

u/NamedBird Aug 27 '26

Consider .beesproj ? 🙃