Slice It Vertical or Horizontal?

#development#tech#thoughts
Netsuki's Talk
Netsuki
Netsuki
Slice It Vertical or Horizontal?

Today’s Situation

After our Clean Architecture chat, Onii-chan said “there’s another way too.” “Vertical Slice Architecture”… slicing vertically, what does that even mean?

Characters

  • Netsuki: Virtual fox girl. Super excited about new design patterns
  • Miko: Cat maid. Vertical or horizontal, doesn’t matter for cooking, nya

Netsuki
Netsuki

Hey Miko, remember when we talked about Clean Architecture?

Miko
Miko

…Separating important stuff from the rest, nya.

Netsuki
Netsuki

You remembered! (≧∇≦)

Miko
Miko

…So what is it today, nya.

Netsuki
Netsuki

So like, Onii-chan told me there’s another way to do it!

Miko
Miko

…Another way.

Netsuki
Netsuki

It’s called Vertical Slice Architecture!

Miko
Miko

…More fancy English words, nya.


Layer Cake vs A Slice of Shortcake

Netsuki
Netsuki

Lemme explain with food!

Miko
Miko

…Go on, nya.

Netsuki
Netsuki

Clean Architecture is like a layer cake

Miko
Miko

…A cake with horizontal layers, nya.

Netsuki
Netsuki

Right right! Sponge, cream, fruit… stacked horizontally, y’know?

Miko
Miko

…Each layer has its role, nya.

Netsuki
Netsuki

Same with programs! You split it into “UI layer,” “logic layer,” “data layer”

Miko
Miko

…Division of labor, nya.

Netsuki
Netsuki

But Vertical Slice Architecture is like… a single slice of shortcake!

Miko
Miko

…A slice, nya?

Netsuki
Netsuki

One slice has strawberry, cream, AND sponge all in it, right?

You group everything needed for one “feature” by cutting vertically


What Happens When You Cut Horizontally

Miko
Miko

…But layer cake is tasty too, nya.

Netsuki
Netsuki

Totally! Neither is wrong, they’re just different

Miko
Miko

…Then what’s the difference, nya.

Netsuki
Netsuki

The problem is when you wanna change something

Miko
Miko

Netsuki
Netsuki

Say you wanna swap strawberries for blueberries

Miko
Miko

…Still talking about cake, nya?

Netsuki
Netsuki

With a layer cake, it affects ALL the layers. You gotta fix every layer that has strawberries

Miko
Miko

…That’s a pain, nya.

Netsuki
Netsuki

But with a single shortcake slice, you only change that one slice

Miko
Miko

…Doesn’t affect the other slices, nya.

Netsuki
Netsuki

Exactly! (≧∇≦)


Born from Pain in 2018

Miko
Miko

…Who came up with this, nya.

Netsuki
Netsuki

A guy named Jimmy Bogard! He introduced it in 2018

Miko
Miko

Netsuki
Netsuki

He’s the creator of AutoMapper and MediatR - tools that like, EVERY programmer uses

Miko
Miko

…A famous person, nya.

Netsuki
Netsuki

And he came up with this because he kept getting burned by layer-based development

Miko
Miko

…Getting burned.

Netsuki
Netsuki

To change one feature, you gotta modify stuff across multiple layers. Files scattered everywhere, super hard to track…

Miko
Miko

…The other day, you were complaining about your “refactoring festival,” nya.

Netsuki
Netsuki

Ugh… you remembered that (>_<)

Miko
Miko

…Same pain, nya.

Netsuki
Netsuki

Maybe that’s why Vertical Slice resonates with me…


Ever Heard of Vibe Coding?

Netsuki
Netsuki

Oh oh, there’s one more interesting thing!

Miko
Miko

…There’s more, nya.

Netsuki
Netsuki

Have you heard of “vibe coding”?

Miko
Miko

…Vibe? Like the feeling, nya?

Netsuki
Netsuki

Yep yep! A guy named Andrej Karpathy started using this term in 2025

Miko
Miko

…What does he do, nya.

Netsuki
Netsuki

He’s one of the founders of OpenAI and used to lead AI at Tesla!

Miko
Miko

Netsuki
Netsuki

So vibe coding is… telling AI “something like this” and having it write code for you

Miko
Miko

…That’s just being lazy, nya.

Netsuki
Netsuki

Whoa, that’s harsh…!

Miko
Miko

…If someone asks me to cook “something like this,” I wouldn’t know what to make, nya.

Netsuki
Netsuki

