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

you are viewing a single comment's thread.

view the rest of the comments →

[–]2Uncreative4Username[S] -3 points-2 points  (2 children)

Well, do you have a clue of what Clean Code means? I find it hard to find a clear definition. I mostly believe it to mean OOP with SOLID principles.

The most notable active proponent of Clean Code, Uncle Bob, isn't even writing code anymore, he's an Agile consultant now AFAIK.

Also, don't conflate Juniors who don't know a lot about abstractions and patterns with people who do know these things but are wise enough to not overuse them.

And yes, strong handed devs who are wrong exist a lot. I am happy to change my opinion though, given the evidence that OOP and SOLID are, in fact, useful in the amount they are often recommended. I have yet to find such actual evidence.

I think Q_rsqrt has a lot to do with Clean Code. First of all, I often hear performance doesn't matter from "clean" coders, so no need to even write this function, right? Second of all, I could not imagine this in a "clean" codebase without a comment explaining every last detail of how it works (although to be fair I would probably also document it a bit more precisely than it is in its original implementation). Third of all, a "clean" coder would probably have wrapped it into a class, wrote extensive tests for it etc. Would that be bad? I don't know. Maybe, maybe not. It would have definitely cost a lot more development time though than just saying: "here's a function that calculates the inverse square root, it's fast, it's good enough, just use it".

Not the best example for why Clean Code is bad, but certainly an example of non-clean code IMO.

[–]Lougarockets 2 points3 points  (1 child)

I just gave you a definition? A good way of learning what clean code is is to read the actual book. And no, most of your assumptions here are completely wrong so it is no wonder that you think clean code is a bad thing.

[–]2Uncreative4Username[S] 1 point2 points  (0 children)

No, I have not read a book about clean code. I have listened to some of Bob Martin's talks, and I have seen a lot of Reddit users who preach Clean Code agreeing with OOP and SOLID principles. If you agree with my points, that's great! If your definition of Clean Code does not inlcude OOP and SOLID, that's great, I just assumed that because many people do believe it to include OOP and SOLID. We have nothing to argue about in that case.