News for hackers. Stuff that matters.
Re:Uncle Bob and Silver Bullets (2017) by BurningFrog on Monday July 04, 2022 @01:08PM (#31979358)
I used to call this the "Poltergeist Pattern".

Tons of tiny functions, each doing almost nothing, frantically calling each other, and somehow useful functionality results.

Each function is very easy to understand, but how they together do useful tasks is near incomprehensible.

Re:Uncle Bob and Silver Bullets (2017) by camgunz on Monday July 04, 2022 @01:21PM (#31979547)
I had a gig where a consultant had just been through (before I started), and totally changed the programming culture of the engineering teams. One of the weird things that happened was my new team no longer tolerated methods > 10 lines, which created exactly what you're talking about: a bunch of tiny single-use methods and helpers scattered across other classes/files/modules/libraries that totally obscured control flow.

It's amazing to me how even smart people can be taken in by Harold Hill types. Can I get a job going around giving advice for $100k a pop? I promise to do better than that guy haha.

Re:Uncle Bob and Silver Bullets (2017) by tziki on Monday July 04, 2022 @01:37PM (#31979755)
That's funny, I wonder how nobody thought to challenge that.
Re:Uncle Bob and Silver Bullets (2017) by ratww on Monday July 04, 2022 @03:20PM (#31980750)
In a team I was part of, we used the default in a popular Ruby linter, Reek. And it wasn't 10, it was 5.

The team treated that as puzzle-solving, and it was part of their culture to tackle those kinds of challenges. There was light hazing of newbies whenever the CI didn't pass because methods were too big. So, that's why at least in this case. There was no technical argument, just inertia.

Code quality was atrocious. Things that could be 10 lines were 30 or 40, and extremely stateful.

Re:Uncle Bob and Silver Bullets (2017) by btschaegg on Tuesday July 05, 2022 @10:06AM (#31988335)
On that topic: I came to like John Ousterhout's notion (in [1]) of "deep" methods/classes/etc. He explains it like this: If you have a reusable piece of code, imagine drawing it as a rectangle. The width corresponds to the complexity of the interface, the depth corresponds to the complexity of the implementation.

Ousterhout is saying that we really want deep classes, i.e. the complexity of the implementation a construct hides should be considerably larger than the complexity it takes to use it. Which, at least to me, basically says "search for good abstractions". And what you're describing strikes me as a good way not to achieve that.

Of course, there's considerable wiggle room in that mental model, and one could still endlessly squabble about how (not) to break up the implementation.

[1]: https://www.amazon.com/Philosophy-Software-Design-John-Ouste...

Re:Uncle Bob and Silver Bullets (2017) by BurningFrog on Tuesday July 05, 2022 @12:29PM (#31990337)
Sound about right!

I think the fallacy of the "Poltergeist Pattern" is to optimize solely on the - in itself valuable - metric of short simple methods, without consider anything else, like the complexity of using or reading the resulting code.