C, C++, C#? Why should a beginner start learning?

Asked

Viewed 4,254 times

4

I am 17 years old and I am learning Java, when I feel that I already master the language I plan to migrate to . NET! What is recommended to start C, C++ or C#? Thanks for the help ^^

  • I recommend C++ because it has everything C has but just like java it is also object-oriented, C++ can be complicated at first, C# is object-oriented and looks like java, so I think you’ll get along better with C# since you want to learn. NET too, but this is something very personal, goes from each one

1 answer

7

Maybe this question is closed, because it is "mainly based on opinions", but I believe it is possible to answer it objectively.


C, C++, C#? Why a beginner should start learning?

For sure C# is the "easiest" of the three. [1]

C# has a "more intuitive and less exotic" syntax (opinion) compared to C and C++, some people even consider C and C++ as languages of middle level, since it is possible to write excerpts using the language Assembly on them, which is low-level. The abstraction level in C# on the other hand is higher, if we take into account, for example, that programs in C and C++ are compiled into machine language and C# is compiled into an intermediate language (CIL), which is then translated into native code or executed by a virtual machine (Is C# partially Interpreted or really Compiled?).

C# simplifies many tasks, such as memory management with the Garbage collector (Garbage Collector), which makes it so much simpler. In C and C++, one of the reasons for your power is that you control everything, including memory allocation and release, which, for example, can greatly increase the performance of an application, but it also comes at a price, because programming becomes more complex and it is easier to commit failures that end up with memory leakage and problems of this type.

Following the creation dates of the languages, and giving some examples of abstraction levels added from one to another, the list would be in that order:

  1. C -> "Raised in 1972 by Dennis Ritchie at AT&T Bell Labs for Unix Operating System Development (originally written in Assembly)." (of Wikipedia)
  2. C++ -> "Bjarne Stroustrup developed C++ in 1983 in Bell Labs as an addition to the C language." [of Wikipedia) -> Abstraction in relation to C: Introduces Object-Oriented Programming.
  3. C# -> "During the development of the platform. NET, the libraries were originally written in a language called Simple Managed C (SMC), which had its own compiler. But in January 1999, a development team was formed by Anders Hejlsberg, who had been chosen by Microsoft to develop the language. The creation of the language called Cool begins. A little later, in 2000, the . NET project was presented to the public at the Professional Developers Conference (PDC), and the Cool language was renamed and presented as C#." (of Wikipedia) -> Abstraction in relation to C++: Introduces Garbage Collector, compiles for intermediate language, etc.

I am learning Java, when I feel that I already master the language I plan to migrate to . NET

If you’re learning Java, there’s another reason to start with C#, since the two languages have many similarities. Actually, C# was kind of Microsoft’s response to Java, see this article:

Why Microsoft created C#?

Answer by Dan Shappir (works at Wix), Quora:

During the 1990s, with Bill Gates in charge, and before Ballmer ruined everything, Microsoft was at the top of the Windows monopoly. It was alleged by the US Department of Defense that a Microsoft strategy at the time was to "embrace, extend and extinguish", meaning that they would embrace a successful technology, combine with Windows and extend it to become better, but also incompatible with the original. This would lead customers to use Windows and Microsoft products.

When Sun launched Java in 1995, Microsoft realized the potential of language and ecosystem and tried to implement this strategy. She introduced her own JVM implementation with IE3 and then started to upgrade it beyond the Java standard. Sun sued Microsoft in October 1997 for incompletely implementing the Java 1.1 standard, which forced Microsoft to discontinue its implementation.

Instead of migrating to Sun’s JVM and thus giving Sun significant leverage in the Windows world, Microsoft decided to "quit Sun" by Sun, introducing its own programming language and platform and effectively killing Java on Windows. They brought renowned programming language designer Anders Hejlsberg on board, who already had experience in changing and improving existing programming languages, and gave him the task of creating a "better Java" (not officially, but in practice). Thus C# and . NET Framework were born.


More information on the subject:


[1] Philip put a good point of view in his commenting:

It’s just an opinion, as you said yourself is a post that goes from opinion to answer, I agree that C# is the easiest language, in the terms cited by you, but in case the person does not know anything about programming, the Object-Oriented paradigm is more complex to learn for a beginner, sometimes it is better to learn a little C to understand concepts and then go to C#, because if not the person uses an object-oriented Paradigm Language and program in a structured way

But in the context of the question, where the author is already learning Java (which is very similar to C# and also has a paradigm of POO), And then you want to migrate to . NET, I think C# is the obvious choice. Not least because I do not believe that there is today any form of integration between the C language and . NET: How Many Languages does . NET framework support?.

Other questions related to POO:

  • 3

    It’s just an opinion, as you said yourself is a post that goes from opinion to answer, I agree that C# is the easiest language, in the terms cited by you, but in case the person does not know anything about programming, the Object-Oriented paradigm is more complex to learn for a beginner, sometimes it is better to learn a little C to understand concepts and then go to C#, because if not the person uses an object-oriented Paradigm Language and program in a structured way

  • That’s right, good point! But in the context of the question, where the author is already learning Java (which is very similar to C# and also has a POO paradigm), and then intends to migrate to . NET, I believe that C# is the obvious choice. Not least because I don’t believe that there is today any form of integration between the C language and . NET: How Many Languages does . NET framework support?.

  • Yes in context and because he is already starting in Java C# is obviously the most suitable, because they are very similar, so migrating from one to the other is quiet, the owner of the question I leave the tip also, as this starting programming already in a POO language, try to learn well about the Object Orientation itself will further aid learning, since the use of API’s will make more sense, as you will understand the behavior and functioning more broadly

  • 2

    The answer is good, well worked out, what I think is a little complicated is that the question is still opinionated and for that there is the reason for proper closure. In fact it can even be closed off as out of scope because giving opinions on what one should learn is not in our scope. Especially in cases where you don’t even know the person’s reality. The answer skips a little because it takes a side and then becomes clearly opinionated. Although I agree with her, in part, it would have been better if she put down why choose each of them, rather than say which one to choose.

  • 1

    Congratulations on your dedication, but here’s a tip on what you can improve and the next.

  • Thanks for the tips @Maniero! When I saw the question I soon thought of signaling it as "based on opinions" without saying anything, but I remembered that I have already found questions on Soen a little similar to this (although this is clearly asking for a real opinion)but that are pertinent doubts and that end up having interesting answers, which show various points of view, comparing languages and showing points of both. At this point, I totally agree that I should have taken a different approach and talked a little about the characteristics of each one!

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.