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

I’m curious to know: what problems do you perceive with templates that make you loath to use them?



Sure. Sorry for the late reply, I go to parties. I have nothing against having more power at compile time. It's just the way C++ does it that I don't like. It's like a language within a language. I prefer the way it's done in D. Check the examples if you haven't, it's compile time done right in my opinion.


I understand, and agree with you about D templates. Static polymorphism and generic algorithms are too useful to give up, so of course I wouldn’t do away with templates; but there’s little reason for them to be the underpowered, syntactically hairy functional programming language that they’ve become.

In the past I worked on a language where there was no distinction between compiletime and runtime code. You simply asked for something to be evaluated at compiletime without needing to change the source; there was the stipulation that it ought to terminate, though, else your program would never compile. ;)




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

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

Search: