C++ vs C# - What Programmers Need to Know About Their Similarities and Differences

preview_player
Показать описание
Programmers, software engineers, project managers, and developers often ask for recommendations for what programming language and development platform to use. In this video,
Chuck explains the overall differences between C++ and C#. C# and C++ are similar in many ways (C# design was based on C++), but there are striking differences. Whether you are needing to choose for an upcoming project, or trying to decide which to learn first, check out this video!

You can find our Udemy courses here:

0:00 Introduction
0:24 File Organization
1:21 Basics
2:38 Execution Environment
3:39 Type Specifiers
4:50 Memory Management
6:00 Generic Programming
7:05 Functional Programming
7:50 Inheritance
9:30 Standard Library
Рекомендации по теме
Комментарии
Автор

Wow this really goes over stuff really well. I want to point out the C# does actaully have a tiny amount of control over the GC as you can finalize things. Now this does not guarentee like... anything but you can finalize something and clean up resources in a "destructor" in C#. C# also supports pointers and memory management through unsafe code but no one should really be using it unless they are a niche exception.

rohansampat
Автор

I love the passion everyone has for their favorite language! Just as a bit of background, My first C++ project was in 1985 using CFront and my last was completed just a few weeks ago - a rather large application for the US military. C&C++ are my first loves as those were my first languages. I have built dozens of projects over the decades in C++, C#, and Java and I find all three to be quite capable and useful and enjoy all. I also have comprehensive training courses on all three platforms with thousands of students. Point is, I know and use all 3 and really have no preference. We left 30 minutes of video on the cutting room floor when making this, so we didn't cover every detail in this short video. Our goal wasn't to declare a winner, but to provide an answer to a very common question.

McCulloughAssociates
Автор

C# is the most beautiful language for me so that after 5 years of using it, I have no intent to switch to other languages.

JLPT-AIsensei
Автор

As an amateur musician, I hear C sharp and think: "isn't that the same as D flat?"

AlDunbar
Автор

personally, I though learning the programming rules for C++ was a easier than C#. But once I learned each language I found C# was a lot to use because of the reasons you mentioned.

dougwarner
Автор

As C++ programmer, I really like that it's represented in a correct way. That's really rare.

JVApen
Автор

To your point about C++ being useful for games, that's mostly true! If you're building an engine, or making a game from scratch C++'s performance is practically essential. I've used C# far more often for games though, since it's supported by engines like Unity and Godot, and tools like LINQ and interfaces can help manage complex collections of objects and their interactions. I like my engines in C++, and my game code in C#.

zacharychristy
Автор

I'm late in here. Thanks for this comparison. As a software developer working more than 2 decades with C++ and C# I can agree with your speech. Both languages are similar but do have subtle differences. As a guide I would suggest the following: For UI use C# and technologies that are best for the task. For near-hardware-work use C++. To close the gap between C# and C++ use C++/CLI. For implementing communication protocols use what ever you want - there are so many available...

rp
Автор

Interesting, and a good explanation. I've prgramed in both C++ and C#, and have found myself frustrsted at times with C#. I've ran into a few situations were what would be simple in C++ was not possible in C#.

Example: I had to modify an external library to do something that actually requied me to create a thread in it. The thread needed to finish its job before any application using it shutdown or the data would be lost. In C++ the thread would have to complete its job before it would stop processing. In C# the thread would just stop, regardless of its state at the time. Every mechanism, on paper, that was supposed to allow me some control over the thread in C# was bypast completely.

johnshaw
Автор

C# is beautiful when it comes to developing Web or Dekstop applications. I cannot find other languages more efficient than C# for those particular tasks.

simplereef
Автор

Any job these days is going to require C#, Java Script and Python. C++, while a superior language for sheer performance (in the right hands), does not lend itself well to the "average" code monkey. It's too easy for them to hang themselves with it. For that reason, it you have the honest ability to properly deal with C++ (and C) they are certainly nice to have on your resume and will probably allow to work your way into a higher paying job.

uni-byte
Автор

I liked this video and agree to most of the facts stated. This was what I was looking for. I would like to add a few things about c++. C++ covers really wide range of hardware--ranging from 8-bit microcontoller to 64-bit intel architecture. I would recommend undergrads to go though c++ concepts atleast once to understand how C++ rides the horse (hardware.) Once you are through C++ you would intutively understand how C# is working. I, myself, started from assembly language then C & C++ to-and-fro then c#. All because of the type of applications that I was developing.

manuprakash
Автор

I took C++ and VB in school and taught myself C#, I found that C# was easier to learn; its like C++ and VB had a baby. You get the power of C++ and the Graphical interface like VB all in one. I have been programming in C# for about 12 years now from game programming to databases and other apps at work.

Hcloud
Автор

Currently my tech stack is only web based things but I've really wanted to dig deep into other languages and working with the hardware more directly, been trying to learn C using GBDK (a library for writing gameboy games) which has been a huge be very fun learning curve! I've also been interested in learning C# just for job opportunities really, since I think I can probably pick that up faster and it seems to more there is a variety of work you can do with it. Even though I'm not looking at C++, I'm going down a bit of a rabbit hole of information here and absolutely loving it, really enjoyed the video.

adam
Автор

If you learn C++, learning C# will be a walk in the park. That is why I *always* tell people who have a talent for programming or a passion, go for it. Learn C and C++. Literally every single language after it, you will pick up in a week or two.

simonfarre
Автор

Hi!
6:01 - In seashark there is no way to alter garbage collection indeed, however ~destructors are worth mentioning.

denielalain
Автор

I learned C# first since it was the language Unity using which I use for making my games.

RandomDude
Автор

Extremely well done. From my admittedly short experience with C#, I find it gives you a ton of tools to do everything. C++ gives you the machinery to make the tools. Sure C++ doesn't have a webapi out of the box, but you can make more meaningful abstractions with C++ than C#.

That, and C# is a OO language first and C++ is exactly as OO as it is functional.

IamusTheFox
Автор

very good comparison. regarding the line "Programmer has no control over GC", while that's mostly true,
the programmer can force the garbage collector to run by calling GC.Collect().

amitzohar
Автор

I startet with C# because of my employer, but soon got hooked on the performance C++ offered. Some C# frameworks were terribly slow back then. Especially .NET Entity Framework. Almost all private projects are C++ now except where I'm forced to use other languages. The only thing I really miss are human readable compiler errors. Especially template-related error messages can be almost unreadable.

OperationDarkside
welcome to shbcf.ru