Bjarne Stroustrup – The Essence of C++ [video]
channel9.msdn.com
Bjarne Stroustrup – The Essence of C++ [video]
1–10 of 85 posts
Re: Bjarne Stroustrup – The Essence of C++ [video]
#2[1] http://channel9.msdn.com/Events/GoingNative/GoingNative-2012...
Re: Bjarne Stroustrup – The Essence of C++ [video]
#3Re: Bjarne Stroustrup – The Essence of C++ [video]
#4Hopefully we can have an interesting discussions on those topics now that at least 1 news about them has reached the main page.
Re: Bjarne Stroustrup – The Essence of C++ [video]
#5but hey, i'm not a system programmer so i can afford it :)
Re: Bjarne Stroustrup – The Essence of C++ [video]
#6 void f(int n, int x)
{
Gadget* p = new Gadget(n); // look I'm a java programmer! :)
// ...
if(xRe: Bjarne Stroustrup – The Essence of C++ [video]
#7really interesting to see classes as ressource manager above all, instead of concept incarnation. I was almost convinced to go back to C++ until the slide with auto range and all, combining new features of C++, at which point i remembered why i didn't want ro have a look at C++ code again. but hey, i'm not a system programmer so i can afford it :)
And then there's tons of things that creep me out a bit. Being a multi paradigm language sounds good on paper, but it seems to cause a lot of accidental complexity. The best way to stay sane is probably to pick a certain subset of C++ for your project and stick to that, that's what I tend to do.
Then again, that's not uncommon in simpler languages either. "JavaScript, The Good Parts", lint and all that. Code accessibility matters IMO.
Re: Bjarne Stroustrup – The Essence of C++ [video]
#8I liked this snippet about pointer misuse: void f(int n, int x) { Gadget* p = new Gadget(n); // look I'm a java programmer! :) // ... if(x
void f(int n, int x) {
Gadget p = new Gadget(n);
// ...
if (x
Yes, good night's sleep tonight after writing that...Re: Bjarne Stroustrup – The Essence of C++ [video]
#9I liked this snippet about pointer misuse: void f(int n, int x) { Gadget* p = new Gadget(n); // look I'm a java programmer! :) // ... if(x
I rather prefer Java: void f(int n, int x) { Gadget p = new Gadget(n); // ... if (x Yes, good night's sleep tonight after writing that...
There are two better options:
void f(int n, int x) {
Gadget p(n); // Stack allocated
// ...
if (x
Or, if it really has to be a pointer: void f(int n, int x) {
std::unique_ptr p = new Gadget(n); // Smart pointer
// ...
if (x
Both will be automatically freed as soon as the scope is exited.Re: Bjarne Stroustrup – The Essence of C++ [video]
#10I liked this snippet about pointer misuse: void f(int n, int x) { Gadget* p = new Gadget(n); // look I'm a java programmer! :) // ... if(x
I rather prefer Java: void f(int n, int x) { Gadget p = new Gadget(n); // ... if (x Yes, good night's sleep tonight after writing that...