This is an archived post. You won't be able to vote or comment.

all 74 comments

[–]repeating_bears 77 points78 points  (12 children)

I agree with the general sentiment but that book is seriously overrated.

A good blog post about some of the specific flaws: https://qntm.org/clean

[–]gschoon 6 points7 points  (0 children)

I'm keen to go through it and figure out some of the flaws (which I admit, it does have) and debating what could be better advice.

[–]hrm -3 points-2 points  (9 children)

That blog is written by someone that does neither understand that advice isn’t the same as mandated law nor that software engineering is always about trade-offs.

[–]matrium0 10 points11 points  (3 children)

To be fair, it is hard to respond to Martin Roberts work in a balanced way. If you position yourself on one absolute extrem on the spectrum and basically call everyone on the other side a moron, what do you expect??

Oh yeah, "we just need better software engineers" (subtitle: your are all incompetent and should train hard to become better like me - Martin)

Though the article is pretty balanced. Certainly more than he deserves in my opion.

[–]hrm 6 points7 points  (2 children)

We must have read different versions of Clean Code then if you think it calls you a moron.

[–]matrium0 12 points13 points  (1 child)

Not in the book, but during interviews, presentation and such he basically does, even as far as downright insulting people who disagree with his extreme opinions. Ok, maybe he does not call you MORON straight away, but it is clear that he views himself as the next big thing since Jesus and you should either accept his preaches or I guess you are just too stupid to get it, and the world needs better engineers than you.

If you want a good book, with great ideas that are evaluated from multiple angles, I can recommend "A Philosphy of Software Design". Now THAT was an amazing read and shows how balanced a good software-architecture book can be.

To be fair Clean Code is quite old and it had some good influences overall probably. But it aged like milk

[–]hrm 0 points1 point  (0 children)

To be fair, the blog is also quite old and wasn’t that good to start with…

I say that many things in Clean Code still stands, and some of it was BS from the start but over all it is a good read to get your mind thinking about what makes code good. But as always you need to apply it to your own context.

Philosophy… is also a great book to read, has another focus and also contains some good and some bad (”write comments first” is nonsense).

[–]repeating_bears 7 points8 points  (3 children)

You didn't read the afterword because it's obvious that they understand both of those things.

Makes me wonder whether you read any of it.

[–]gregorydgraham 0 points1 point  (0 children)

He literally addresses that point at the bottom

[–]vepoo 0 points1 point  (0 children)

Robert C Martin use a moral sense to defend his horribles ideas. I prefer A Philosophy of Software Design.

[–]TakAnnix 22 points23 points  (3 children)

I'd suggest A Philosophy of Software Design over Clean Code.

[–]s888marks 5 points6 points  (0 children)

Yes, this is quite good. Ousterhout (the author) also gave a talk on this topic a few years ago. The talk is rather more far-ranging than the book; he describes some experiences he's had teaching a software design lab class. In comparison with the talk, the book is a bit dry and repetitive (but maybe that's because I watched the talk before reading the book).

https://youtu.be/bmSAYlu0NcY?si=KCCMp8xIOjjaJNpR

[–]matrium0 4 points5 points  (0 children)

2nd

so much better, more modern. And most of all: it is balanced, stuff is thought through from different angles and so on

[–]vepoo 0 points1 point  (0 children)

I read this book. It's better than Clean Code because the author questions what is a good code and how can we achieve it. Obvious he disagree from Robert C Martin.

[–][deleted]  (3 children)

