News for hackers. Stuff that matters.
Re:In the Defense of Spaghetti Code (2013) by RHSeeger on Monday July 22, 2019 @09:11AM (#20497644)
> I disagree with this. I think something should be a seperate function only if it is (or likely will be) called from several callsites.

I disagree. I split out anything that I can describe/test separately. If I need to take a list and

1. Filter it based on custom logic 2. Sort it based on custom logic

Then I will generally break the filter and sort out into their own functions even if they're not used anywhere else. Each function can have it's own description and tests.

Re:In the Defense of Spaghetti Code (2013) by dagss on Monday July 22, 2019 @04:21PM (#20501950)
I understand that many prefer this. My point wasn't really so much mine or your preference -- my point was that it is a question of stylistic preference, not about spaghetti vs not.

As you simply describe your own stylistic preference I am not sure if you agree with me about that or not?

If you actually write a seperate test for the function then you have two callsites and of course it must be a seperate function.