C# vs. C++ Code Comparison

  Рет қаралды 870

Gavin Lon

Gavin Lon

Күн бұрын

Пікірлер: 22
@krzysztof3546
@krzysztof3546 3 ай бұрын
Thanks Gavin. Please do a deeper dive video when you have a moment. You have a talent in explaining things.
@GavinLon
@GavinLon 3 ай бұрын
Thank you! Sure - I'd love to a do a deeper dive into this topic! :)
@kvelez
@kvelez 2 ай бұрын
Great.
@alcidesneto6415
@alcidesneto6415 3 ай бұрын
Great tutorial. I am stupid in C++ and love C#. However, C++ seems singular, and I would love to learn it someday. About the video, I got that C# classes are reference types by default, but how can I behave similarly to the C++ code? Maybe something like BankAccount bankAccount2 = new BankAccount(bankAccount1);?
@GavinLon
@GavinLon 3 ай бұрын
That's right, in C# to create a copy of an object in memory - you could just pass the relevant values from bankAccount1 into the constructor of bankAccount2 when you are instantiating bankAccount2 using the 'new' keyword. :)
@happyfarang
@happyfarang 3 ай бұрын
You should mention that you can instantiate a new object and assign it values not as references. You can also make a constructor to avoid references. It's just another approach than c++. There are pros and cons to both languages. I like c# because I can let my brain rest more. Lol. It's easier but .. also have It's own pitfalls.
@GavinLon
@GavinLon 3 ай бұрын
Absolutely. Thanks for your comment. I was trying to keep the example as simple as possible and focus on a small aspect of both languages for the comparison - so I tried to avoid nuances. :) I may do a deeper dive in a later video.
@yogibarista2818
@yogibarista2818 3 ай бұрын
Yes - C++ classes are value types by default, while C# classes are reference type by default - creating a reference type class in C++ is possible but awkward, creating a value type class in C# is ... yeah, no...
@GavinLon
@GavinLon 3 ай бұрын
Thank you! :) Yeah - you can use a 'record' in C# - which kind of simulates the behaviour of a value type (but behind the scenes is a class). You can also use a struct in C# which is a value type.
@vladyslav-py-js-go
@vladyslav-py-js-go 2 ай бұрын
Wanna learn them both 😅
@GavinLon
@GavinLon 2 ай бұрын
I like your way of thinking :)
@bk9600
@bk9600 3 ай бұрын
Great video, but honestly programmers should avoid c++ if they want to keep their sanity
@GavinLon
@GavinLon 3 ай бұрын
I'll be honest with you. I've been a professional developer for a long time and I would not like to code professionally using C++. You're right - could be a serious mental health risk lol
@ulrich-tonmoy
@ulrich-tonmoy 3 ай бұрын
and still tools like blender Godot are programmed in C++ Maybe for web development the lowest you should go is Go but for system C/C++ is still most used
@GavinLon
@GavinLon 3 ай бұрын
@ulrich-tonmoy Sure, absolutely - I joke about C++ but it is of course a fantastic technology and for system development or wherever you are resource constrained by your target device or in general you need highly performant runtime code - C++ or C is the best choice! :)
@bk9600
@bk9600 3 ай бұрын
@@ulrich-tonmoy I just joking you know right 😂😂. I do use c++ for game development in unreal and systems but I prefer to use Java for systems. C++ is good but seriously coding in c++ can make someone go mad
@GavinLon
@GavinLon 3 ай бұрын
@ulrich-tonmoy - Well languages like C# and Java have the benefit of their designers learning from the C++ language (standing on the shoulders of giants). Yeah C++ and Unreal is probably the best solution for game development. :) I think if I was a professional game development I would also use the Unreal game engine.
@womenaria
@womenaria 3 ай бұрын
Gavin lon ❤❤
Is C# Better than C++?
12:43
Gavin Lon
Рет қаралды 2,8 М.
Top 10 Programming Languages to Learn in 2024
20:27
Gavin Lon
Рет қаралды 2 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Java is Declining and C# is Gaining - How Do We know??
11:39
Gavin Lon
Рет қаралды 6 М.
Is C# Better than Go (Golang)?
10:12
Gavin Lon
Рет қаралды 9 М.
Intro to Meson
9:52
durk
Рет қаралды 1,5 М.
Ten Amazing Blazor Features You Must Know
25:34
Gavin Lon
Рет қаралды 6 М.
Is Unity Better than Unreal Engine?
17:46
Gavin Lon
Рет қаралды 3 М.
Is Becoming a Professional Software Developer Still Worth it?
9:53
Is C# Better than Rust?
12:24
Gavin Lon
Рет қаралды 3,5 М.
Is C# Stolen from Java?
18:51
Gavin Lon
Рет қаралды 2,1 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН