Clean Code: A Handbook of Agile Software Craftsmanship

share ›
‹ links

Below are the top discussions from Reddit that mention this Amazon book.

Books Computers & Technology Programming

Info from Amazon Listing

Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn’t have to be that way. Noted software expert Robert C. Martin, presents a revolutionary paradigm with Clean Code: A Handbook of Agile Software Craftsmanship . Martin, who has helped bring agile principles from a practitioner’s point of view to tens of thousands of programmers, has teamed up with his colleagues from Object Mentor to distill their best agile practice of cleaning code “on the fly” into a book that will instill within you the values of software craftsman, and make you a better programmer―but only if you work at it. What kind of work will you be doing? You’ll be reading code―lots of code. And you will be challenged to think about what’s right about that code, and what’s wrong with it. More importantly you will be challenged to reassess your professional values and your commitment to your craft. Clean Code is divided into three parts. The first describes the principles, patterns, and practices of writing clean code. The second part consists of several case studies of increasing complexity. Each case study is an exercise in cleaning up code―of transforming a code base that has some problems into one that is sound and efficient. The third part is the payoff: a single chapter containing a list of heuristics and “smells” gathered while creating the case studies. The result is a knowledge base that describes the way we think when we write, read, and clean code. Readers will come away from this book understanding How to tell the difference between good and bad code How to write good code and how to transform bad code into good code How to create good names, good functions, good objects, and good classes How to format code for maximum readability How to implement complete error handling without obscuring code logic How to unit test and practice test-driven development What “smells” and heuristics can help you identify bad code This book is a must for any developer, software engineer, project manager, team lead, or systems analyst with an interest in producing better code.

Reddazon may receive an affiliate commission if you make purchases on Amazon.com through this site. Thank you for using these links to support Reddazon.

Robert C. Martin

Reddit Posts and Comments

0 posts • 70 mentions • top 50 shown below

r/cscareerquestions • comment
40 points • chasenyc

Clean Code taught me how to write clean code. Cannot recommend this book enough, every place I've worked I've brought a copy and at least one coworker will borrow it and find themselves really questioning a lot of their decisions. It's also a great book to refer back to every few years.

edit: Truthfully, some was experience, seeing other people's code early on. Discussing with peers. Thinking about single responsibility et cetera. I don't think there is one source but the book is something at the top of the list.

r/learnjava • comment
16 points • iamsooldithurts

Poorly written code generally doesn’t follow Best Practices, but includes issues like using inappropriate algorithms and data structures to manage data, and bad design decisions.

I recommend Clean Code by Robert Martin https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

He does a great job of highlighting what makes code readable, and maintainable, especially in the context of Java and OO Design and OO Programming.

I’ve heard some call it controversial. But after more than 20 years in the industry ( username relevant) I find him to be particularly on point and accurate. Personal preference aside, he knows what he is talking about and tells it like it is.

r/java • comment
4 points • Hakky54

Other than the standard naming conventions I try to use the project standards when joining to an existing project. I also use the best practices from Clean Code by Robert C. Martin, I could definitely recommend that one. Not only it mentions good naming conventions, but also other best practices.

r/hungary • comment
3 points • da3mon_01

Nem csak linter számít, hanem az is maga kódod hogy van felépítve, mennyit kell gondolkodni h mit is írtál valójában.

Ez egy remek könyv a témában: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

r/learnprogramming • comment
3 points • AmplifiedTreble

Read the book Clean Code.

r/nuclear • comment
2 points • whatisnuclear

Awesome! That's good to hear. I used MATLAB and C++ in college and I wish I had Python back then.

If you're feeling comfortable with the tools and want to keep learning, I always recommend the book Clean Code as a next step.

Software is a tool. Real value in nuclear designers is balanced between their ability to use tools to Get Stuff Done™ and their knowledge of reactor design philosophy, which can only be gotten from a great master or team (if you have one) or from reading old stuff like mad.

What else? Uh...if you want a fast reactor job, know the shape of key cross section curves off the top of your head. Roughly what energy do all actinide capture cross sections drop precipitously? What effect does this have on reactor dynamics?

r/learnpython • comment
2 points • shaq_disel

Amazing stuff bud. Congrats! How about creating different modules for the code. It would be easier to read. Oppose to having everything in one module. Also whenever you get free time give Clean Code a read.

r/vulkan • comment
2 points • Robbie_S

Clean Code

Chapter 3: Functions - Function Arguments > The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided where possible. More than three (polyadic) requires very special justification—and then shouldn’t be used anyway.

r/learnprogramming • comment
2 points • gramdel

