~80% of the code I write is in C#. The other ~20% is in C++. Whenever I have to switch from C# to C++, it takes me quite a while to mentally "shift gears" to thinking in C++. I make simple mistakes using pointers and memory allocation that I would not have made when I was in university. After the adjustment period, I am fine and writing in native code comes naturally.
Is this normal? Does anyone else experience something similar and if so, what do you do to cut down on the time this wastes?
Edit: I'm not saying that I cannot work with memory allocation and pointers. I comfortably use them often in my C++ code. Just not immediately after working in C# for long periods of time.
Managed code is the one that is executed by the CLR of the . NET framework while unmanaged or unsafe code is executed by the operating system. The managed code provides security to the code while undamaged code creates security threats.
What are the advantages of using Managed Code? It improves the security of the application like when you use runtime environment, it automatically checks the memory buffers to guard against buffer overflow. It implement the garbage collection automatically. It also provides runtime type checking/dynamic type checking.
Code that executes under the control of the runtime is called managed code. Conversely, code that runs outside the runtime is called unmanaged code. COM components, ActiveX interfaces, and Windows API functions are examples of unmanaged code.
Unmanaged code is executed with help of wrapper classes. Wrapper classes are of two types: CCW (COM Callable Wrapper) and RCW (Runtime Callable Wrapper). Wrapper is used to cover difference with the help of CCW and RCW.
I have the same problem. I use completely different color schemes for Visual Studio (dark-on-light for C++; light-on-dark for C# and VB).
Seems to help my brain ease the switch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With