Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

File extension overlap between languages #59

Closed
tclamb opened this issue Jul 4, 2013 · 5 comments
Closed

File extension overlap between languages #59

tclamb opened this issue Jul 4, 2013 · 5 comments

Comments

@tclamb
Copy link
Contributor

tclamb commented Jul 4, 2013

When working on #60, a C++11 implementation of stack, the existing C implementation #50 already "laid claim" to the stack.h filename, so I chose to use the less idiomatic stack.hpp instead. Since C++11 isn't backward compatible with C++98, if somebody were to add an implementation in that, they'd have to use yet another extension, such as stack.hxx, stack.hh, or stack.h++.

The current organization structure probably won't scale well as more language implementations are added. For now, which files correspond to which language is fairly obvious. But as more files are added, this won't remain so clear. With multiple file solutions (which are idiomatic in some languages), the problem directories will end up fairly cluttered.

I propose individual directories within each problem for each language. The issue could also be partially solved with filename conventions, but in my opinion, that isn't self-documenting or clean. Thoughts?

@vhbsouza
Copy link
Contributor

vhbsouza commented Jul 5, 2013

I was thinking in the same thing. But I propose instead of split the problems by languages, it could continue in a problem name folder and inside, folders with the respective languages solution.

@blakeembrey
Copy link
Owner

It sounds good, but I can't imagine that many solutions needing more than one file as I don't want to have incredibly detailed solutions here - that's what an actually library would be for. Should there be folders for for every language regardless of number of files to enforce consistency, or just folders for solutions that span multiple files?

@vhbsouza
Copy link
Contributor

vhbsouza commented Jul 5, 2013

Yeah, thinking in this way... I don't know any language that obligates use more than one file.
But in this idea about create folders just for solutions that span multiple files, sounds good to me.

@tclamb
Copy link
Contributor Author

tclamb commented Jul 5, 2013

@vhbsouza Exactly one folder per language within each problem folder, yes, I should have been more clear. :)

That is a good point. I also can't think of any language that requires more than one file, so perhaps enforcing a one-file per language limit? As long as the same extension(s) for each language is used across the repository, I think this would be sufficient.

My personal concern is C++ classes. These are typically divided up into the header (.h) file and the implementation (.cpp) file. This saves compilation time when only the implementation changes. But if these are all one-off solutions that don't belong in any real projects, this becomes a non-issue. I can just define everything in the header.

@blakeembrey
Copy link
Owner

Should be resolved with the updated structure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants