Hacker News new | past | comments | ask | show | jobs | submit login

This is mostly because the monad abstraction is mostly useless in non-lazy languages. It's more useful in lazy languages because objects with monadic types can then be written self-referentially without trouble. It also hurts that Java and C++ syntax is extremely specialized towards avoiding the use of abstractions.



Along similar lines, here's an investigation from a while back of why monads haven't caught on in Lisp: http://marijn.haverbeke.nl/monad.html


C++ may be overly complex but it is in an entirely different league than Java in terms of syntactical abstractions that you can implement on top of it.


That's true. But there's still a syntactic cost and a cognitive cost to making useful abstractions that can be much less verbosely and more comfortably made in other languages. And I find myself going with less clean designs because of it.


I agree with that.


C++ has operator overloading, but surely that can't put in an "entirely different league"… Were you talking about template abominations like the ones in boost?


Yes, in my view, languages supporting operator overloading, macros and first class functions are in a completely different league than languages that don't have those features when it comes to syntactical abstractions.


Where did you saw first class functions in C++??? It doesn't even have closures!


Sorry, I meant to say function pointers. But hey, I'm far from a big supporter of C++. I know its deficiencies very well unfortunately.


OK, then. I will just say that in my experience, C++ and Java don't have a huge difference in expressibility. What C++ may gain with syntactic tricks, it loses with manual memory management.

Anyway, in the face of Haskell and Lisp, the differences between java an C++ don't look that great.


C++ and C++ development are hugely different from Java and Java development. If Java and C++ don't look very different to you, it's because you need to take another look at C++. About the only thing they have in common is their hideous verbosity. You can write C++ as if it were like Java, but you can write C++ as if it were like Haskell, too. Given the question, "What mainstream language is most like Haskell," the answer is C++. Unlike Java, C++ is actually capable of sidestepping its limitations.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: