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

Boost::lambda is a poor substitute for an actual lambda. Every time I have attempted to use it in a non-trivial way, I gave up because writing a one-off function object was clearer and required less code. (Albiet spread out more.)

Your claim that you can achieve everything in C++ misses the point. Sure, I can write lots of function objects every time I want to apply a function to a data structure (and I do), but I also have to write a lot of tedious code to do it. That tedious code increases the size of my code base, which increases the likelihood of errors and its cognitive load. You can write object-oriented programs using ANSI C, but your code base is going to be much larger than if you did it in a language with actual OO support.

When a programming concept has first-class support in a language, programs that use that concept are going to be shorter, clearer, and less likely to have bugs related to that concept's implementation.

Luckily, true anonymous function support will be a part of C++0x.



"Your claim that you can achieve everything in C++ misses the point."

Well, no. I was responding to a comment that implied that it was impossible to do things like anonymous functions and closures in C++, due to the restrictions of the type system. That's wrong.

You'll get no argument from me that C++ is verbose.




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

Search: