News for hackers. Stuff that matters.
Re:The difficulty of programming depends on the layer and qu... by slver on Sunday April 25, 2021 @03:01AM (#26930874)
The problem with "when all you need is a function don't use an object" is that's it's a recursive definition.

There are people who think they need a singleton all the time, imagine where similar definition would have brought them.

How a function is defined varies from language to language, but if we're talking about a globally accessible named function, this is in effect a singleton.

It means you can't configure this function (through construction parameters), or replace it, or mock it, etc. it's in effect a "singleton function".

BTW, abstraction != inheritance.

There are no comments on this comment yet.