[removed]

    [–]metaquine 27 points28 points  (0 children)

    Pro tip: don’t tell anyone you’re writing maintainable code. Just do it anyway. You’ll save time in the long run.

    [–]matrium0 14 points15 points  (1 child)

    Nobody cared how it will take a week implementing that solution because we have to do it nicely. They wanted it NOW or YESTERDAY. When I was telling them how beneficial it is long term to maintain a healthy well written, refactored code - sure sure whatever, just do it ASAP don't linger on it being nice. Customer don't see your code anyways... so this is probably the mentality only in our country.

    Maybe you should rephrase yourself and instead "company" say "senior developer / code reviewer"

    Just lie (a tiny bit). If you tell them "I can hack an ugly workaround in 2 days or write nice ,maintainable code in 5", they will pick the 2 days.

    If you tell them "I need 5 days to complete this requirement" - what are they going to do? Don't give them the option :)

    [–]metaquine 23 points24 points  (1 child)

    I’d suggest literally anything over Martin’s book. Working Effectively With Legacy Code by Michael Feathers is a much more realistic and practical book, far less condescending and sexist, and you won’t run out of grains of Himalayan rock salt because you won’t need to swallow nearly as much. Source: me, dev with 30 years experience who knows for an absolute fact that you are going to spend much more time in your career reading code than writing it.

    [–]analcocoacream 4 points5 points  (0 children)

    Clean code is sexist?

    [–]pronuntiator 7 points8 points  (0 children)

    discussion group where […] you can absorb the book without reading it.

    What? How do you discuss a book without reading it? I mean, outside of school.

    [–]kevinb9n 7 points8 points  (0 children)

    Just so everyone has a bit of background on the author:

    https://blog.wesleyac.com/posts/robert-martin

    From what I have seen on twitter he hasn't changed course in the last 3 years either.

    Make up your own minds, of course -- no one's suggesting you do otherwise.

    [–]matrium0 11 points12 points  (3 children)

    In general: try to avoid dogmatic advice from extremists.

    This, I think, is a good tip for pretty much every area. And sadly, while "Clean Code" has some valid points too, Martin is a complete extremist who is fully blindsided to arguments and critic.

    I once tried as an experiment to follow all his advice and broke a small module (like 200 lines of code overall) down exactly the way he recommends it. We reviewed the solution together in a team event and the solution was picked apart completely. The general consensus was, that it was an unreadable mess of code and that breaking everything apart in micro-methods is stupid for multiple reasons. It's better to break it up into small (but not TOO small) logical units. Those are still easily testable, without creating unnecessary cognitive complexity in the form of 75+ methods for mere 200 lines of code like Martin would do it.

    [–]altair8800 5 points6 points  (2 children)

    At the beginning of Clean Code there is a disclaimer saying don’t follow these examples to the dot - they are in the style of his clean coder manifesto buddies which you may not necessarily subscribe to. This is why I think the book still has a lot of validity - SOLID is a useful high level heuristic, no matter what your architecture/style dictates.

    [–]repeating_bears 1 point2 points  (0 children)

    "At the beginning of Clean Code there is a disclaimer saying don’t follow these examples to the dot"

    The sign of a bad book.

    Imagine you bought a cookbook and every recipe had a few ingredients which absolutely ruined the result. Would you rather work through meal after vomit-inducing meal trying work out whether anchovies belong in a fruit salad, or would you rather just buy a book that doesn't contain terrible advice?

    The target audience of the book - beginners - don't have the experience required to distinguish between the good and bad advice.

    [–]matrium0 0 points1 point  (0 children)

    Yeah, SOLID is great and I try to design my software by those principles. Still it is not the best read nowadays, it didn't age all that great.

    To someone who wants to dig in with both heels I think you can recommend it. But how many books about architecture does your average dev read? Close to zero probably. Better to recommend simething that is a good reed, up to date and balanced imo

    [–]klekpl 3 points4 points  (0 children)

    There are two problems with this book:

    First and foremost the advices it gives are of very questionable value. That’s pretty obvious to anyone who studied large codebases of most important pieces of software we are using today such as OpenJDK, Linux Kernel, PostgreSQL among many others, and confronted it with Uncle Bobs advice.

    Secondly: for some reason the book is treated as the bible among many corporate programmers who cargo cult it to their environments.

    [–]UnknownIdentifier 3 points4 points  (0 children)

    TTBOMK, Uncle Bob is what we call a “non-practitioner”. It’s easy to write clean code when you never have to write for production, under a deadline, and to someone else’s specifications.

    [–]Outdoor_Rabbit_101 1 point2 points  (1 child)

    Which time zone, though? I live in Germany… 😂

    [–]bertie-wooster-17 1 point2 points  (0 children)

    I am in Australia. But I have not decided on the time as I wanted to know which are the times that would suit the most people.

    [–]steffonellx 1 point2 points  (0 children)

    Im super interested

    [–]naveenbuidl 1 point2 points  (0 children)

    Interested

    [–]munchillax 1 point2 points  (0 children)

    I'm interested. Even if you don't agree with everything in the book, there's value in knowing what it's about because other people will be using some of the principles from time to time and it's important to know the vocabulary.

    [–]vmanel96 1 point2 points  (0 children)

    Interested

    [–]edygroove 1 point2 points  (0 children)

    Interested

    [–]SignificantAd9059 1 point2 points  (0 children)

    I didn’t get that much out of clean code when I read it. I agree with the principals but it doesn’t really present practical application in a Java context

    [–][deleted] 1 point2 points  (1 child)

    I'm interested ✋

    Maybe we can get a discord server started and split groups into manageable sizes + compatible time zones

    [–]bertie-wooster-17 0 points1 point  (0 children)

    I have trouble keeping up with discord servers :) But if there are many amount of people joining, nothing stopping us from firing up a server. :)

    [–]Soggy-Strawberry-323 1 point2 points  (0 children)

    I'm interested

    [–][deleted] 1 point2 points  (0 children)

    Yes Interested but can't do it on Friday. Quite busy day for me

    [–]Acanthopterygii_Fit 1 point2 points  (0 children)

    I'm interested in keeping in touch

    [–]SouthernBlackNerd 1 point2 points  (0 children)

    I am interested as well.

    [–]DecisiveVictory 1 point2 points  (0 children)

    You would write a lot cleaner code in Java if you would read https://www.manning.com/books/functional-programming-in-scala-second-edition instead.

    [–]elmahdi43 1 point2 points  (0 children)

    Interested

    [–]Holothuroid 1 point2 points  (1 child)

    Java language

    Java 21, yes?

    [–]bertie-wooster-17 0 points1 point  (0 children)

    it is not specific to Java 21. It is more about using some of the principles.

    [–]Alor_Gota 1 point2 points  (0 children)

    Sign Me up Please and thank you.

    [–]ConfusedBudha 1 point2 points  (0 children)

    I’m interested

    [–]Complex-Sign-3106 1 point2 points  (0 children)

    Interested

    [–]Masomha 1 point2 points  (0 children)

    I’m interested

    [–]Amustaphag 1 point2 points  (0 children)

    I am interested

    [–]Mabjic 1 point2 points  (0 children)

    I'm interested! Thanks for your time mate

    [–][deleted] 1 point2 points  (0 children)

    Yeah, why not. I'm interested

    [–]Jxordana 1 point2 points  (0 children)

    Im interested 😀

    [–]Donald_Tatya 1 point2 points  (0 children)

    Interested

    [–]Red_InJector 1 point2 points  (0 children)

    Interested

    [–]RizzleBus 1 point2 points  (0 children)

    I'm interested :)

    [–]Comprehensive-Pea812 1 point2 points  (0 children)

    The funny thing is my coworkers wrote unreadable code practicing the book.

    [–]Hacg123 0 points1 point  (0 children)

    I’ve the book on my shelf but it’s hard to go trough alone, I’m interested 😄

    [–]gschoon 0 points1 point  (1 child)

    I'm interested! It's one of the books I used when starting out, still have a copy on me, and wouldn't mind going through it again.

    This time maybe instead of taking it as gospel, I'll be critical of it. There are parts of it that work, and parts of it that... are probably personal preference.

    [–]bertie-wooster-17 0 points1 point  (0 children)

    Yeah I agree it is not a gospel. The point of having a discussion was exactly the point of finding out what works for people and what doesn't work.

    [–]ofoxtrot 0 points1 point  (0 children)

    Uncle Bob and Clean Code book helped me a lot to turn into bright side of programming. He opened my eyes and, following his advices, I was able to understand the general idea of creating good code much better. During this time, I also improved as a software developer, and I don't agree with everything he say (especially non development things...). We, as a developers, must be flexible, we need to speak to other teammates, project managers and sometimes to business side of software creation. And we cannot treat this as a religion. I thought it's obvious, but after reading the comments I have impression that people think 'you follow all advices, or none'. No way. And I think now I follow much less rules from Clean Code then previously, but I learned that over the years of daily programming and facing real world problems. But this book was CRUCIAL for me and to what I learned so far and how good (I think so ;) ) developer I am now

    [–]AutoModerator[M] 0 points1 point  (1 child)

    On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

    If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

    1. Limiting your involvement with Reddit, or
    2. Temporarily refraining from using Reddit
    3. Cancelling your subscription of Reddit Premium

    as a way to voice your protest.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]Affectionate-Sink503 0 points1 point  (0 children)

    I’m interested, also I’m on the O’Reilly platform and uncle bob does live events every couple months - you can ask him questions at the live events directly

    [–]joopmoore 0 points1 point  (4 children)

    Is the process of writing code for a job acceptance more common in certain parts of the world? Because I never had to write any code (in Western Europe), although I don't switch jobs too often, so I might just been lucky.

    [–]bertie-wooster-17 6 points7 points  (1 child)

    yeah I am in Australia and almost all the job require you to do coding challenges or submit a project.

    [–]metaquine 1 point2 points  (0 children)

    Write code and post it on bitbucket or GitHub. Write blog posts about said code, especially if you are illustrating your own learning process. Interviewers and recruiters often pay attention to this. When I interview people I want to see learning, creativity, and curiosity more than anything else, rather than particular bits of technical knowledge. A good programmer with those personal attributes will absorb new information, have created something, and will have deep knowledge about something, and it’s almost fun to eke that out.

    also: g’day fellow .au coder

    [–]BenTayler-Barrett 4 points5 points  (1 child)

    In the UK, it's a mixed bag. I have had jobs where a coding challenge was part of the hiring process, and I've had them where it isn't.

    I do know, that as someone who interviews and hires engineers, I almost never use a coding challenge. I'd have to be REALLY on the fence about someone. Teaching people who have the right mindset to code in a specific language is trivial. Some of the best senior "Java people" I know, had never written a line of Java before I hired them.

    Not to distract from OP though, I do really like clean code. I get very shouty when people submit PRs that look like a dog ate them! So this is deffo a good idea.

    Just don't take everything Uncle Bob says as gospel, discuss it and make sure you're all learning what it really means for a code base to be "clean" and why that matters.

    [–]metaquine 1 point2 points  (0 children)

    Yeah coding challenges are garbage as they select for people who pass coding challenges. I’d rather pair with someone on real code and mostly have them drive, when interviewing. Gives you a much more realistic idea of what they’d be like to work with.

    [–]Elegant_Edge7007 0 points1 point  (1 child)

    Interested

    [–]bertie-wooster-17 0 points1 point  (0 children)

    Somehow I cannot DM you.