4 ms·
> 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
by jdmichal 8y ago
> 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.
- pjmlp 8y agoJava emulates macros via annotations and compiler plugins.
- jdmichal 8y agoAnnotation-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.)