Pregunta

A veces, uno crea un prototipo de exploración y se olvida de la estructura de directorios en el ...

¿Cuáles son buenos consejos sobre la división de los archivos de programación más (varios niveles de directorios)?

¿Fue útil?

Solución

If your language is OOP and package based (Eg Java), then you should probably keep each package in its own folder (eg my/package/name) to keep with the convention.

If your language isn't package based (Eg PHP), then organize by what each file does. Here's an example

  • Does this do utility functions? Goes in /util
  • Is this a 3rd party plugin? Goes in /plugin
  • Is this part of the admin panel? Goes in /admin, along with ALL supporting files
  • Is this Javascript? Goes in /javascript
  • Is this CSS? Goes in /css
  • Is this a template? Goes in /templates/templateName
  • etc

Language agnostic, Most people have a /src directory for all source files, a /lib directory for libraries, and a /bin or /dist directory for builds.

Licenciado bajo: CC-BY-SA con atribución
scroll top