Live data from Hacker News

Solid and Clean Code never felt solid or clean to me

devz.cl

21–30 of 82 posts

Re: Solid and Clean Code never felt solid or clean to me

#21
post #12

Uncle Bob does a bad job talking about trade-offs, but there's still value in stuff like SOLID. The problems start when people blindly obey or ignore design principles. Saying SOLID makes bad code is as over-simplistic as saying SOLID makes good code.

The trouble with SOLID is that it's mainly an artifact of old languages and paradigms.

3 of the letters are almost irrelevant in modern code, or barely worth thinking about most of the time.

So what's the value here? Single responsibility?

That kind of thing is now so known that it doesn't really need talking about, like you don't really need to endlessly discuss the database normal forms like people did in the 00s.

Concepts that are worth explaining to beginners, but most code will follow it by default.

Seeing it in job descriptions is more an indicator that a company has an inexperienced lead more than anything else.

Re: Solid and Clean Code never felt solid or clean to me

#22

I guess by now it's pretty settled down and unanimous that SOLID is an extremely bad way to organize your code, and that Clean isn't very good and has about the same odds of helping or harming you. But extending the complaint to all acronyms isn't helpful. ACID, OLAP, EBITDA, etc are perfectly good names with clear meanings that can be easily discovered.

You don't know many c# devs, then.

Re: Solid and Clean Code never felt solid or clean to me

#23
Choose a convention and stick with it. Your chosen conventions could be the worst fit for your domain, but the code following "a" convention ensures that people jumping in later can actually follow along and it makes refactoring at least bearable.

I personally don't like when people stick to SOLID like it's the holy hammer, but nearly every serious programming language has a convention on how to write SOLID code, and it will be followed, which makes my job easier if I'm new to the codebase.

Re: Solid and Clean Code never felt solid or clean to me

#24
Uncle Bob is a snake oil salesman. Not sure he realizes it himself though. The whole SOLID, OOP design patterns era was one of the worst things to have happened to programming.

I always thought I was the one that sucked but now I'm absolutely certain that whole zeitgeist was total crap.

Re: Solid and Clean Code never felt solid or clean to me

#25
post #3

While I agree the "Uncle Bob" cargo cult is IMO dumb, this really rubs me the wrong way: > You have the vendor pushed acronyms like: ACID, CAP, OLAP, OLTP. ACID and the CAP theorem in particular has _very_ serious consequences if you're doing anything that isn't a toy with a database, and if there was one thing worth beating into developers, it would be the consequences of those. With the big push on columnar stores…

Oh please don't confuse it with an aversion to formalism. It's quite the opposite. ACID, CAP and others were fantastic research when they came up. But now they are outdated and reductive of the real implications of running databases and distributed systems. That's why I mentioned PACELC being one of my favorite design principles in this matter: https://en.wikipedia.org/wiki/PACELC_design_principle

My criticism of this "Acronym Marketing" is that software engineers get stuck rallying behind acronyms as if they were timeless but to me ACID and CAP are outdated and it would be better if engineers really got into the consequences of running complex systems as you said, and not only repeating acronyms as if they covered the whole story.

OLAP vs OLTP have become marketing talkpoints from Databricks and friends to get people into paying for managed distributed systems when in reality for plenty of workloads Postgres runs just fine. People get stuck in the dichotomy without getting a further understanding of the underlying technology.

Nothing of this is confusing to me. Its reductive.

Re: Solid and Clean Code never felt solid or clean to me

#27
post #12

Uncle Bob does a bad job talking about trade-offs, but there's still value in stuff like SOLID. The problems start when people blindly obey or ignore design principles. Saying SOLID makes bad code is as over-simplistic as saying SOLID makes good code.

The trouble with SOLID is that it's mainly an artifact of old languages and paradigms. 3 of the letters are almost irrelevant in modern code, or barely worth thinking about most of the time. So what's the value here? Single responsibility? That kind of thing is now so known that it doesn't really need talking about, like you don't really need to endlessly discuss the database normal forms like people did in the 00s.…

Single Responsibility was written about nearly 40 years after cohesion was grafted into software design from an actual architect's (like buildings and cities, absolutely not software o doctoral thesis.

"That kind of thing is now so known that it doesn't really need talking about, like you don't really need to endlessly discuss the database normal forms like people did in the 00s."

Has humanity progressed so much that we no longer forget the lessons of the past?

That would indeed be a good thing but I am not so sure of it.

Re: Solid and Clean Code never felt solid or clean to me

#29
post #6

I clicked the link hoping for a critique of the ideas in SOLID and Clean Code, but what I got was an ironically long-winded critique of Bob Martin’s speaking style. Martin and I have our differences, but this article isn’t really useful. Martin has a brand and a style. A lot of people find it engaging and entertaining. If you don’t, that’s fine, there’s plenty of other ways to learn about the ideas that are more conc…

> [..] There’s plenty of other ways to learn about the ideas that are more concise.

Would you have any good resources to share?

Re: Solid and Clean Code never felt solid or clean to me

#30

For some actual code and comparison of principles behind Clean Code see: https://github.com/johnousterhout/aposd-vs-clean-code

And at the end of that Bob says:

> For my part I'll just say that I have given due consideration to the points you've made, and while I disagree with your conclusions above, I have integrated several of your better ideas, as well as this entire document, into the second edition of Clean Code.

Post reply on HN