C++ appreciation thread
I'm falling in love with c++11 std:thread, waiting for c++17 cross platform file api (goodbye dirent.h and Windows API mess (now Microsoft is hiding API functions older than Windows XP)
>Strongly typed enums
>Unicode string literals
What a time to be alive
>have to write java
It gets worse:
I have no transaction security on my database, or rollbacks
An email address for a single user is stored in 15 different tables, services, and databases.
They're rolling out adobe experience manager, aka enterprise WordPress
We have to build an angular spa on top.
With 1000 indians
Why can't I have my c++ back?
Please kill me.
I'm a second year CS student and we learn c++ at my school. Is there anything that i'm probably doing with c++ that I shouldn't be doing as far as conventions go?
I still use namespace std [spoiler] because i can't fucking understand why not to use it [/spoiler]
You should basically never use using namespace * in your code. The reason is that it not only introduces function name conflicts and makes it difficult to tell where a function is fomr, but also that it is recursive. If you end up specifying using in namespace Y for namespace Z and in namespace X use namespace Y, everything in Z will come along with it. If you really can't be bothered to type a super long namespace you can alias it likenamespace ipadr =boost::asio::ip::address;
It's probably just easier if you leaf through "effective C++" and "effective modern C++" by Scott Meyers, rather than us giving you a bunch of bullet points.
>I still use namespace std because i can't fucking understand why not to use it
In general, using statements are fine as long as you keep them localized so that they don't leak throughout the rest of your project (ie. write them at the top of a function to confine their scope to that block. Don't put them in the global namespace at the top of a header that gets included all over the place).
^ beat me to it