1. 33
  1.  

  2. 25

    I liked a Bob Martin talk once, and in retrospect, I realize the key thing I took away from it was a Ward Cunningham citation 😛

    I find his politics repugnant, I don’t find his technical insights great either. This is a good explanation of a class of shortsightedness he preaches. I feel that he conflates whether something feels good or bad to him with objective properties of correctness and righteousness. I feel like he did this in tech without much alarm, but we’re noticing the habit when we see him apply it to politics.

    On his politics, I speculate he values order, civility, and structure in his worldview, and has a model that people are generally well-intentioned and competent. In this framework, the real villains are the people who threaten his mental model of this. The people who compare living ICE Agents (who look like him, maintain order) to Nazis in the 1940s (at this point an abstract concept to him and very clearly Evil) are making a false equivalence. He hears about policies and likely Shirley Exceptions them in his mind as being designed and executed by reasonable people, so the folks complaining must be exaggerating, and because it bothers him to consider that maybe they’re right (because what a horrible world that would be!) he’s angry at them for making him even consider it.

    In a similar way, he devalues any tools or methodologies that are outside his immediate strike zone, but doesn’t recognize it as “outside my strike zone” but as “not useful to software.” Unit tests? I use them and like them, so they’re Good Code! Static types? I don’t like them, so they’re Actually Bad, because you can write tests! Formal verification? I don’t use it, so it’s Academic Wankery. And so on.

    My relationship to clean code is that I enjoy designing it, like tending a garden, but I can’t prove that it’s helped me write software more effectively beyond that endorphin rush I get when I pat myself on the back. In practice, every codebase that served customer needs I’ve ever touched has had a lot of mess, and I became a lot happier when I embraced that it was probably just part of the game. tef articulates some thoughts I like and experiences I share ,and Sandi Metz talks about duplication in the same way I currently think of Clean Code: not Bad, but probably not worth optimizing for.

    (and frankly, I can’t get inside the mind of a person who looks at a diagram like this and feels anything positive)

    Anyway, I hope he gets of Twitter for a bit; meltdowns can be a nightmare.

    1. 3

      I think that diagram is pretty neat even if it is overkill for some things. What don’t you like?

      TBH, I found my way to these architectural sensibilities after a lot of makework, err, Rails major version upgrades. I realized there are probably lots of devs who really don’t mind. Personally I hate the idea of delegating my architecture to DHH because The Community prefers fungible devs to higher skill ceilings.

      1. 3

        “QuickCheck is older than JUnit. TLA+ is almost a decade older than popular TDD. MDE is almost a decade older than TLA+. Z-specification is older than C++ and Smalltalk-80. If anything, unit testing is the “new and shiny” thing! “

        I like that part. I overlooked it the first time I read it.

        1. 1

          Yeah Uncle Bob definitely likes kicking the hornets nest. I think his TLD views are a bit dogmatic and I don’t really like that he’s fully unwilling to even consider the merits of static typing. I also find it a bit silly that he’s unwilling to even weight that someone can refer to the Nazis not to indicate that someone is “cartoonishly evil” but rather actually relating to actual Nazi policies of Nationalism and populism.

          We like to think that Nazi policies are universally hated but the reality is they aren’t, and to the right public they can be quite enticing. Your wages can double over night, and you won’t have to deal with pesky outsiders. People will simply follow the rules and if they don’t they go away. All you have to do is not worry about those who aren’t there tomorrow.

          People are genuinely afraid of real Nazi ideals taking hold, not just “the other guys”. I have yet to talk to any actual republicans support the separation of families. It stands to reason then to at least have some mild fear that power seeking radicals might be attempting to co-opt American ideals for the sake of a power grab through the vehicle of nationalism, populism, and racial tension. Maybe that fear is just a fear, but it’s not just a way to paint the other team as bad guys.

        2. 11

          I’ve read a number of posts by Uncle Bob that I’ve disliked - I don’t think that programmers are a special class of people who are duty-bound to take an oath to uphold the honor of the profession, as opposed to just people with a particular skill/interest in manipulating computer systems; and he’s said things about unit testing vis a vis static typing that I thought were wrong. In light of this though:

          Only when he writes something that I strongly disagree with, does the hunch about Clean Code became clear. The > last days on Twitter we watched Uncle Bob implicitly decry the violation of Godwin’s law rather than the internment > of thousand children under conditions that Amnesty International compare with torture. In the following days, Uncle > Bob fought back against his critics also stressing that he thinks the situation is horrible, “but…” not as important as > “unhonorably” comparing others to Nazis. I think his priorities are horribly wrong. I responded “In light of @unclebobmartin’s recent tweets, ideas like Clean Code have started creating a bad taste in my mouth. Let’s just say “code”, eh? I’m officially instituting “dirty code Monday’s” to remember to question dogma, tribalism and things- before-people mentality.” Bob asked me to explain “why you decided to lead a boycott against the concept of Clean > Code”. Thus this blog post.

          I think it’s pretty clear that this blog post is in large part motivated by a political disagreement rooted in very contemporary (as in, the past couple of weeks) American national politics, and that leaves a very bad taste in my mouth.

          1. 9

            I didn’t quite get this link either, though there are people who will reject all ideas that come from a person because of their disagreement with one of them. But, in this case, it seems like the author has been becoming disillusioned with Clean Code for a while.

            From other parts of the post, it seemed like the root problem the author has experienced is probably one of battling ideologies

            Some of the most unpleasant experience in my professional life have been due to disagreements of the Clean way to write some piece of Code. I know people that I respect professionally that could have been good friends if one of us hadn’t insisted on purity of code in some situation or another.

            and possibly burn-out

            I often leave the office 1-2 hours later than my co-workers after polishing some piece of ultimately meaningless code. This is time I don’t spend with my family. Because I’ve learned to care about Clean Code.

            But they seem to have reached the conclusion that it’s not worth caring about code quality, which to me is throwing the baby out with the bathwater.

            As I’ve grown older, I learned to stop getting upset about “Unclean” Code. In any real world code base there will be an uncountable number of unfortunate quirks, odd and ends. Things are the way they are because they got that way. People did what they did because of reasons. Those reasons are valid, whether it was because the surrounding needs changed, because the developer had insufficient experience, because they wanted to go home to their family instead of sitting late in the office or if they just had a difference in opinion on what’s good code.

            I’d agree that it’s probably not good (or productive) to get upset about ‘“Unclean” Code’, but the idea that everything is the way it is “because of reasons. Those reasons are valid”, is far too reductive for me, and just feels like giving up.

            1. 6

              Relativism of code quality seems to be en vogue nowadays. I’ve seen extremes of it, up to the ridiculous “there is no bad code, just bad circumstances forcing bad code to happen.” People are projecting their nature/nurture beliefs into software dev. Also, it feels more like pushback to the dogmatism of clean code that went around for awhile. But like many “anti-“ movements, it doesn’t offer much guidance beyond “don’t do that thing!” Which I guess makes it a great tweet to post?

              So, I’m pretty bummed he just arrives at a relativistic argument and declares himself enlightened. It is quite possible to write clean code and go home at 5, or even earlier. Perhaps one can write a few tests instead of reading hot takes on Twitter/HN?

              Code quality is almost entirely up to developers. Don’t give up on it because it can be a demanding task.

              1. 11

                IMO there’s a difference between “code quality” and “clean code”. “Code quality” is a general term for code that has some desirable property, usually legibility, little tech debt, and simplicity. “Clean code” is a specific, idiosyncratic style of writing code that purports to be objectively better.

                See for example Martin’s extract till you drop, where he replaces a 10 line method with a 4 line method… and six additional helper methods.

                1. 2

                  That reminds me of my controversial post about using local variables rather than extracting methods. There are some who insist that the method explosion caused by extracting everything is desirable - a lot of times I think YAGNI.

                2. 7

                  Relativism of code quality seems to be en vogue nowadays. I’ve seen extremes of it, up to the ridiculous “there is no bad code, just bad circumstances forcing bad code to happen.”

                  I think it starts out from Chesterton’s Fence, which I see trotted out fairly regularly, but then it is carried too far. It goes from “make sure you understand why the fence/code was put there before you remove/change it” to “whatever reason the code/fence was put there must have been a good one”, which is different. It also misses the difference between why the fence/code was put there, and the quality of the fence/code itself.

              2. 3

                It’s true that this situation in which he tells us that the separation of parents from their children while they face summary judgement without due process is not all that bad after all could just be an isolated incident, but it isn’t. He’s also the person who says that unless you write software his way you are unprofessional. The person who said that James Damore had a good point and maybe we should have listened to him instead of letting him get fired. The person who said that it’s fine to call all professionals “men”. So maybe this was, for OP, the straw that broke the camel’s back.

                I have been asking for years that we get better heroes in our trade, I’m happy to no longer be alone in that.

              3. 21

                It’s unfortunate when a useful conclusion (“We shouldn’t be slaves to Clean Code ”) is reached by faulty reasoning (“The person who espouses Clean Code said that we should be more precise in who we call Nazis, therefore they oppose us, therefore they are a Nazi or Nazi sympathizer, therefore we should question their previous professional dogma”).

                1. 17

                  Funny how you converted

                  I think his priorities are horribly wrong

                  to

                  therefore they are a Nazi or Nazi sympathizer

                  1. 0

                    Seemed reasonable given the way the thread he mentioned evolved in the comments.

                    And honestly, it’s pretty popular to call people Nazis nowadays. ¯\_(ツ)_/¯

                    If you want to continue discussing, feel free to hit me up on PMs–it’s not good to clutter up Lobsters with this stuff.

                    1. -1

                      I mean we’re approaching the anniversary where we had a white nationalist rally where 3 people were killed and 34 were injured. Kinda seems like if you don’t want to be having quibbles around hot button issues maybe don’t invoke them especially while the flames are hot. Consider that it’s possible people are calling people Nazis because they are genuinely afraid they are Nazis and not some rhetorical tool.

                      I’m not trying to like pass any political judgements about you, just like keep in mind that different people come from different cultures and different social environments. Neo-nazis definitely still do exist and they still do terror attacks. For some people the reaction may be more visceral because of where they are.

                      All that aside, I think the criticism of conflating these two DEEPLY unrelated points is totally valid. The arguments against following Clean Code dogmatically are orthogonal to the debate about real or imagined Nazism. It’s rare that someone is wrong in every possible way at the same time. Therefore it’s unreasonable to think that someone’s wrong opinions about one thing might have any bearing on totally unrelated things. Often people luck into a good solution without having put much thought at all into it.

                2. 5

                  As a programmer who does the stuff as a hobby, this struck a chord - it’s not about doing things The Right Way, it’s about enjoying it. Sure, sometimes doing things Correctly can make things more enjoyable, but, as the article says, that doesn’t imply that Correctness should rule over everything.

                  See also: this post from eev.ee.

                  1. 4

                    Seems like an over-reaction to me. It’s quite plausible that Uncle Bob is misguided in his politics but still right about a lot of things in programming. Speaking from personal experience, I used to be an evangelical Christian and a conservative Republican. I’ve now renounced those positions, but I still think I did some of my best programming work back then.

                    1. 2

                      I was blissfully unaware of Uncle Bob’s politics until this post, but have never liked any of the advice I’ve read of his on programming specifically. (My dislike stretches across multiple dimensions too; everything from the expression of certainty to the technical ideas themselves. When you’re that certain about something, my bullshit detectors go off because I am just certain that something is being omitted. ;-))

                      With that said, I agree with your point. History is absolutely littered with individuals who have done or believed crazy things despite doing other things that clearly require strong talents and gifted intellectual abilities (which may have been used for great good or great evil).

                      1. 1

                        I don’t think the two are related in any meaningful way, but I don’t like his politics and I don’t really like his programming. People can lack epistemological responsibility in any political context, lacking the basic questioning that keeps us effective. I’ve seen it on both sides of the political spectrum. Sometimes even people who lack that questioning luck into a good solution or good politics.

                        Being correct on any issue doesn’t mean you understood why that thing is right. Before someone lambasts me for saying there is such a thing as bad politics consider the worst possible political position imaginable such as the eradication of all humans. Surely someone here will disagree with me on that but I reserve the right to consider it bad.

                      2. 3

                        It’s kinda funny that two sort of ideals that programmers are attracted to are “clean code” and “unix philosophy”.

                        Sure, you might think of “composable one-thing-well” when you hear “unix philosophy”, and that’s actually kinda related to clean code. But unix philosophy is also “Worse is Better”! And that’s the “unix practice” too. Unix is sysctl and ioctl. Unix is “// you are not supposed to understand this”. And yet sometimes the same people aspire to both it and clean code…

                        1. 1

                          i don’t see the contradiction. “worse is better” means functional consistency or correctness is not as important as keeping the code clean. stuff like ioctl and “you are not expected to understand this” are warts which unix philosophers generally don’t aspire to.

                          1. 1

                            Unix is “// you are not supposed to understand this”.

                            Was this not a point written for Lyon’s commentary on Unix, equivalent to “This is boring implementation detail, that is not on the test”, rather than an affirmation of some kind of deep magic.

                          2. 3

                            “Code is not important. Principles are not important. Rules are not important. People are important.”

                            The guy that says that principles and rules are not important than gives the principle/rule that people are important. In a professional setting the only thing that matters is the problem and solving it, not the people, code, tools, etc. they’re all mutable.

                            1. 3

                              I think this article conflates two different points.

                              1. People are more important that things.
                              2. Uncle Bob’s Clean code philosophy might be bad.

                              I don’t think the author is wrong with the conclusions but I think the author is wrong with the logical steps that lead to the conclusions. You can enact any coding standard with compassion but that doesn’t necessarily mean that it’s a good policy. By contrast you can also enact any coding standard with an iron fist and that doesn’t necessarily mean that it’s a bad policy.

                              1. 2

                                Clean code, pure code, agile code, pragmatic code, elegant code, simple code, awesome code, …

                                Let’s talk more about the big ball of mud.

                                1. 1

                                  Forgetting about Clean Code sounds like the least compassionate thing you could be doing.

                                  1. 1

                                    I think we should stop doing <Adjective> Code. Just write code. As long as code works to the specification, all solutions are equally valid and “good/clean/compassionate”. I don’t like when people preach me TDD or Unit tests or Mocking or Object Orientation or Functional or Formally Verified or anything.

                                    I’ll write using TDD when I feel it necessary. Same for all the other previously mentioned methods. I’m an engineer and I will not use one tool, like any of the above, for all my problems. I use a hammer for the nails, a screwdriver for the screws and a CNC for the metal parts.

                                    The right tools for the right job.

                                    1. 2

                                      The problem with “right tool for the job” is that as a platitude it contains no information so can be used to defend any position.

                                      You want to avoid learning anything new? Stick with 1970s tech, it’s the right tool for the job.

                                      You want to switch our core systems to that thing you read on hackernoon an hour ago? Go for it, it’s the right tool for the job.

                                      You think you should TDD all the time? Well it’s the right tool for the job, so go ahead.

                                      You think you should avoid TDD and get on with coding? Sure, that’s the right tool for the job.

                                      1. 1

                                        That’s quite intentional.

                                        There is no one true right tool for the job because the right tool for the job in programming is partially subjective. Additionally learning something new isn’t coding. It’s learning. It also does not exclude simply experimenting with new tech either.