←back to thread

In Defense of C++

(dayvster.com)
185 points todsacerdoti | 2 comments | | HN request time: 0.406s | source
Show context
lordleft ◴[] No.45267931[source]
Great article. Modern C++ has come a really long way. I think lots of people have no idea about the newer features of the standard library and how much they minimize footguns.
replies(2): >>45268114 #>>45268712 #
sunshowers ◴[] No.45268114[source]
Lambdas, a modern C++ feature, can borrow from the stack and escape the stack. (This led to one of the more memorable bugs I've been part of debugging.) It's hard to take any claims about modern C++ seriously when the WG thought this was an acceptable feature to ship.

Of course, the article doesn't mention lambdas.

replies(4): >>45268264 #>>45268485 #>>45268512 #>>45274413 #
im3w1l ◴[] No.45268264[source]
Why wouldn't it be acceptable to ship? This is how everything works in C++. You always have to mind your references.
replies(2): >>45268326 #>>45269016 #
1. BeetleB ◴[] No.45269016[source]
This is like writing an article entitled "In Defense of Guns", and then belittling the fact it can kill by saying "You always have to track your bullets".[1]

[1] Not me making this up - I started getting into guns and this is what people say.

replies(1): >>45273610 #
2. im3w1l ◴[] No.45273610[source]
To me it's as if someone releases a new gun model and people single that gun out and complain that if you shoot someone with it they may die. Like it's a critique of guns as a concept not of that particular one.

In a complete tangent I think that "smart guns" that only let you shoot bullseye targets, animals and designated un-persons are not far off.