35

New project in C++. I don't know C++ but very good at C and Java so not worried.

New guy joins us. Gets stuck on how to concatenate a string. No big deal since he is new to the language too and doesn't have a C background. I offer to help and he goes on a 10 min rant about how C and C++ are different and I don't know what I'm talking about.

Wait until he's done. Tell him just to do strcat(possibly a better way but I'm literally in day 2 of my C++ skills, but I knew it would work). He mumbles how is not going to work as he types like he's going to shove it in my face when it fails.

It was like a beautiful geeky mic drop when it worked perfectly.

Comments
  • 19
    You can just + or += to concatenate strings in C++ because the + operator is overloaded for them.
  • 10
    You actually cannot, under no circumstances, take the leap, that C and Java would be of any help with C++. I saw many devs, proud of their hybris, run into a wall mid-project, when the deadlines came, because they started from a very eco-system denying architecture. Have a deep dive into the C++ core guidelines! Please! They are just advice, but they can save you a later re-write. https://github.com/isocpp/...
  • 12
    Ps: get a grip on ownership and its transfer. There is no such thing in C and Java. You can own any resourcs, e.g. memory, threads, files, locks, sockets, ... in the end it boils down to RAII. C++ is versatile, don't try to use everything, just what you understand and are comfortable with. And strcat tells me you are working on char*, use std::string. The STL is your friend and STL algorithms are your bread and butter.
  • 4
    Google also works sometimes
  • 1
    Hey, congrats on your new job and helping out an arrogant co-worker without being mean. I know how that is, dealing with arrogant co-workers. 👍
Add Comment