The reason it doesn’t sit well is that, in practice, it seems like most products don’t know what needs to be fast and so developers end up making almost everything slow. Casey gives many examples but the one that sticks out most in my mind is the Visual Studio watch window (about 25 minutes into https://m.youtube.com/watch?v=GC-0tCy4P1U). The watch window lets you pin variables you’re interested in and it will show you their current values as you step through the program’s execution. Invaluable for debugging. Visual Studio’s watch window is incredibly slow, to the point that it actually has a debounce so it will stop updating when you’re stepping quickly and only update once you’ve stopped quick-stepping. This seriously impacts its usefulness! To me, the watch window seems like it’s obviously one of those modules that needs to be running in milliseconds or less - but the company and/or the developers don’t see that, and shipped it slow (and presumably clean) instead. So in my mind, “write clean except where performance matters” comes with an almost fatal caveat, something like “you won’t know where performance matters”.
“Clean Code, Horrible Performance” Discussion
41–50 of 220 posts
Re: “Clean Code, Horrible Performance” Discussion
#42Earlier quoted context omitted.
Robert C Martin's (who is not my uncle) Clean Code book/advice is what I would call junior programmer material. Its good to get someone started to think about better ways of writing software (albeit is hasn't aged very well). I don't recommend it to juniors anymore because it hasn't aged well and is for my taste hyperbolic in its promises. IMHO clean code also is more focused on code implementing "business logic" tha…
This begs the question: what do you recommend instead?
Re: “Clean Code, Horrible Performance” Discussion
#43At some point in my programmer career I figured out that optimizing for human comprehension, a.k.a. "clean code", is a valid goal. I watched Casey's video in full and agree with all the points he made. But as others pointed out, he focus on squeezing every bit of performance in the context of real-time video game logic, and this isn't representative of every programming problem. As an addendum to Casey's video, anoth…
Re: “Clean Code, Horrible Performance” Discussion
#44I'm starting to hate programming discussions, after you've read a lot of them they're predictable, boring as hell and you can argue endlessly just because you value a little bit different things. This discussions is yet another, nothing special way of saying: context matters. You have a list of requirements of what you want to achieve, some of them do appear during development and you develop against this. I have com…
I've wrote about my observations with the same conclusion
https://trolololo.xyz/programming-discussions
>I've started thinking about it and realized that people arguing on all previously mentioned platforms tend to have various backgrounds
>Web developers, desktop developers, system programmers, cloud engineers, people working at startups, people working in corporations, beginners, experienced and known in the industry people, FP/OOP fans, self-taught, people after electrical engineering/computer science/mathematics, and a looot of more.
>So, what's the difference? I'd say context and the context is unfortunately lost in those discussions because all you see is just somebody's comment and that's it. Nickname very often doesn't tell you anything (except on forums after you spend some time there)
>And they all are right (or may if you want to argue :)), but very often that information about their respective domains is lost and the argument is around some "generic code base" or some "average project" which is different for everybody.
Re: “Clean Code, Horrible Performance” Discussion
#45It is debatable if Clean Code actually improves the programmer efficiency and programs readability. I find people applying it religiously often create over-complex designs like FizzBuzz Enterprise. Even Uncle Bob's examples are not the state of the art in readability: https://qntm.org/clean The main problem seems to be that Clean Code is mostly a premature optimisation in code flexibility. It makes code more complex…
Clean Code led to the development of the VIPER framework, which is a crime it must answer for.
Re: “Clean Code, Horrible Performance” Discussion
#46Re: “Clean Code, Horrible Performance” Discussion
#47Earlier quoted context omitted.
Robert C Martin's (who is not my uncle) Clean Code book/advice is what I would call junior programmer material. Its good to get someone started to think about better ways of writing software (albeit is hasn't aged very well). I don't recommend it to juniors anymore because it hasn't aged well and is for my taste hyperbolic in its promises. IMHO clean code also is more focused on code implementing "business logic" tha…
This begs the question: what do you recommend instead?
Re: “Clean Code, Horrible Performance” Discussion
#48this was a very amicable and fruitful discussion it's been chaffing me a lot last couple of years that it is so hard to learn about making performant code. It was nice of Julia Evans to write that very approachable strace zine [1]. I wished there was more of that kind of stuff. So I am happy Casey is doing a whole course on this stuff [2]. [1] https://wizardzines.com/zines/strace/ [2] https://www.computerenhance.com/…
Re: “Clean Code, Horrible Performance” Discussion
#49Here's another controversial opinion: It's the genius programmers who write the shittiest code. In my experience clean code tends to be a waste of time for geniuses because shitty code isn't really a problem for smarter people. The further away you are from genius the greater the tendency for you to write cleaner code because you need it in order to deal with the complexity. What's common among HN readers is that the…
I actually think how "clean" your code is depends on lots of factors. Eg.
(a) Do you care if your coworkers find it easy to modify your code?
(b) Do you feel a sense of ownership over the code you're touching?
(c) Does your organization reward delivery speed without any checks for code quality? (eg. no culture of code review)
(d) Is the code a proof-of-concept that needs validation from users before further investment?
Re: “Clean Code, Horrible Performance” Discussion
#50I'm starting to hate programming discussions, after you've read a lot of them they're predictable, boring as hell and you can argue endlessly just because you value a little bit different things. This discussions is yet another, nothing special way of saying: context matters. You have a list of requirements of what you want to achieve, some of them do appear during development and you develop against this. I have com…
The religious refactoring of any kind of software to its most generic and decoupled design, under the name of "cleanliness", is quite impressive. it's quite important that one of the most well known figure recognize that those designs have costs in terms of performance and are not suitable anywhere.