News for hackers. Stuff that matters.
Re:Programming Paradigms for Dummies: What Every Programmer ... by pjmlp on Monday November 05, 2018 @12:39PM (#18384206)
Comfort is not a programming paradigm.

Just because only might need a bit more boilerplate for currying or partial applications, doesn't prevent writing FP libraries in modern Java.

Re:Programming Paradigms for Dummies: What Every Programmer ... by setr on Monday November 05, 2018 @03:11PM (#18385493)
But since its all turing complete... this can be said of anything. There’s nothing stopping you from doing OOP in haskell, or functional in C, or procedural in prolog, if you’re willing to put in the effort.

Disregarding “comfort”, or rather, how much the language lends itself to a style, makes the notion of programming paradigms meaningless, and we’re still left with something we all know exists, but have no way to express.

Re:Programming Paradigms for Dummies: What Every Programmer ... by Jtsummers on Monday November 05, 2018 @03:44PM (#18385784)
Different programming paradigms are not about what can be computed it is about what can be expressed in the syntax and semantics of the language. This is an important distinction. Brainfuck is capable, technically, of computing anything that Haskell can compute. However, it would be foolish to call it a functional (paradigm-sense) language. It lacks higher order functions and many other elements. You could construct a lambda calculus interpreter in brainfuck, but then that language would be functional, but not the underlying implementation language. By the same measure, Haskell implemented in C does not make C a functional (paradigm-sense) language.
Re:Programming Paradigms for Dummies: What Every Programmer ... by bunderbunder on Monday November 05, 2018 @04:12PM (#18386023)
There's a whole lot of stuff you can do, short of writing interpreters, to construct library-level support for a paradigm in a language that lacks language-level support for that paradigm.

For example, I would say that GTK+ is written in an object-oriented style. But, despite that, I would not say that OOP is a member of C's repertoire of language paradigms.

Re:Programming Paradigms for Dummies: What Every Programmer ... by Jtsummers on Monday November 05, 2018 @04:22PM (#18386090)
That is true, some languages are sufficiently expressive to allow other paradigms to be used within them even though they aren't baked in. But it's not true that all languages can support all paradigms (either directly in the language as designed, or indirectly via library support).

OO languages and functional languages support each other's paradigms (more easily) than a pure imperative language would support either. And both OO and FP languages support declarative styles (like relational or logic languages) better than C would.

EDIT: It's also worth pointing out that C++ really achieved OO (initially) by using macros on top of C. So having a sufficiently expressive meta-language is also important to this. Via such a meta-language, you can achieve many more paradigms in a language than using the language alone.

But many languages lack a meta-language or don't have a standard meta-language which people can rely on.

Re:Programming Paradigms for Dummies: What Every Programmer ... by jdmichal on Monday November 05, 2018 @05:20PM (#18386523)
> It's also worth pointing out that C++ really achieved OO (initially) by using macros on top of C.

And this is extremely relevant to the point. If the primary complaint against function programming in Java is "comfort" and "boilerplate"... Macros address both those problems very well. If Java had macros, it would be very simple to isolate and minimize that boilerplate.

Re:Programming Paradigms for Dummies: What Every Programmer ... by pjmlp on Monday November 05, 2018 @05:42PM (#18386682)
Java emulates macros via annotations and compiler plugins.
Re:Programming Paradigms for Dummies: What Every Programmer ... by jdmichal on Monday November 05, 2018 @06:03PM (#18386808)
Annotation-based methods are crippled by the limitations of annotation placement. For instance, you can't "annotate" an expression, which is where you will tend to see boilerplate of the type needed for partial application. (Because partial application is easiest emulated as a lambda which routes to the target function while providing fixed values to parameters.)