Message from C, C++ talks

June 2019

— Ohh ok. So it is not worth optimizing, given things like std::move exist. Which is indeed more explicit

Message permanent page

— I passed -O3 to g++, can I ask, how do you know there are no calls to the move/copy constructors?

— Look at the generated assembly

— Woa, not there yet hahaha

— 

But do note, using std::move everywhere can actually do harm. E.g. it can prevent the compiler from doing copy ellisions

— Is it very common to look at assembly while writing c++?

— Good to know, gonna look more on that

— Depends on the software you are writing. If you work on something performance critical or with hard constraints, yes. Otherwise I guess not

Message permanent page

— Depends on the project, but it's good to know how to read it

— Is it readable? I would've thought all the abstraction c++ gives, would make it unreadable

— Thanks to both for the answers!

— I don't mean reading the whole thing, but at least being able to detect logic in simple programs

— You can show off to your colleagues.
And sometimes it can be beneficial in arguments with someone about code efficiency.
Sometimes it's just interesting to see what's happening in some optimized code. Like what code does compiler generate.

Message permanent page

— Anyone think of a relatively simple and well known piece of software written in C/C++ that doesn't rely on external libs too much? I'm wanting to learn about porting applications to different architectures, I want to port something from an x86 implementation to a 3ds console which uses an arm architecture

Message permanent page

— I was thinking of porting Doom but it might be a bit complex