Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I used learning C# over 2 years and have read about C++ a few days ago.

C++ completely gets access to all of APIs of the operation system.
But Java and C# are depended on frameworks, they do not get access to all APIs.
It means with C++ you can do more by anyway.

So, why Java is the most popular? Why do people choose Java and C# at all when they can choose C++?

I think it is because Java and C# are easier because they are managed.

I wanna understand it, please help, thank you)
I am also checking my knowledge here, if i am wrong, please mistake me)
Posted
Comments
[no name] 23-Dec-14 11:31am    
c++, c#, java vs. OS API

c++: Yes not a big thing to access OS API. But keep in mind OS API is depended on OS (Win, Linux,...)

c#: Even Mono exists, I think nobody trusts this path. It is clearly MS dependent.

Java: OS- "Independent". Independent like html is "independent" from browser support *lol*. But at all a nice idea at all, to have a OS independent framework. Which unfortunately does not really works, because every party likes to push their own specialties. So you will face the same mess with Java like you face when developing html....

Only comments from a noob.
[no name] 23-Dec-14 12:20pm    
It is more C that can access API (but c++ can everything what C can). Anyway keep in mind, access to OS-Api will chain you to OS.
Bruno

http://en.wikipedia.org/wiki/Charon_(mythology)[^]
Ziya1995 23-Dec-14 12:49pm    
So, i can access any API of the operation system, i got it, thank you!

People choose programming languages for many reasons - the most common one is the culture of the development organisation they work within. The culture is set by a variety of factors but the three biggest ones are:

What does the boss like? If your boss is a long time C#/Java/C++/Perl/Fortran/Javascript enthusiast you know what you'll be using.

What's the current code base written in? If you're working on a massive code base written in C from the dawn of time you're going to have to be a C programmer.

What's trendy? For a decade none of the hip young kids would touch C++ outside of the games and embedded industries so it's use declined a fair bit. Java exploded as everyone listened to Sun's marketing. Now Java's mostly server side while C++ is making a comeback as the thing that can make single threaded code run fast.

There are others (e.g. defense contractors used to have to be into Ada in a big way) but generally I've found that those three are main drivers.
 
Share this answer
 
If you have to ask, you wouldn't understand...:laugh:

They are different languages, and they each have strengths and weaknesses - and often the "strengths" of one are seen as "weaknesses" by the others. C++ is powerful, yes - and it's available in various flavours across a broad range of environments. But...that power makes it complex, and that can get in the way of producing code. And it's age shows (it's derived from C, and that's over 40 years old!) in some ways. C# is a lot newer, a lot more "focussed" and can be a lot, lot quicker to develop in. And Java is the default native language for Android apps.

I'm not running C++ down - it's a good tool and I used it for a long time - but for most of what I do, C# is quicker, easier to read and maintain, and less prone to "leaking".
 
Share this answer
 
Comments
Ziya1995 23-Dec-14 11:23am    
Thank you! You read my mind. C# is much easier, that is what i used thinking.
But i wanna admit one key element, C++ gets access to every point, every API of the operation system, is it true?
OriginalGriff 23-Dec-14 11:41am    
You can do most (if not all) of that with C# as well via DLLImport...Global hooks are a PITA (but fair's fair, they are a PITA in C++ as well - just a little easier to work with)
Ziya1995 23-Dec-14 12:06pm    
So, it is true that C++ can access literally any API of the operation system, right? If right, just confirm, you could make my life easier. Thanks)

By the way, i know about DLL Import.
OriginalGriff 23-Dec-14 12:12pm    
Yes - the Windows API is basically just a set of DLLs (OK, a big set!) containing functions, structures, and suchlike. Some parts are easier to manipulate, others are harder - but you can use it all.
Ziya1995 23-Dec-14 12:18pm    
There are not only DLLs, but also .lib, .h files and so on and i can access all of them.
I got it, thank you!

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