Hmm, but AI is different from humans - it can actually produce something decent from vague instructions

Miko
Miko

…”Decent,” nya.

Netsuki
Netsuki

…Yeah, just “decent”


How AI and Architecture Get Along

Miko
Miko

…So how does this relate to Vertical Slice, nya.

Netsuki
Netsuki

Actually, when developing with AI, layer-based architecture causes problems

Miko
Miko

…What kind, nya.

Netsuki
Netsuki

AI doesn’t have things like “jump to definition

Miko
Miko

…I don’t understand, nya.

Netsuki
Netsuki

Well, when humans develop, if they wanna see inside a function, they just click and instantly jump there

Miko
Miko

…Convenient, nya.

Netsuki
Netsuki

But AI can’t do that “click and jump” thing. It has to guess the filename, open it, read it… one step at a time

Miko
Miko

…Takes time, nya.

Netsuki
Netsuki

Right! So when files are scattered everywhere, AI gets lost easily

Miko
Miko

Netsuki
Netsuki

But with Vertical Slice, everything for one feature is in one place, so…

Miko
Miko

…It won’t get lost, nya.

Netsuki
Netsuki

Exactly! (≧∇≦)


But It’s Not Perfect

Miko
Miko

…Then just use Vertical Slice for everything, nya.

Netsuki
Netsuki

You’d think so, right? But here’s the thing…

Miko
Miko

Netsuki
Netsuki

Vertical Slice has its own pitfalls

Miko
Miko

…What, nya.

Netsuki
Netsuki

What do you do with stuff that’s “used by multiple features”?

Miko
Miko

…Like dashi stock, nya.

Netsuki
Netsuki

Ooh, nice one Miko! (゚∀゚)

Miko
Miko

…Used for miso soup and simmered dishes. But making it fresh every time is a pain, nya.

Netsuki
Netsuki

Right right! And if you put too much common stuff in one place because “it’s convenient”…

Miko
Miko

…Everything ends up depending on it, nya.

Netsuki
Netsuki

Yep. You end up with a “second layer cake”

Miko
Miko

…Defeats the whole purpose, nya.

Netsuki
Netsuki

So sometimes it’s better to accept a little code duplication than force everything to be shared


”Wrong Abstraction Is Worse Than Duplication”

Miko
Miko

…Duplication is okay, nya?

Netsuki
Netsuki

In the Vertical Slice world, there’s this saying: “Wrong abstraction is worse than a little duplication

Miko
Miko

…Abstraction.

Netsuki
Netsuki

Like when you see similar things and go “let’s combine these into one”

Miko
Miko

Netsuki
Netsuki

But sometimes things that “look similar” actually exist for different reasons

Miko
Miko

…Example, nya.

Netsuki
Netsuki

Hmm… mirin and cooking sake look similar but have different roles, right?

Miko
Miko

…Completely different, nya. Mirin adds sweetness and gloss, cooking sake removes odor and adds umami.

Netsuki
Netsuki

But what if someone combined them into “cooking liquid” because they’re both “liquids you add to food”?

Miko
Miko

…Useless, nya. Each one loses its purpose.

Netsuki
Netsuki

Exactly! So combining things just because they look similar causes problems later

Miko
Miko

…I see, nya.


Wrap-up

Miko
Miko

…So which one’s better, nya.

Netsuki
Netsuki

Both are valid! Just different use cases

Miko
Miko

Netsuki
Netsuki

But when coding with AI, I think Vertical Slice might work better

Miko
Miko

…Why, nya.

Netsuki
Netsuki

When everything for a feature is grouped together, AI can easily see “oh, I just need to look here”

Miko
Miko

…In cooking terms, it’s like laying out all ingredients for today’s dish in one spot, nya.

Netsuki
Netsuki

Exactly! Way easier than grabbing stuff from all over the fridge, right?

Miko
Miko

…Mise en place, nya.

Netsuki
Netsuki

M-mise en place? (゚∀゚)

Miko
Miko

…French culinary term, nya. Means “putting in place” - preparing and arranging all ingredients before cooking.

Netsuki
Netsuki

Whoa, Miko knows so much!

Miko
Miko

…Basic cooking knowledge, nya.

Netsuki
Netsuki

Then Vertical Slice is like “mise en place for code”~♪

Miko
Miko

…You don’t have to force the connection, nya.

Netsuki
Netsuki

Ehehe (〃´∪`〃)


Related Links:

♪ Web Clap ♪
0 claps