r/programming • • 1d ago

Hot take: Sometimes three boring statements beats one clever expression

https://allthingssmitty.com/2026/11/16/sometimes-three-boring-statements-beat-one-clever-expression/

Sometimes the simplest code is the best code. It's tempting to squeeze everything into one clever expression, but three straightforward statements can be easier to understand and maintain. Here's a look at why.

0 Upvotes

28 comments sorted by

92

u/Ok-Rule8061 1d ago

Not a hot take. Literally the core of collaborative production software engineering.

37

u/drewhead118 1d ago

hot take: it can be fun to give your functions human names like Pierre, Javier, or Kelly, but sometimes naming them for what they do beats the sense of individuality and personality that a human name might afford

25

u/luxmesa 1d ago

Hot take: you should make sure your code compiles before sending it for a code review 

4

u/thisisjustascreename 1d ago

Hell nah brother debug in prod, kubectl is a sick ide

4

u/kenlubin 1d ago

But before we had digital computers in this office, Kelly did the job this function is going to do. So I will name this function after her, because everyone knows Kelly

7

u/EliSka93 1d ago

Hot take: if you name your functions human names and I have to work in your code I will set you on fire.

10

u/Tall-Introduction414 1d ago

Hot cake: delicious.

4

u/TomWithTime 1d ago

That is kind of ridiculous, who would name a function after a person? I name objects and systems after people so it makes sense and I can organize my project like an office of people with slightly overlapping responsibilities.

1

u/Ythio 1d ago

Interesting take, John Smith. Let's ask Mike Taylor and Andrew Baker what they think about naming people for what they do. We may also take input from Edward Mason or even Matthew Harper.

14

u/Ok-Rule8061 1d ago

If Claude is the target audience for this article though, it could be next level prompt engineering.

You prompt in the chat.
I prompt in the training data.
We are not the same.

2

u/echoAnother 1d ago

Ey, it's a good idea.

Claude, kill all humans.

I'm the best training architect now

2

u/Ok-Rule8061 1d ago

You idiot! You’ve doomed us all!

1

u/TraderNuwen 1d ago

Agreed, but people seem to keep forgetting it, so it can't hurt to restate it from time to time. If the words "hot take" make more people read it, all the better.

23

u/YeetCompleet 1d ago

Gotta be the coldest take yet

25

u/Ythio 1d ago

People are recycling 1970s programming debates like they just invented warm water.

11

u/SmokyMetal060 1d ago

Nah not a hot take. Anybody who's worked an entry level SWE job has gotten told by their senior to not get cute.

6

u/AnkerSOLIX-Support 1d ago

Three boring statements beat a clever one-liner when you're on call and the person who wrote it left two years ago. Doesn't seem like a hot take.

6

u/trialbaloon 1d ago

Ice cold take. I would like to read someone claiming the opposite, that would be more fun.

6

u/curiouslyjake 1d ago

It's a really cold take. The paramount purpose of code is to be readable by others. This means your team members and it means you in six months. The moment someone reads a line of code and goes "huh?", it means the code not as readable as it could have been.

4

u/MyNameIsRichardCS54 1d ago edited 1d ago

Not sometimes, no. I would say nearly always.

4

u/yawaramin 1d ago

And sometimes a single expression beats three different statements because it's just a single logical code phrase where everything is in your head (working memory), whereas the three different statements are separate and each introduces a separate possibility for bugs to creep in.

2

u/EntroperZero 1d ago

I've recently seen this pattern a lot in C# with the new pattern matching syntax:

    if (creative.ExternalId is not { } externalId || creative.CompanyId is not { } companyId)
    {
        return;
    }

This is a really odd way of combining local variable declaration with simple null checks.

1

u/jippiex2k 1d ago

What's the difference between a fallback theme and a default theme o.O

1

u/vytah 1d ago

Default is the default under normal circumstances. Fallback is something that should work always, even if the default theme doesn't load.

1

u/commenterzero 1d ago

Idk can you split that up for me

1

u/rs98101 1d ago

Yeah, it’s not sometimes. It is almost every time.

1

u/Plastic_Koala2044 1d ago

Agreed for code people review, less so for generated code. My framework writes the app's entry file for me, and I never care how dense that is because nobody reads it in a diff. The controllers get read on every change, and there a named intermediate beats a chained one-liner every time.

0

u/TTachyon 1d ago

Always, not sometimes.