Skip to content
0:00 / 0:00

#cleancode#solid#caseymuratori

"Clean" Code, Horrible Performance

Molly Rocket

148K subscribers • 32 videos on Hallway

YouTube
  • Recommended by 4 people: 3 on Hacker News and 1 in engineering communities.
  • A classic. People kept recommending it from 2023 to 2026.
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

1.1M views3 years ago4 recommendations

Systems programmingSoftware designPerformance and optimizationDesign patternsData-oriented design

Casey Muratori demonstrates how traditional object-oriented clean code principles can severely degrade software performance compared to data-oriented alternatives.

Bonus material from the Performance-Aware Programming Series: computerenhance.com/p/clean-code-horrible-performance

Why it's here

4 people recommend this, 1 disputes it

What people say. Frequently cited in debates about software performance, clean code, and the trade-offs of object-oriented design patterns.

Moments people linked to

u/superjoe30andrewrkin r/Zig • Recommends

"Clean" Code, Horrible Performance

GuestHNUseron Hacker News • Recommends

On “Ask HN: Learning new coding patterns – how to start?”

> What resources do you recommend folks at my level look into? I'd argue that your best bet for learning is starting a project that drives you, then throwing that project away and starting it over again but try to make the code simpler. This way you can hone into what abstraction is actually necessary to solve your problem. I strongly recommend ignoring design patterns and instead honing in on what the essential data flow is in your problem space. Most design patterns will bloat your code base and, thus, slow both your program and your programming velocity down. As far as programming design and architecture goes, the best talks I have found come out of data orientated design talks. Casey Mur…

GuestHNUseron Hacker News • Recommends

On “How do you recognize an expert?”

