The Uncle Bob Martin definition of "clean code" from his book "Clean Code: A Handbook of Agile Software Craftsmanship" is a set of rules that absolutely are not at odds with one another. If you follow them you will end up with code that's really nice to read and easier to maintain, and, most importantly, that you can confidently change. There's a decent summary here - https://gist.github.com/wojteklu/73c6914cc446146b…
> is a set of rules that absolutely are not at odds with one another Yes, if you take them as general guidelines, not dogmatic rules with variable interpretations The latter is exactly what his fans do > 2 .Keep it simple stupid > 2. Prefer polymorphism to if/else or switch/case. No, not at odds with one another...
There’s No Such Thing as Clean Code
71–80 of 395 posts
Re: There’s No Such Thing as Clean Code
#72The Uncle Bob Martin definition of "clean code" from his book "Clean Code: A Handbook of Agile Software Craftsmanship" is a set of rules that absolutely are not at odds with one another. If you follow them you will end up with code that's really nice to read and easier to maintain, and, most importantly, that you can confidently change. There's a decent summary here - https://gist.github.com/wojteklu/73c6914cc446146b…
> is a set of rules that absolutely are not at odds with one another Yes, if you take them as general guidelines, not dogmatic rules with variable interpretations The latter is exactly what his fans do > 2 .Keep it simple stupid > 2. Prefer polymorphism to if/else or switch/case. No, not at odds with one another...
Re: There’s No Such Thing as Clean Code
#73The Uncle Bob Martin definition of "clean code" from his book "Clean Code: A Handbook of Agile Software Craftsmanship" is a set of rules that absolutely are not at odds with one another. If you follow them you will end up with code that's really nice to read and easier to maintain, and, most importantly, that you can confidently change. There's a decent summary here - https://gist.github.com/wojteklu/73c6914cc446146b…
> is a set of rules that absolutely are not at odds with one another Yes, if you take them as general guidelines, not dogmatic rules with variable interpretations The latter is exactly what his fans do > 2 .Keep it simple stupid > 2. Prefer polymorphism to if/else or switch/case. No, not at odds with one another...
Re: There’s No Such Thing as Clean Code
#74Coding is a highly subjective and creative endeavor. "Clean code" is akin to "well written" for writers. Sure, you can analyze and even be able to define some good practices, but because we are always creating something new that has never done before, and the field is infinitely complex, no rules can be set in stone and applied across everything. In my opinion there's nothing wrong with calling code clean, we don't h…
Writing is a great metaphor: there aren't any hard-and-fast rules and there's certainly a subjective quality to it... but also, some writing is clearly better and some writing is clearly worse. Maybe there is no such thing as "good" writing because writing can be "good" in different ways or because we can never fully define what "good" means, but that doesn't mean that all writing is equal or that "everything is a tr…
Like music and other forms of art, different styles appeal differently to different audiences. Many people find the language that 8 year olds write in to be terrible, and some people find it endearing and honest and meaningful. Software is no different in my opinion
Audience always matters
Re: There’s No Such Thing as Clean Code
#75Our industry features codebases that approach “big balls of mud” as complexity increases. Last week it was called “agile”, this week “clean code”. Perhaps “agile microserviced functionally hexagonal clean code” (AMFHCC™) next?
Re: There’s No Such Thing as Clean Code
#76Clean code is code that does what you expect it to do without many surprises. It is simple, not clever. Effortless to follow. Each part handles one idea at a time, at the same abstraction level. Doesn't force you to mentally juggle many balls at the same time. The code often tells you a story, it communicates how the programmer (author) described the problem, the solutions and the trade-offs. Very similar to writing.…
What you can easily follow though is largely a function of your programming background. An experienced Haskell programmer will have no issue following all kinds of “.” and “$” usages, but one who is not experienced with Haskell, even if they learn what the syntax means, will have trouble following it.
Re: There’s No Such Thing as Clean Code
#77The fact that everyone can come up with his own definition of what "clean" is supposed to mean regarding code, tells us something very important about it: It has no intrinsic, defined meaning in the context of code. Saying code is "clean" is like saying food is "tasty"...its a personal opinion, not a defined term.
It's not objective, but there is a consensus among peers.
Honestly, it is like art, but these analogies kind of fall flat since we're not all "artists" in the traditional sense, usually. The reality is, for a painter, there are things that come close to objectively "good" works, a lot more so than for the layperson, and an experienced painter can walk you through all the different "types" of "good" art, just like an experienced coder can walk you through all the different "types" of "good" code.
Just because we can't write down in a few pithy words what "clean code" is doesn't mean it doesn't exist, it just further confirms something we've all known for a long time now; code is art.
Re: There’s No Such Thing as Clean Code
#78https://bitfieldconsulting.com/golang/crisp-code
https://overreacted.io/goodbye-clean-code/
Re: There’s No Such Thing as Clean Code
#79Earlier quoted context omitted.
> is a set of rules that absolutely are not at odds with one another Yes, if you take them as general guidelines, not dogmatic rules with variable interpretations The latter is exactly what his fans do > 2 .Keep it simple stupid > 2. Prefer polymorphism to if/else or switch/case. No, not at odds with one another...
Hmm...polymorphism is almost invariably simpler than if/else or switch/case, so not seeing the contradiction.
Re: There’s No Such Thing as Clean Code
#80And I agree with him. Things like SOLID and "Clean Code" really are just buzzwords nowadays that don't mean anything.