News for hackers. Stuff that matters.
Re:The 80/24 Rule by blowski on Friday November 15, 2019 @04:18AM (#21543474)
> Novice Programmer: "Putting all this code in one function would be easier to write."

> Master Programmer: "You fool! You can't just stuff all your code into one function because it's easier to write!"

So the Novice Programmer separated all the code out into different functions and showed the results to the Master Programmer.

> Master Programmer: "You fool! Why have you broken this out into different functions when it all belongs together in the same function?"

And in that moment the Novice Programmer achieved enlightenment.

Re:The 80/24 Rule by tempguy9999 on Friday November 15, 2019 @04:35AM (#21543556)
> achieved enlightenment

I haven't. What are you saying?

Re:The 80/24 Rule by ufo on Friday November 15, 2019 @09:00AM (#21544799)
"And at that moment the novice achieved enlightenment" is the usual punchline for this story setup.

The message is that neither of the alternatives is correct all the time.

Re:The 80/24 Rule by gibagger on Friday November 15, 2019 @04:48AM (#21543603)
I believe that it means that some things aren't always very clear cut, and one could make a reasonable argument to do it either way.
Re:The 80/24 Rule by tempguy9999 on Friday November 15, 2019 @05:24AM (#21543766)
The best I could interpret it is to have it both ways; break it down into small private functions, then nest (edit: encapsulate) these in a larger one where they can't be seen by anyone else.
Re:The 80/24 Rule by blowski on Friday November 15, 2019 @06:11AM (#21543952)
Both and neither.

It depends on you and your team, the project requirements, the rest of the codebase, and so many other things. The choice you make is less important than _why_ you make it.

Re:The 80/24 Rule by tempguy9999 on Friday November 15, 2019 @01:27PM (#21547350)
Maybe the western approach of actually giving useful information beats the zen approach of confusing the fuck out of people.
Re:The 80/24 Rule by blowski on Friday November 15, 2019 @03:43PM (#21548564)
You’re going to hate reading this: https://www.mit.edu/~xela/tao.html
Re:The 80/24 Rule by Jarwain on Friday November 15, 2019 @06:09AM (#21543942)
One should group functionality into a single function, not because it's "easier to write", but instead because "it belongs together"
Re:The 80/24 Rule by darkwater on Friday November 15, 2019 @04:43AM (#21543585)
Maybe that, no matter what you do, there will be always somebody telling you there's a better implementation for it.
Re:The 80/24 Rule by nabeards on Friday November 15, 2019 @12:34PM (#21546809)
I always took it to mean, "Don't put all the code into one function because it's easy, do it because it's logical."