Live data from Hacker News

Clean Code vs. A Philosophy Of Software Design

github.com

391–400 of 554 posts

Re: Clean Code vs. A Philosophy Of Software Design

#391
post #381

Earlier quoted context omitted.

For many C#, Java and C++ engineers Uncle Bob is their savior and GoF are the apostles. Everything should follow SOLID and clean principles and be implemented using design patterns.

Game devs out here catching strays.

Good. The code I've seen from Game devs, the bad practices justified, and the ego is excessive.

Re: Clean Code vs. A Philosophy Of Software Design

#392

Earlier quoted context omitted.

> Who else has had to deal with idiots who froth at the mouth when you exceed an 80 line character margin? Honestly, no better indication of a very mediocre developer

My experience is that being fastidious about code formatting is independent of one's ability as a developer. i.e. not a good indicator either way.

I can't remember the last time I worked on a team without automatic linting enforced on check-in. Why would people choose to waste time arguing over that can be automated?

Re: Clean Code vs. A Philosophy Of Software Design

#393
post #294

Earlier quoted context omitted.

Yes, Uncle Bob is certainly capable of being pedantic. A friend of mine, a Smalltalk Consultant, partnered with him for a while. "With Uncle Bob, it's his way or the highway." His clean code work is certainly pretty dogmatic. As I recall, he says that Java is not object oriented. But if my memory serves me correctly, his book about C++ (Designing Object-Oriented C++ Applications Using the Booch Method) has some excel…

Wasn’t that Ron Jeffries who failed to solve that? I think that says more about the person at the keyboard and their lack of familiarity with the solution space than anything about TDD per-se. You still need insight and design with TDD, blind incrementalism was never a good idea.

I agree.

I have used TDD professionally in several development teams. It's useful in the right team. TDD works well when you are not too dogmatic about it. As with everything, you need people in the team that are experienced enough to know when and where. I think the same is true for any tool, coding standard, best practice or what have you. You have to know when to deviate.

I've also held entry courses at university level teaching introductory programming. I believe that TDD can be a good tool teaching programming. Students tend to sit down and write a complete program and then start debugging. TDD teaches them to write small bits at a time and test as they go.

Re: Clean Code vs. A Philosophy Of Software Design

#394
post #358

Earlier quoted context omitted.

Not about Martin. About Ousterhout. 27-30 years ago.

Right, I was curious if _in addition to_ that well-known comment there was an evaluation by Stallman of Bob Martin extant.

Unlikely. He mostly confines himself to commenting on political issues: https://www.stallman.org/archives/2024-nov-feb.html

Re: Clean Code vs. A Philosophy Of Software Design

#395

This was such a riveting and literary read, I enjoyed it and couldn’t put it away, like a novel where I was invested in the characters! Are there any other such reads in the software engineering field?

A Discipline of Programming, Dijkstra

The architecture of Concurrent Programs, Per Brinch Hansen

Literate programming--see http://www.literateprogramming.com/

I don't recommend Design Patterns, as these are elements needed if your programming language is inadequate.

There are many more.

Re: Clean Code vs. A Philosophy Of Software Design

#396
post #74

I am biased ( a former coworker was an Uncle Bob fan, and was bent on doing everything by the book, with layers of abstraction, patterns, hexagonal architecture, lots of unit tests, no cutting corners, even as we did not know what exactly we want to build and needed an MVP ASAP) but I'll just say this: Ousterhout wrote TCL - widely considered one of the best C codebases - besides being a professor at Standford and ha…

Let's not forget that Uncle Bob, by the time of writing "Clean Code" had 4 decades coding experience.

What has he shipped, though?

Re: Clean Code vs. A Philosophy Of Software Design

#397

It still blows my mind how dogmatic some people can be about things like this. I don't understand why anyone takes these things as gospel. Who else has had to deal with idiots who froth at the mouth when you exceed an 80 line character margin? And it's not just programming styles, patterns and idioms. It's arguably even worse when it comes to tech stacks and solution architecture. It's super-frustrating when I'm deal…

For many C#, Java and C++ engineers Uncle Bob is their savior and GoF are the apostles. Everything should follow SOLID and clean principles and be implemented using design patterns.

Which is unfortunate as there are no (legitimate) reasons to write C#, a multi-paradigm language, like this.

