2 ms·
Some years into my career, I struggled with colleagues writing sloppy code. I felt that they didn’t listen to me, when I gave them unsolicited advice. The optio
by sshine 2y ago
Some years into my career, I struggled with colleagues writing sloppy code. I felt that they didn’t listen to me, when I gave them unsolicited advice. The optional code review mechanisms we set up were only eagerly used by people who cared about readability already.
So I started to refer to Clean Code when I needed an authority argument: if it’s in a book, you need a stronger argument against it, and unless you have a sound argument, your code is unclean.
I believe Clean Code mostly gets referenced by people who look for someone to agree with them on anything specific. The weaker opinions and examples become “junk DNA” for a selective quoter.
Back then, I often didn’t find a section where Clean Code agreed (or disagreed) with me. Mainly because I got influenced by functional programming, which the book does not address.
Once I decided to read the whole book, because I wanted to collect the good parts. I found myself only disagreeing in a small number of sections. But at the same time, I was completely unable to use his examples for anything.
I think this book serves a purpose. But I don’t think it addresses enough of what I have learned in the last ten years.
A simple example is naming things: the book does a fine job at giving good and bad examples. But I find that once you find the right vocabulary from your problem domain, and you want to choose among words that are all appropriate, thoughts like “is this at the right level of abstraction for this area of the code?” and “will this name also be meaningful in 6 months?” don’t get addressed. It’s the scenario where all your choices are okay, which name is better?
The book played a big role on my early career before I gained an authority and an experience of my own.
- stefan_ 2y agoHaha, the infamous Clean Code book - "how to make your code unreadable in these few easy recursive steps". The steps are roughly to extract everything into as small as possible functions that happily mutate lots of state while having "expressive" (read: overly verbose and long) names but no parameters. Make a function "shouldNotBeCompacted" that returns the inverse of "shouldBeCompacted" because of a pathological hate of negatives? Okally-Dokally, or cue Robert C. Martin: "worthy of a professional."
- sshine 2y agoHaha.
- acureau 2y agoClean code was the first book I found when looking for books about writing clean code, go figure, and back then I found it very helpful. It's easy to criticize now that I'm so far removed from then (in both time and skill). Before this point I really had never even thought about the code's design, only its functionality. I wouldn't recommend it now, but this book played its role in my life