News for hackers. Stuff that matters.
Re:Workers who love 'synergizing paradigms' might be bad at ... by domga on Friday March 06, 2026 @09:48AM (#47275552)
A decent chunk of OOP patterns was due to lack of language features, notably passing and returning functions
Re:Workers who love 'synergizing paradigms' might be bad at ... by jghn on Friday March 06, 2026 @10:45AM (#47276424)
It's both.

The *concept* of patterns makes sense. A shared language that developers can use when building things.

The *reality* of patterns has been much less useful. The original ones were indeed a reaction to warts in the popular languages of their era. And as we tend to do in our industry, these have been cargo culted along the way and for some reason I still see people talking about them as first class citizens 30 years later.

People don't seem to realize that patterns should be and are fluid, and as our industry evolves these patterns are evolving as well. A major difference between software engineering and the analogous fields people use when talking about patterns is those industries are much older and move less quickly

Re:Workers who love 'synergizing paradigms' might be bad at ... by gzread on Friday March 06, 2026 @09:57PM (#47284009)
A pattern is exactly what the word "pattern" implies; something that lots of people seem to have found useful, so you might find it useful too.

If you are a language designer and you see lots of people writing the same boilerplate, it behooves you to put it into the language. A pattern is a desire path - pave it. In that sense, they are missing language features.

Re:Workers who love 'synergizing paradigms' might be bad at ... by layer8 on Friday March 06, 2026 @10:11AM (#47275852)
Since a single-method object easily serves the role of such a function, that’s simply not true. Looking at the 23 GoF patterns, I can’t identify any that would be obviated by having first-class functions (or lambdas, as many OO languages nowadays have). Some of the patterns can employ first-class functions (e.g. an observer could be just a callback function reference), but the pattern as such remains.
Re:Workers who love 'synergizing paradigms' might be bad at ... by throwway120385 on Friday March 06, 2026 @10:18AM (#47275961)
The language feature isn't "passing and returning functions" but "loose coupling." Lambdas and Functors are just a way to represent that in OOP languages that care more about inheritance than about messaging.
Re:Workers who love 'synergizing paradigms' might be bad at ... by gavmor on Friday March 06, 2026 @10:09AM (#47275817)
A lot of patterns have become frameworks, or language features, yes. It's just paving cowpaths.
Re:Workers who love 'synergizing paradigms' might be bad at ... by irishcoffee on Friday March 06, 2026 @10:06AM (#47275779)
Are you referring to function pointers?

I believe C has allowed passing and returning functions from... the jump, no?

Re:Workers who love 'synergizing paradigms' might be bad at ... by scott_w on Friday March 06, 2026 @10:12AM (#47275863)
I recall a lot of this comes from Java 5/6 where I think passing function pointers around was difficult, if not impossible. Back in those days, I had many a conversation with a friend who would ask "can Python do pattern/feature X?" to which I'd respond "it doesn't need to."
Re:Workers who love 'synergizing paradigms' might be bad at ... by ndriscoll on Friday March 06, 2026 @10:16AM (#47275925)
Not just function pointers. E.g. in Scala:

    def addX(x: Int): Function[Int,Int] = {
        y => x+y
    }
addX(5) then returns a function that adds 5. So closures, which are equivalent to objects (behind the scenes, the compiler needs to allocate a structure to remember that 5 and know the "member function" to call to do the plus), and usually more straightforward.

Once you get used to doing this, you realize it's useful everywhere.

In a decent language with functional programming and generics support a lot of GoF patterns can be directly encoded as a simple type signature where you receive, return, or both some function, so there's not really much else to say about them. Like half of the behavioral patterns become variations of the interpreter pattern.

Re:Workers who love 'synergizing paradigms' might be bad at ... by irishcoffee on Friday March 06, 2026 @10:52AM (#47276526)
Pardon my ignorance, isn't that a lambda in c++?
Re:Workers who love 'synergizing paradigms' might be bad at ... by ndriscoll on Friday March 06, 2026 @11:16AM (#47276899)
Yes, and in Java and other languages (e.g. in Lean you can literally use the syntax λ x ↦ x + 5). When OOP was more of the zeitgeist, these languages didn't have lambda functions.
Re:Workers who love 'synergizing paradigms' might be bad at ... by DauntingPear7 on Friday March 06, 2026 @11:10AM (#47276806)
You can return function pointers but not first class functions, which means you can’t do closures and other FP things in C