Re: Clean Code vs. A Philosophy Of Software Design

#398
post #4

It's striking to me how out of touch Martin seems to be with the realities of software engineering in this transcript. Stylistic refactors that induce performance regressions, extremely long and tortured method names for three-line methods, near-total animus towards comments ... regardless of who is right/wrong about what, those takes seem like sophomoric extremism at its worst, not reasoned pragmatism that can be ap…

> It's striking to me how out of touch Martin seems to be with the realities of software engineering in this transcript. Stylistic refactors that induce performance regressions, extremely long and tortured method names for three-line methods, near-total animus towards comments ... regardless of who is right/wrong about what, those takes seem like sophomoric extremism at its worst, not reasoned pragmatism that can be…

> Comments is a self-admission you failed to write readable code, and you can fix your failure by refactoring code into self-descriptive member functions

# This is not the way I wanted to do this, but due to bug #12345 in dependency [URL to github ticket] we're forced to work around that.

# TODO FIXME when above is done.

Oh no, I so failed at making self-descriptive code. I'm sorry, I totally should've named the method DoThisAndTHatButAlsoIncludeAnUglyHackBecauseSomeDubfuckUpstreamShippedWithABug.

Re: Clean Code vs. A Philosophy Of Software Design

#399

Earlier quoted context omitted.

Why is that convincing though? Students aren't experienced coders, aren't working in large teams, and student assignments aren't like long-term large commercial projects. If you mean the additions here https://web.stanford.edu/~ouster/cgi-bin/book.php , I read these and it still sounds like general rules of thumb you'll only really learn and understand by practicing a lot e.g. "In my experience, the sweet spot is to…

It's better credentials and experiential basis than most other programming books. Moreover, it is the students' inexperience which give this text credence --- since it results in their making errors and poor architectural/design choices it affords the chance of correction. I think it is remarkable that the author switched from "modules should be specialized" to "modules should be generalized" (rough paraphrasing, mai…

> It's better credentials and experiential basis than most other programming books.

When considering coding advice, I just don't find credentials or the results of a coding experiment matter much, especially if it involves students. I run through the scenarios in my head and pick the option that makes sense given the context and competing priorities.

> I think it is remarkable that the author switched from "modules should be specialized" to "modules should be generalized" (rough paraphrasing, mailed my copy to Brazil and waiting to buy a replacement).

The link I posted has a PDF with the content I think. I guess I don't find the limited example involving a few function signatures compelling (a student assignment to write a basic text editor) or understand why I need to pick whether to trend towards modules being specialized or generalized... you treat it on a case-by-case basis, pick the one that has the most benefits given the context and be open to changing later when it makes sense? Outside of a few rules, it's boring but "it depends" really is the answer to most of these debates. Similar with how long functions should be, writing comments and how to name variables.

> If you know of other books which you merit recommendation and which have a similar or better context for their authorship and exposition, I would be glad to hear of them.

Software Engineering at Google is probably relevant for large projects: https://abseil.io/resources/swe-book

The rest probably best comes from practice, that's how I learned most of what I know here. I'm didn't for example become a fan of strong static types because of advice based on credentials or experiments, but from experience coding with and without types.

Re: Clean Code vs. A Philosophy Of Software Design

#400

Earlier quoted context omitted.

I cringe thinking about PR comments I left early in my career. "akshually this should try to follow more SOLID principles" But, coming from a formal engineering background, I thought this is what it meant to be a professional software engineer. Little did I know these "principles" were just the musings of a consultant lol. Turns out most folks have good intentions and want a standardized way to write code, but for so…

For some reason in software there seems to be an incredibly large space for non-evidence based thinking and belief systems. I wonder if that's because in a lot of cases (depending on the domain) the space of possible valid/working solutions is near infinite, and if you don't have hard requirements that are backed up by measurements you're free to concieve of any valid system structure and justify it as 'better' witho…

> For some reason in software there seems to be an incredibly large space for non-evidence based thinking and belief systems.

The secondary problem is that book authors have become extremely good at inventing pseudo-evidence to support their claims. It most commonly takes the form of “I talked to X companies with Y total number of employees over Z years and therefore I know what works best”.

If you cut out all of the grandstanding, it’s nothing more than “just trust me” but in a world of social proof it sounds like it’s undeniable.

Post reply on HN