GithubHelp home page GithubHelp logo

Comments (10)

Nicktho avatar Nicktho commented on July 28, 2024

So much +1

from dendritic.

nwinch avatar nwinch commented on July 28, 2024

I agree with /config over /env.

/src makes sense for projects where you are actually building from /src to a /dist folder or similar, though not for projects where that isn't the case. No need to go one folder deep if not necessary, and you can leave models, lib etc.. all at root level.

from dendritic.

kaievns avatar kaievns commented on July 28, 2024

@nwinch the reason you want all models, routes and stuff under one folder is that you will end up with a symmetric structure in the test/ folder. this way it is much easier to flip between code and tests, there are even plugins for editors that do that. it is a convention and a good practice that carried over from a language to language. you just know immediately what's where.

also, the root level is usually a crowded place, there is config/, there is bin/ there are migrations/, logs, tmp, docs etc. etc. so having a dedicated place where you could say "here is where all the code lives", "here is where all the tests live" makes sense and gives a hint to the future developers where everything should go.

as for src vs. lib, i'm fine either way. but, i'm personally trying not to use lib for two reasons: firstly, lib was historically it was used for "shared libraries", basically what node_modules is for. it's not for the main application code, but for things that can be reused between projects. and secondly: when you switch between projects that transpile and those that don't having it named consistently helps. a bit.

from dendritic.

nwinch avatar nwinch commented on July 28, 2024

The alignment between /src and /test makes sense. If I think hard and squint my eyes, I'd say my main gripe would you've got to prefix src in all your import/requires. This could be solved with a symlink I guess, and/or using relative paths but that's a different kind of messiness ;)

But yep, I'd generally be happy for things to go in /src.

from dendritic.

nwinch avatar nwinch commented on July 28, 2024

Re src vs lib - I prefer src. lib's meaning is already taken in my opinion.

from dendritic.

kaievns avatar kaievns commented on July 28, 2024

do i understand correctly that we are aligned on this? can i make the change?

from dendritic.

kaievns avatar kaievns commented on July 28, 2024

@nwinch @davidbanham are on the same page with this one? i feel that this also should go in rather sooner than later

from dendritic.

nwinch avatar nwinch commented on July 28, 2024

The outlined structure makes sense to me.

from dendritic.

davidbanham avatar davidbanham commented on July 28, 2024

In my mind lib is a halfway house between src and node_modules. It's for things designed to be used by multiple parts of the code within this project, but not genericly useful enough to make sense to other projects. Project-specific helper functions, basically. I do have a tendency to let too much stuff slop in there during times of concerted effort, though.

src in the top level for non-compiled projects feels a little weird to me, too, but I'm happy with Nikolay's rationale. Root is only getting more crowded with CI configs, docker configs, etc. Let's run with src as Nikolay laid it out.

So in light of that I think any project specific helper libs (as and when they exist) should be in src/lib/

from dendritic.

kaievns avatar kaievns commented on July 28, 2024

resolved in the thinky branch rework

from dendritic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.