The Vertical Codebase (tkdodo.eu)
from codeinabox@programming.dev to programming@programming.dev on 22 Apr 15:17
https://programming.dev/post/49225390

#programming

threaded - newest

eager_eagle@lemmy.world on 22 Apr 16:45 next collapse

as someone who only writes frontend now and then, I agree, and I don’t know how react devs find anything in their projects with the horizontal organization. I work regularly on a small one like that and it’s already a pain every time I have to backtrack where this component I’m looking at is defined.

I have the same strong feeling about how most distros and OSes have Projects/ Documents/ Videos/ Images/ etc in the home directory: this lazy “organization” is totally useless. The first thing I do on a fresh image is to get rid of these directories.

They’re all grouped by what they are instead of what project / domain they belong to, so finding anything is very inconvenient. My file explorer can help grouping files by type automatically, but it won’t know what is their intent.

idriss@lemmy.ml on 22 Apr 18:20 next collapse

if you are following DDD and/or clean architecture, this article would be giving you terrible advice. You go vertical but the moment you need a type/utility from another place it stops making sense.

eager_eagle@lemmy.world on 22 Apr 19:22 next collapse

and they wrote a section on that

tkdodo.eu/blog/the-vertical-codebase#but-what-abo…

Kache@lemmy.zip on 23 Apr 01:43 collapse

In the short term, a small amount of duplication to prevent bad abstraction spaghetti is worth it

In the medium term, true duplications are better extracted after the fact rather than correctly guessing future reusability.

In the long term, total extraction into separate vertical or external package, as suggested by the author.

Over time, this progression is natural and unforced. If you don’t need an abstraction to be de-deuplicated, then don’t. If you don’t need to promote an abstraction into its own vertical/package, then don’t.

eager_eagle@lemmy.world on 22 Apr 19:28 collapse

react dev discovers the superior vue single-file components 😅

<img alt="" src="https://lemmy.world/pictrs/image/12475a6e-5fe0-4fac-8dde-af9a7d43e3b7.png">

BlackEco@lemmy.blackeco.com on 22 Apr 19:33 collapse

Most React devs either colocate styles with their JSX with CSS-in-JS or skip CSS entirely with Tailwind class soup in their JSX. I must be one of the few that use CSS Modules instead (so CSS is in a separate file from JSX)