Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tools in your toolbox. Yea why not. I've always been an OOP composition-only guy. It was always the model that made the most sense to me. It's efficient and clear. I'm amused that just now people are coming out and saying that this is the best model. On the other hand, I've had a project once where I needed to apply a different function to different objects. No need for function pointers with polymorphism, much much easier so I used that. I'm still against templates to this day, although I use some parts of the STL sometimes when I'm lazy ^^


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. ;)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: