DEV Community

Discussion on: Better file structure in React projects

Collapse
 
sibyx profile image
Jakub Dubec

Hello, I just want to add a quick note to the meaning of the src folder. From my personal point of view, I always liked the idea of separating source code from the rest of the repository.
I like to keep in my root basic configuration files (linters, editor config and so on), docs, srcor the module folder (I am a Python developer). I think repository is then much more cleaner because you don't have source code mixed with files and folders like .github and other stuff that comes in the way during the project.

Collapse
 
victorocna profile image
Victor Ocnarescu

Hello Jakub! I see many devs in the comment section prefer the src folder as well. Is this a standard in python or just a preference?

Collapse
 
sibyx profile image
Jakub Dubec

Hi Victor, I don't want to say that it's some kind of standard. There is no such thing as a standardized project structure (not even in Python PEPs). As I said in the previous comment, the project repository is not only a source code but lots of accompanying files such as configs and documentation. The src folder is not just a Python thing but it's very common in many other languages such as C++ or Java. It comes from the necessity to separate source code from the rest of the project files in larger projects. Here are a few examples of popular projects that come to my mind:

Also, there is a lot of popular projects which are not using such a structure.

To sum up, it's always a preference of a maintainer or the community. But usage of the src folder makes perfect sense for me.