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

C++ doesn’t get this treatment when it comes to template metaprogramming, Python doesn’t get it about metaclasses, etc. Every language has tricky parts. The difference is that Haskell’s trickiest part, Monads, are actually very simple. They’re simple enough that they can be explained in a short article, so that causes people to write lots of articles about them.



This is all true except for the claim that monads are Haskell’s trickiest part. Monads are Haskell’s most infamous part but far from the trickiest. There are a lot of Haskell libraries that make the type system twist itself into a pretzel to achieve some really funky things. See Edward Kmett’s lens library for one example.


In their basic form templates solve an obvious problem in an obvious way. It doesn't make sense to make the same data structure for every type, you want to make the data structure generic and sub in the type every time you use it.

The extremes of template meta programming are self imposed by people being fancy while writing libraries and the value is questionable. On top of that no one thinks that C++ templates are the ideal way to do complex meta programming.


> C++ doesn’t get this treatment when it comes to template metaprogramming

Quite sure a lot of people hate C++'s template programming.

> They’re simple enough that they can be explained in a short article, so that causes people to write lots of articles about them.

Or ... there are a lot of articles because people keep finding new ones to read because they still don't get it after reading the previous 100 articles.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: