
New C++ features – lambdas - ingve
http://arne-mertz.de/2015/10/new-c-features-lambdas/
======
xigency
This is entirely a personal opinion, and probably something I will be
lambasted for, but any example using a lambda in C++ I find to be 10,000×
worse than the functional equivalent.

The benefit of writing code in C or C++ is that it gives your programs
structure, and without naming your predicates or organizing your program in a
logical way, it's basically a soup of abstract symbols.

My 2¢.

Kudos to the author for explaining how to use them. I naïvely assumed that the
keyword `lambda' was involved.

~~~
lbrandy
> _any example using a lambda in C++ I find to be 10,000× worse than the
> functional equivalent._

> _I naïvely assumed that the keyword `lambda ' was involved._

I don't understand how this two sentences co-exist. If you are unfamiliar with
the syntax, surely you can't have a well informed opinion on which usage, in
practice, turns out better?

I am assuming "functional equivalent" means the old named functors of C++03.
And yea, you are likely super alone on that opinion. I normally say lambdas in
C++11 mostly-obsolete (at least as the default) a huge class of the old ways
from functors to bind/placeholders and friends. I don't think I've ever heard
someone pining for the ol' days on this one.

~~~
xigency
Super alone.

I don't generally use STL so I mean without language extensions. It's easy
enough to implement these things with traditional function pointers.

------
santaclaus
Can you really call lambdas new at this point? C++11 has been around for what,
four years now?

~~~
arne_mertz
Compared to 17 years of standardization and >30 years of C++ altogether, 4
years is relatively new. In addition, much of the blog is not so much targeted
at up-to-date C++ connoisseurs, as it is targeted at the kind of programmers I
worked with in the past: people that have been stuck with legacy C++ code and
older compilers for decades. So my whole "new C++ features" category covers
C++11 and beyond.

------
msie
This is slightly tangential...I was trying to learn how to debug rust code
with gdb/lldb and ran into so many problems. Then just for kicks I wrote a
little C++ program and used gdb - so much better :D . I just hope they get the
rust debugging situation smoothed out someday but for now I won't be using it.

~~~
brinker
Did you try using rust-gdb or rust-lldb? They're wrappers for gdb and lldb
respectively that make working with Rust code a lot nicer. They ship with the
Rust compiler.

~~~
msie
Yes. I couldn't single step through a simple program without delving into
assembly code. Couldn't list the program. Breakpoints weren't working. I think
part of the problem was working on OSX. I was reading some Rust issue related
to the debug info generation. Although the issue was closed I think it's still
a problem. Oh well.

~~~
steveklabnik

      > Although the issue was closed I think it's still a problem
    

Please leave a comment if this is true! Opening old issues that come back is
good.