No, it's not just about shortening syntax. Shortening syntax could be the opposite of clean code sometimes, like for example readability is more important than compact code in most cases.

It's about proper layering, error handling, naming, uniform formatting, testing and a lot more.

Here is a good book about it https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

r/datascience • comment
2 points • Aidtor

There are a lot of great comments here talking about tooling and error handling which you should pay attention to. However writing tests, using CI/CD, writing error handling, etc. will only ensure that your code is correct. Correctness is necessary, but not sufficient for production code.

Production code is code written to be understood and by someone other than the person who wrote it. This includes things I’m sure you’ve heard such as comments, descriptive variable names, and doc strings, but it also encompasses how you approach writing code.

How detailed are your commit messages? Do you write descriptive PRs that explain why and how you are doing something? Are you taking the time generate formal documentation? Are you following the single responsibility principle?

The above is just a snippet. It’s a lot to learn, but that’s ok. No one expects you to know how it all. If you want to prod code, start practicing on your own. Write doc strings, write PR messages to yourself, make atomic commits. Go read clean code. There is a good reason it’s a classic.

Most importantly though, you should practice writing code with people. You will grow much much faster if you get other people’s eyes on the things you write. If your team doesn’t do code reviews consider contributing to an open source project. Preferably a smaller one because the maintainers will have more time to devote to you.

You should also read as much code as you can. This will teach you things like convention, design patterns, appropriate levels of abstraction, etc.

r/Romania • comment
2 points • Trestenic

Pentru proba practica iti recomand sa citesti o carte de clean code, de ex. https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Te va ajuta si la interviu dar si dupa in cariera.

r/cscareerquestions • comment
2 points • MalleableWhiskey

Check out Clean Code. Some fun tidbits are below.

>Why am I so down on comments? Because they lie. Not always, and not intentionally, but too often. The older a comment is, and the farther away it is from the code it describes, the more likely it is to be just plain wrong. The reason is simple. Programmers can't realistically maintain them.
>
>Code changes and evolves. Chunks of it move from here to there. Those chunks bifurcate and reproduce and come together again to form chimeras. Unfortunately the comments don't always follow them -- can't follow them.
>
>The proper use of comments is to compensate for our failure to express ourself in code. Note that I used the word failure. I meant it. Comments are always failures. We must have them because we cannot always figure out how to express ourselves without them, but their use is not a cause for celebration.

Comments can often be a code smell. There should never be redundant comments. Your method name and signature should tell you those 3 things you're saying you're writing comments for on simple methods. Comments are code, which means they have to be maintained. Programming 101 is don't repeat yourself. If you write a comment that is already clear in code you just repeated yourself.

I know this is a very polarizing topic, and I think last time I brought it up on this subreddit people flipped their shit. But that's my opinion, and this author's opinion, and I agree with it. Comments were ultra important in college, you were literally graded on them, which I think is why a lot of people defend them. Because those people are students. I thought this way once as well.

Every time you write a comment, your first thought should be "Before I comment this, is there a way I can refactor my code to make it clear/obvious what this does?".

If your methods are so big or complex that you can't understand them quickly, then you should ideally be refactoring those methods so that you can.

r/cscareerquestions • comment
1 points • ShadowWebDeveloper

I'd read Clean Code for a good overview. It would still be helpful to know what parts of your code have been less than readable in the past, so I could make specific suggestions.

r/webdev • comment
1 points • singeblanc

> Clean Code by Uncle Bob

Amazon book link

r/androiddev • comment
1 points • Z1YHTDraXX

Reading and following these guidelines would be my first step: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

r/webdev • comment
1 points • geek_on_two_wheels

Read Clean Code by Robert C. Martin (aka Uncle Bob).

IMO it should be required reading for all devs.

The best code needs no comments and documents itself because it's written in a way that's easy to reason about. This helps your coworkers understand what you did and helps you when you come back to code you wrote last month or last year.

r/learnprogramming • comment
1 points • slowfly1st

I suggest to read Clean Code. Improved the "cleanliness" of my code a lot.

r/learnprogramming • comment
1 points • _fromouterspace

I recommend reading Uncle Bob's Clean Code, it has good practices every programmer must know.

r/softwaredevelopment • comment
1 points • Chimertech

The point where you know that you've gone too far is when the technical debt is so strong, you have to actively fight the codebase to get work done. Things that should take you minutes or hours end up taking hours or even days to implement and test. Or if it's not directly code related, the maintenance cost becomes so great that you spend so much of your time and resources maintaining the system, you have little to no time for feature work.

Of course, in a perfect world, we wouldn't do this - we would allow developers enough time to fix any tech debt they come across, always leaving the codebase in a better state in which they found it.

If you haven't already, do check out Uncle Bob's Clean Code.

Unfortunately, in the real world sometimes cleaning up tech debt doesn't have any tangible results for stakeholders, in which case it keeps getting swept under the rug, until the developers can't take it anymore and either a) they demand a rewrite, b) good developers start leaving for a different project or company, or c) development comes to a halt.

I've seen a and b happen. I'm currently the only developer left on the team, and just gave my notice today. Manager is understandably concerned about the project. But it is what it is.

r/learnruby • comment
1 points • rmz92

I’d recommend the book clean code. It uses java syntax but the principles they talk about can be applied to any language.

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

r/Python • comment
1 points • fabulousMoonLord

Hey, awesome work! I have to admit I'm not super familiar with python (more of a C++ guy myself) so I have some questions:

  • Looking at the code, I see your a lot(all?) of your classes are non-mutating. They return a new instance anytime data needs to be mutated. Any particular reason why?
  • At line 498: any reason that it's not len(self.parsers) == 1 and not len(self.parsers) != 1 ?
  • There seems to be a number of unused classes (CtxStore, CtxLoad, AnyIndent etc). And code in those functions hints to me that you're building some form of language interpreter. Do you have a general idea of the language you're trying to make or are you just trying things out?
  • If this were a C/C++ code, I can confidently say that your naming conventions are... well.. less than ideal. But again, it's python, so maybe shorter names are the trend here. But could you please explain to me why almost every class (Token, Tag, Lit etc) is a subclass of Parser?

Now for some remarks:

mul = i['*' >> i == 'mul',
        '/' >> i == 'div',
        '%' >> i == 'mod']

add = mul['+' >> mul == 'add',
          '-' >> mul == 'sub']

parser = add << eof

I... what's happening here? Personally, I would expect == to be a comparison operation, not something that just hands out a Tag ? I would love it if you could use a bit more descriptive function names, like i.makeLiteralParser('*').tagWith('mul') (I'm assuming that's what it does, but you get the picture) instead of '*' >> i == 'mul'

All in all, the above point is my biggest gripe. The name of things are really important as they reveal your intent. What's even more problematic is usage of custom dunder methods that sways too much from their traditional meanings because they can misled the reader. And that short names (like i) don't help, either. If you have time, definitely check out Clean Code by Robert Martin. It's a timeless classic.

Other than that (and some typos like promisse and anyting), the project looks super dope! I hope you keep working on this project and keep us posted for new developments. Happy coding!

r/learnprogramming • comment
1 points • DreQm

First of all learn C# and . NET. Try making a console app that manages stuff, but saves data in memory.

When that's done, learn entity framework. Start a different project to see how it works, and when you're familiar with it, refactor your first app from in memory storage to E.F.

After that, learn ASP.NET MVC, same principle as with EF, start a different project with it to get familiar, the refactor your main project from the console interface to a web app.

Those are 3 basic things to do web app development.

While developing stuff, start reading about clean code,.good entry point is https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882.

r/programming • comment
1 points • fredrikc

Have you read Clean Code during these years? Most if not all of your learning's can be found in that book which I highly recommend!

r/learnprogramming • comment
1 points • batmassagetotheface
r/dotnet • comment
1 points • rfinger1337

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

Yeah, sorry. Clean code, not clean coder.

r/django • comment
1 points • mini5316

> If you have any other tips or have any opposing views to any of these rules I'd love to hear them and discuss them!

These discussions get copy-pasted all the time, from one blog to the other, from one forum to the next. Your post is no exception as it is also copy-pasted from somewhere else (some parts of it, at least). Some bloggers/posters have the decency to quote the original references, but to be fair, after tens of copy-pasting cycles the references can get ~deliberately~ lost.

Here is the main reference for you or anyone else: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

r/Kotlin • comment
1 points • shencoder

Based on what I've read on Clean Code Book, Write the code of extensions on respective class was used or a separate class to many referenced object. These reasons are reduce of memory resource and less verbose.

r/learnjava • comment
1 points • carlosmgc2003

I think you should check this book Clean Code

r/learnjavascript • comment
1 points • GrumpyGuss

You could really improve the readability your code by working on naming...

Also, change your indentation settings to two spaces and your code won't slide to the right so quickly.

r/learnprogramming • comment
2 points • Accident_Pedo

A lot of great results on this page. I also recommend clean code it's super easy to follow along, and provides excellent practices to implement in your daily coding.

r/gamedev • comment
5 points • Im_Peter_Barakan

Sounds like you haven't actually learned programming yet. u/YaboiYatta has a good suggestion to get started. Here's another, written by a frequenter of this sub u/jhocking: Unity In Action.

Outside of this, there are books that are pretty much staples in this field.

The Art of Game Design: A Book of Lenses read this one if you want to get a better understanding of how to analyze games, your own ideas included. It is a long book, and you'll have to devote real time to getting through it.

Game Programming Patterns. You can get this one online in pdf format for free (google it), but either way this is a programming book that helps you manage your codebase better once you're actually a programmer. This one gets recommended more than drinking 8 glasses of water.

Clean Code is a software development book written by a very prominent and public member of the software engineering space. This one is all about writing code that makes you a better programmer, not necessarily that makes your programs run any faster. It's almost like a programmers ethics book, if ethics were "how not to leave the code for the next person to works on it". Again, great book once you've completed your first project or two.

Here's a video that talks about a successful indie dev and how he'd get started if he had to get started today.

Here's a bunch of misc books I love to recommend but perhaps you aren't quite at their level yet:

  • Game AI Pro
  • Code Complete
  • Game AI by Example
  • Multiplayer Game Programming

r/OMSCS • comment
3 points • world_is_a_throwAway

Hey. You’ve already got the clout. Save the money and pick up and work these books.

Introduction to Algorithms, 3rd Edition (The MIT Press) https://www.amazon.com/dp/0262033844/ref=cm_sw_r_cp_api_i_MV5LEbRA1WAJP

Clean Code: A Handbook of Agile Software Craftsmanship https://www.amazon.com/dp/0132350882/ref=cm_sw_r_cp_api_i_G05LEb5YGX6Q4

Cracking the Coding Interview: 189 Programming Questions and Solutions https://www.amazon.com/dp/0984782850/ref=cm_sw_r_cp_api_i_t75LEbBBKXWJV

And maybe something on discrete mathematical structures if you don’t already have that.

Whatever you do, don’t get a fucking IT degree if you truly want to work in computer science. Pardon my French notation.

r/Python • comment
3 points • ryuhphino

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=mp_s_a_1_3?

https://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Signature/dp/0134757599/ref=mp_s_a_1_1?keywords=refactor&qid=1584495497&sr=8-1

https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=mp_s_a_1_3?

These are three books that can help you design, write, and refactor your code with best practices in mind. Maybe not for beginners but if you have decent programming fundamentals these can help you write cleaner code.

r/learnpython • comment
1 points • baseball_savant
r/webdev • comment
1 points • guifroes

What you're looking for is Software Design/Architecture.

Forget UML for now. It is a communication tool, won't teach you how to do things.

Some good resources I'd recommend you start with:

  1. Clean Code
  2. Practical Object-Oriented Design

There are tons of stuff I could recommend but I thingkstarting with those 2 will give you great ROI.

Don't worry if the languages in those books aren't the one you work with, focus on the concepts

r/javahelp • comment
1 points • Bajur1337

For me the best way to learn programming is learning with book. The book that I have and can honestly recommend is: https://www.amazon.com/Core-Java-I-Fundamentals-11th-Horstmann/dp/0135166306 also not only for java but for OO programming I can also recommend: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

r/learnjavascript • comment
1 points • MennaanBaarin

Read this book: Clean Code

As you don't have much time, this is a summary for JavaScript

Use prettier.js for the formatting and es-lint for linting. If you are using git, run them before every commit.

r/AskProgramming • comment
2 points • nate998877

I'm not super familiar with C/C++ but if I had to guess > while (fcents > 0) fcents = fcents - 5;

Is the causing an infinite loop as I don't think the code "fcents = fcents - 5" ever runs. I think you'll have other bugs in this script as well.

I'm not great at giving advice, but I'll take a crack at it anyway.

There are quite a few things to improve on in your code like inconsistent intentions & spacing, large elseif blocks, etc. But the biggest problem here, in my opinion, is the comment you made >currently in the debugging stage

Every stage is the debug stage. I'm not of the opinion that you should start every school project with unit tests, but everything should be tested before moving on to the next thing. I would recommend in ascending length to complete look into code smells. clean code by Robert Martin aka uncle bob, anything by uncle bob really not everyone agrees with him but he's brilliant reguardless, and Finally, getting really comfortable with the documentation, syntax, patterns, and paradigms of your language.

r/AskProgramming • comment
1 points • diehardofdeath

I would say, get into clean code, clean architecture, get familiar with these. Practise design principles if you think you are weak in it. Pick one platform, aws, gcp, azure, ... And then get certified in that at a professional level. You do the certification to know for yourself that, you are upto standard that they consider you a professional. And that also comes with high salary. But once you are done with that, now you can get into terraform and ansible to build up more devops skills.

r/codereview • comment
1 points • mubgf

I read this book shortly after my first year in college and it's been something I've tried to emulate ever since: Clean Code

TL;DR though honestly I still recommend reading the book, I imagine there are copies floating around the web if you can't afford it.

r/cscareerquestions • comment
1 points • trabbaro

That's because the people who were bad at coding became professors (I kid!). But seriously, they're teaching outdated ideas if they tell you that. That's 1980s-style coding. We have much better languages now.

"Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control." - Grady Booch

When I write code, I find ways to make it that the code reads like English. I write short methods that have names that explain what they do. My variables are self-describing and as simple as possible. When code gets too complicated, I break it down into smaller methods or (when needed) a small class to handle that same bit of functionality.

If you've got a week with not much to do, I recommend grabbing the 10-day free trial of O'Reilly (https://www.oreilly.com/online-learning/try-now.html) and then watching all 40 hours of "Clean Code" the video series. I'm nearly a decade in the industry and I'm paying for an O'Reilly membership just so that I can watch those videos right now. There's also the book (https://www.amazon.com/dp/0132350882/) if you learn better that way.

And to call myself out: I write comments all the time. But only if I cannot find any other way. And I know that I've failed when I need to resort to that.

r/cscareerquestions • comment
2 points • DeathVoxxxx

Clean Code Book for learning how to code well and to learn a few of the SWE buzzwords like SOLID and DRY.

Design Patterns to get through those Java/OOP interviews, and to get acquainted to writing code often seen in enterprise systems.

Introduction to Algorithms if you want to take a really deep dive into algorithms.

r/programming • comment
1 points • tobobonobo

Refactoring: Improving the Design of Existing Code

Not only does it have practical advice on how to refactor but it also covers the value of doing it and what clean code looks like. Martin Fowler is a god.

Clean Code: A Handbook of Agile Software Craftsmanship

Speaking of clean code, this book by Uncle Bob is another classic that I don't think you can go wrong with.

r/computerscience • comment
3 points • mostafa7904
r/learnprogramming • comment
2 points • leofofeo

Depends on how far along your journey you are, but I'd recommend Clean Code by Robert Martin. Follow that up with the blue book (Domain-Driven Design), the red book (Implementing Domain-Driven Design), and the gang of four (Design Patterns).

These all require a baseline-level understanding of how software projects are structured, but they're not very computer science-heavy or require you to sit at your desk programming as you read. Think of them as guidelines and manuals for how to think about writing software programs. Some of the concepts will go over your head (again, depends on how far along your programming journey you are) but many will stick, and a few will stick out and light the bulb over your head. They're crucial to understanding the craft of putting software together. As you mature as a programmer, you'll find yourself homing in on these concepts on your own - save yourself the trouble of reinventing the wheel and work your way through these.

Plus they're pretty well-written and very accessible :)

r/learnpython • comment
2 points • doodlmyr

Looks pretty good to me. Something I'd also like to touch on was said by u/SoNotRedditingAtWork, was the use of docstrings. One of the go-tos for "clean code" is this handbook here:

https://www.amazon.com/dp/0132350882/

The google style python guide is good too (and free):

https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings

r/learnprogramming • comment
2 points • Rizzan8

This set of books written by Robert C. Martin should be a mandatory read for anyone before looking for a job or in their first weeks after getting one:

https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=sr_1_1?dchild=1&keywords=clean+code&qid=1590765396&sr=8-1

https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164/ref=sr_1_2?dchild=1&keywords=clean+code&qid=1590765396&sr=8-2

https://www.amazon.com/gp/product/B0050JLC9Y?notRedirectToSDP=1&ref_=dbs_mng_calw_8&storeType=ebooks

https://www.amazon.com/gp/product/B0051TM4GI/ref=dbs_a_def_rwt_hsch_vapi_tkin_p1_i5

The last one despite having C# in the title uses very old version of the language for the examples. But the principles and theory presented by the book are applicable to any (don't quote me on that) language.

r/learnprogramming • comment
2 points • thedatageneralist

Honestly, I would suggest reading and listening to as much content as possible. The more you hear the correct lingo, the better understanding you will get. Digital Analytics Power Hour is a good podcast.Applied Artificial Intelligence (A Handbook for Business Leaders) is a good book for introductory concepts. Clean Code is a good book to help you learn good programming concepts. This blog has a good list of tech/data resources.