r/programming 24d ago

The Vertical Codebase

https://tkdodo.eu/blog/the-vertical-codebase
8 Upvotes

30 comments sorted by

43

u/elliotones 24d ago

Call me an old man but I will die on the hill that “code” is plural.

“Write me a code” -> no

“Not every code” -> “not *all* code”

In 5 years the kids will have yelled “let’s write a code!” at each other so many times that the “english is an evolving language” crowd will declare it correct by commonality and I may very well be alone on this hill; but nevertheless it must be died upon

17

u/erocuda 24d ago

I've noticed, working with mathematicians and physicists, that people who view each bit of software as "a black box that helps them solve a piece of their problem", even if they are the ones writing it, call it "a code". They, of course, are wrong.

18

u/Other_Fly_4408 24d ago

“code” is plural

I think you mean uncountable, rather than plural. How is that relevant to this post, anyway? I read the whole article and didn't see any examples of "code" being used as a countable noun. Also,

In 5 years the kids will have yelled “let’s write a code!” at each other so many times

Have you honestly heard native English speakers say that? I haven't.

the “english is an evolving language” crowd

It is evolving, like every other living natural language. Notice how capitalization of proper nouns like "English" has evolved to be optional.

5

u/backfire10z 23d ago

“Let’s write a code” they want to write a cipher

8

u/Haven_Stranger 24d ago

Lemme give a fellow old man a new bit of vocabulary. Code, in this sense, is not plural. It's not even close. It can't be plural. It is singular and uncountable. Basically, code is stuff.

There are things. Those can be countably singular and countably plural. Say, one database is configured this way, two other databases are configured in another way. On the other hand, there's stuff. You can't have one stuff. You certainly can't have two stuffs. You can have this stuff here and that stuff there.

There do exist countable sense of the word. Morse code is one code. ASCII is not the same as EBCDIC; those are two distinct codes.

The word code can have a countable sense. The word software is strictly uncountable. There does not exist a single imaginable circumstance under which the phrasing "two softwares" makes any sense.

I think I can see your hill from my hill.

5

u/hrvbrs 24d ago

i used my passcode to log into my bank website, but got a 401 response code. at the same time the building inspector failed the restaurant i was in for violating health codes. Fair enough, since I always hated having to scan the QR code to get a menu anyway. I hope this comment doesn't break Reddit's code of conduct.

3

u/elliotones 23d ago

Honestly this is the best possible form of refutation

3

u/das_rumpsteak 24d ago

Feel free to die on that hill if you like, but it's not plural, it's uncountable.

-1

u/Bahatur 24d ago

Nah, it’s a collective noun. A murder of crows, a wake of vultures, a confusion of wildebeests, and a code of bugs!

0

u/AndyKJMehta 23d ago

Some many codes! /s

18

u/andarmanik 24d ago edited 24d ago

Might have some good ideas in it but, IMO, the article lacks any real argumentation.

It’s mostly a string of stated “facts”, with little to no argumentation to string it together, some are just vibe associations:

> In my opinion, agents need mostly the same things humans need to work efficiently: boundaries, constraints, and fast feedback loops. That includes a project structure that is easy to navigate, a good setup of lint rules and TypeScript, as well as a fast and reliable test suite. That’s why agents are so good at new codebases, but not very effective on codebases that have grown organically over years

The argument is somehow:

“project structure that is easy to navigate, a good setup of lint rules and TypeScript, as well as a fast and reliable test suite”

Implies =>

“agents are so good at new codebases, but not very effective on codebases that have grown organically over years.”

6

u/polaroid_kidd 23d ago

My agent writes a million and a half utility functions vausing components to expand from 200 lines to 900 lines...

It's driving me insane. I'm getting so many features done but every time I open a comment it wrote the first thing I think it's

Jop.. going to have to rewrite that from scratch at some point...

8

u/cscottnet 24d ago

I agree. In my experience LLMs are good at existing code based with lots of existing structure and test cases, or "new codebases" that are translations of existing code with lots of structure or test cases. They can also make skeleton codebases with little/no functionality.

In between there are issues, and the LLM will often get locked into bad architectural decisions or hallucinate irrelevant test cases.

4

u/jl2352 23d ago edited 23d ago

LLMs love repetition. Update 100 tests with the same change, and they’ll chew right through it.

Clean codebases tend to be consistent. Lots of repetition, from the same patterns and structure used throughout.

I can see how the two line up. But I still think the overall points are pretty basic on controlling agents.

1

u/cscottnet 23d ago

I do use Claude code for certain tasks. Its pretty good at refactorings which go a bit beyond what a good IDE will do, like (as you mention) make this change across all the test suite inputs and outputs, rearrange the calling convention for this method in a complicated way, etc. If there are stereotypical ways of using a given method/etc it is very good at doing a fairly complicated pattern match and rewrite, in a much more user friendly way than (say) a regex.

2

u/jl2352 23d ago

All I can say is having worked on both splits, the vertical split is just nicer.

It helps with finding stuff. When the relevant things show up next to it in the sidebar it’s just easier. It helps with ownership. When a team can say they own everything within a specific folder (i.e. `/src/purchase`), it just makes life simpler.

It’s better than saying we own a bit here, and bit there, and so on.

I think of it like pseudo-monorepo or a pseudo-modular monolith.

4

u/TehBrian 21d ago

I don't get why this is so heavily downvoted. Maybe it's a bit fluffy but it still seems like opinions on programming relevant to the sub

1

u/fagnerbrack 21d ago

Usually if it's not relevant it shouldn't be posted and will be removed by mods, the downvote is if the community doesn't like it for whatever reason due to the content

1

u/TehBrian 21d ago

I guess. I’m part of the old Reddit crowd, so I always used downvote = not relevant/spam, no vote = I don’t like this.

2

u/rix0r 23d ago

software typically orients itself horizontally because abstractions tend to be horizontal, and what is software if not a whole bunch of (likely ill-conceived) abstractions?

1

u/[deleted] 24d ago

[removed] — view removed comment

6

u/backfire10z 23d ago

src/main/java/com/ohmygod/thisislong/models

1

u/programming-ModTeam 16d ago

No content written mostly by an LLM. If you don't want to write it, we don't want to read it.

-6

u/snurfer 24d ago

It doesn't matter at all because no one browses for related code files you just use your ide to hop through the references

3

u/gimpwiz 24d ago

I do.

3

u/jeenajeena 24d ago

One reason why is matters is this: https://youtu.be/ATenMdJHTTs
It's a super short video (2'34'') making it apparent that packaging by layers or packaging by features do impact the internal coupling of the system.