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
I believe C has allowed passing and returning functions from... the jump, no?