Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
The Unmanaged language like C++ accesses all APIs and it is not limited.
But it is harder to learn unmanaged languages, they have deep learning curve.
It is hard and that is why people choose managed languages over unmanaged.
Am i right?

So, what makes it harder if to write the same code on both of them?
Posted

No, C++ for example is usable in managed or unmanaged, it's the same language regardless.
It's the framework that makes the difference there.

Unmanaged code it a bit harder, because it doesn't do as much for you, it doesn't "hide" the nitty-gritty of what is going on behind a layer of abstraction, and that is both a strength and a weakness. It's a strength because it gives you a lot more control over what is going on, and it's a weakness because that control comes with the responsibility to clean up behind yourself!

If you were comparing C++ and C# then yes, C# is a lot simpler and easier to learn (and use) than C++, even when the C++ is managed. But that's because C# was designed to be a more modern language that was integrated with the .NET framework. C++ is based on C, which was based on ALGOL and Pascal and is at it's roots a forty year old computer language! :laugh:

That doesn't mean it rubbish, just that it's collected a lot over the years, and it has of necessity become pretty complex.
 
Share this answer
 
Comments
Raul Iloc 30-Dec-14 10:55am    
You have my 5+.
BillWoodruff 30-Dec-14 11:15am    
+5 Forsooth !
Do you even know what a mananged code is? The code that runs for the .NET framework is known as managed code. There are more than 20 lanugages that can be used to write applications on .NET framework, C++ is also one of them and you can write applications in C++ and they can be called managed code applications because they are executed under .NET framework and IL etc. This term, "Managed Code" is owned by Microsoft, because this is used by them, to distinguish the code written for their platform, from others.

What is Managed Code? (MSDN link)[^]

The thing is, that unmanaged code, like you said, C++ is harder to learn. Is because, while working in an unmanaged code, you have to stick to the default language, the native one. For example, there is a difference between managed and unmanaged C++ code, have a look below,

C#
// for input, output 
#include <iostream>

// for cout
using namespace std;

void main() {
   cout << "Hello world!";
}

/* Below is the mananged code, 
 * using the .NET classes and framework
 * First of all, Edit the configuration make sure Runtime is
 * targeting the \CLR in General and C/C++ */

#include <windows.h>

// for Console
using namespace System;
void main () {
  Console::WriteLine("Hello World");
}
</windows.h></iostream>


Now, if you're getting uneasy, trying to read the above code then you first need to start love to program applications, not just .NET applications. Programming, is a huge field however .NET is a mainly used framework, but these languages are of good use, outside of "Managed" state too. They're not tough, you just don't find the "System" namespace around.

However, the high-level scripting languages are even more easy to laern. PHP, JavaScript etc. However, even in Managed languages, C++ is the toughest one to learn, because it requires a lot of time to understand the features like pointers etc. Maybe that is why, the syntax seems horrible.
 
Share this answer
 
v2
Comments
Ziya1995 31-Dec-14 1:34am    
> However, the high-level scripting languages are even more easy to learn.
Yes, but they have performance problem for modern apps, that is why i chose C#.
Afzaal Ahmad Zeeshan 31-Dec-14 1:45am    
Yes C# is efficient and easy to learn language.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900