The issue with those books is that they don't have any concrete data that affirms that they are worth following. And, in fact, that style of code is largely to blame for why modern software feels so sluggish. They often reduce performance by 10x if not 100x or worse. I like this video on the topic for reasons not to follow SOLID principles0. Muratori also has an excellent talk on writing APIs that are flexible and performant1. As for books on understanding the hardware performance, Computer Systems: a Programmer's Perspective, is the best example (not the international edition though, according to the author's recommendation). I'm not aware of any architecture books recommended by anyone…

xiphias2on Hacker News • Recommends

On “Ask HN: What books should I read to improve as a software engineer?”

Look at Casey Murrey's Clean Code horrible performance youtube video: link to this video I also watched clean code videos and used it in practice, and why it _felt_ right my code size blew up and actually it got harder to understand by other people instead of easier. Nowdays my main guidelines are getting a balance between less lines of code (while still readable), readable variable names and better performance. Also I may get hate here for it, but I learned a lot from watching George Hotz programming tinygrad (available on YouTube).

latexron Hacker News • Recommends

On “Ask HN: Is Clean Code a waste of time?”

You may enjoy “"Clean" Code, Horrible Performance”, from Casey Muratori. link to this video Casey specialises in game engine research and development link And has an ongoing course on computer performance for programmers. link

xiphias2on Hacker News • Recommends

On “Solid and Clean Code never felt solid or clean to me”

If you want something real, look at Clean Code Horrible Performance youtube video if you haven't. I also found Bob Martin entertaining, but after trying to follow his suggestions I just got into the trap that Casey Muratori shows: even if I don't care about the performance of the code at the start, the amount of abstractions Uncle Bob advises makes it just too easy to make the code extremely hard to optimize later. link to this video

whstlon Hacker News • Disputes

On “Ideas from "A Philosophy of Software Design"”

…"Clean Code world" for half a decade I can categorically say that it produces code that is not only slow to run (as argued by Casey Muratori 1), but also slower to understand, due to the jumping around. The amount of coupling between incestuous classes and methods born out of "breaking up the code" makes it incredibly difficult to refactor. 1 link to this video…

u/definitive_solutionsin r/elixir • Mentions

Performance tips for Elixir apps? Hi! I was watching the "Clean" Code, Horrible performance video by Casey Muratori, and it got me thinking about the several ways of doing something in Elixir. For example, flow control, and conditional behavior: we have pattern matching, cases and conds, if and unless, with statements, etc. Or how about functions, how "single concern" or atomic should we make them? Now, I know the Clean Code discussion is inherently O.O.P. related, but I was hoping there's maybe some similar work done for Elixir or F.P. in general, especially for recommending best practices, preferred idioms, and perhaps most importantly, how much our choices impact the performance o…

u/chalkflavoredin r/C_Programming • Mentions

On “Resources for writing clean code”

Just to share a different view: link to this video

akasakahakadaon Hacker News • Mentions

On “Ask HN: Resources for High Performance Computing?”

1. Single-thread performance This is hardly related to HPC. The closest thing maybe code optimization and competitive programming. First learn how to do anything fast in single process, then think about scale it up later. 2. Parallel programming Learn MPI. Specifically mpi4py. Once you go MPI, you never use python's multiprocessing module (it sucks). But stuffs are mostly about solving linear algebra problems, which I am not that interested in. 4. Distributed Computing Related to MPI. But nowaday distributed GPU computing become a thing, thing that I can think of is Dask. Don't know how to use that. link 5. Quantum Computing Completely unrelated to HPC, at least in the near future (10 to 3…

GuestHNUseron Hacker News • Mentions

On “Push ifs up and fors down”

Thanks for the thoughtful reply. > Well it's hard to argue about that tradeoff in general, but I think the existence of languages like Python, Ruby and PHP is compelling. Though I'd accept the argument that they help optimise for neither performance nor changeability! I see the point you're making, and I don't disagree with it. But I should be a bit more clear in what I really meant in my parent comment: Given whatever language a developer is working in, whether it is fast like C++ or a slow language like Python (or perhaps even Minecraft Redstone), I think the programmer that takes a data oriented approach (meaning they write their code thinking about the kinds of data the program can recei…

codetrotteron Hacker News • Mentions

On “One Dog vs. the Windows 3.1 Graphics Stack”

See for example this playlist of videos of his with some videos from 2021 where he implements a terminal emulator. As he says himself, this project is not so much about terminals as it is about software development practices in general. link See also this video of his: “Clean” Code, Horrible Performance link to this video

immibison Hacker News • Mentions

On “Zig's new LinkedList API (it's time to learn fieldParentPtr)”

bugs* ironic It depends on whether you approach programming from a perspective of writing piles of obviously correct abstraction layers (the total effect of which is to leak so much the solution ends up being wrong anyway), or from the direct unabstracted perspective of actually making the computer do what you want it to do (which does not preclude the solution from using abstractions). I call them the Uncle Bob vs Casey Muratori school, after Casey's lectures such as "Clean Code, Horrible Performance": link to this video

jesse__on Hacker News • Mentions

On “Understanding C++ Ownership System”

…stly wrt. performance, but also maintainability. 12 > The whole point of an arena allocator is the exact opposite of RAII Yes, agreed. And the internet is rife with people yelling about just how great RAII is, but comparatively few people have written specifically about it's failings, and alternatives, which is what I'm asking about today. 1 link to this video 2 link…

u/MagicWolfEyein r/C_Programming • Mentions

On “C for Physics”

You migth also want to check this video by ...checks notes... "strong opinion-holder" Casey Muratori [video

u/lord_braleighin r/typescript • Mentions

On “Use the `never` type to check exhaustiveness”

Well, no. The performance difference can be measured and has been measured. You’re asking OP to do a lot more work than you’ve done. But if you want to see benchmarks because you’re actually curious about this, there’s a great YouTube video, by a guy who worked on The Witness, called Clean Code, Horrible Performance. In it he takes an example of “good code” from the book Clean Code, and undoes every guideline in the book to get code that’s the same length, just as readable, and 15x faster.