Variables in C# vs Python - why people like Python more

  Рет қаралды 414

Tom Lynch

Tom Lynch

12 күн бұрын

C# is faster and safer but Python is so darn much fun!

Пікірлер: 8
@Pasi4K5
@Pasi4K5 8 күн бұрын
I think most of the arguments you've presented are invalid. You've pointed out these 4 inconveniences of C#: 1. "In C#, you have to use a Semicolon at the end of every statement." This is true, but on the other hand, in Python, you need to use a \ or parentheses to let the interpreter know that the statement isn't finished yet if you have a multi-line statement. So Python basically just removes one inconvenience and adds a new one in exchange. 2. "In C#, you need to specify the type when declaring a variable." This is simply not true. You can use the `var` keyword for type inference, and using this feature has been the de facto standard in C# for many years. 3. For some reason you made it look like using a lowercase l instead of an uppercase L being a problem is specific to C#. I'm not sure why, but this is with every case-sensitive programming language, including Python. If you try to run `Print('Hello World')` in python, it won't work, so not sure why you put this in a video comparing C# to Python and kind of list it as a negative for C#. 4. "C# can't handle a trillion because you only have 32 bits to work with." Again, not true. You have 32 bits to work with *if you are using a variable of type int*. There are also larger data types. the `long` type is a 64 bit integer that can store numbers much larger than a trillion. BTW, if you would just use the `var` keyword for declaring variables, you would know that this is possible since the compiler would automatically choose `long` as the datatype because `int` is too small. Additionally, I just feel like this video is kind of unfairly one-sided, because you talk about all these differences as "inconveniences of C#" when really those are the things that make C# as robust as it is. You WANT the compiler to yell at you, because if the compiler doesn't yell at you, your program will probably yell at you at runtime at some point, making it much harder and slower to debug.
@marsovac
@marsovac 8 күн бұрын
var x = 10000000000000; this is perfectly valid in C#. So the argument that C# can't handle trillion is completely bogus. What is wrong in C# is to do: var x = 1000; x += 100000000000; This will tell you that long cannot fit into int. Which is a good thing. You need to be explicit in this case, because this often is a runtime bug even in python when some bogus high value coming from a bug is fit into another variable and you loose the trace of where the bug came from. long x = 1000; x += 100000000000; This will work, and you explicitly said that you want to handle such big numbers. But I understand that python is easier on novices. This is why it is becoming popular. However when such novices start to use it for anything serious it becomes a nuisance that leads to bugs that are hard to trace and debug. And if they learnt programming through python they are hardwired to not understanding how code interacts with the machine, making then worse programmers. Lower level languages are better to learn the essence of programming. Statically typed languages are better for larger projects. Python is ok for quick scripting. And this is the order in which they should be learnt.
@hypenheimer
@hypenheimer 8 күн бұрын
mfw AI generated thumbnail
@widrolo
@widrolo 8 күн бұрын
As a C++ dev, i can only tell you one thing. The problem youre presenting will not be a problem once youre fluent in a C-like language. In fact, i personally cant even write Python, because i constantly keep placing semicolons on the end of lines, surrounding code blocks in brackets and trying to define a type for variables. You wouldnt go to China, and complain that English is not understood by Chinese people, and then assume that English is easier than Chinese, since you speak it fluently. The same is with C-like languages. I cant write Python without the interpreter calling me a stupid C++ dev, and you cant write C# without the compiler calling you a stupid Python dev. Also, no one likes Python more, there is a reason why people and companies use it for making tools and data analysis software, and not for runtime apps and server software.
@ScottyCorpse
@ScottyCorpse 8 күн бұрын
Buncha C# coders in the comments who've never heard of a joke, and also gloss over the fact that all that was said is true for new devs - but that doesn't mean it's an infallible viewpoint. There's a reason people recommend learning with Python, and a lot of the lulz covered are reasons why. And that's okay. Everything has a place. Except for jokes on the internet. No place for those.
@casunax3484
@casunax3484 8 күн бұрын
python is trash
@hggpi
@hggpi 8 күн бұрын
nice edgy pfp
@casunax3484
@casunax3484 8 күн бұрын
@@hggpi it's from when I was a kid
5 Really Cool Python Functions
19:58
Indently
Рет қаралды 56 М.
5 Tips To Write Better Python Functions
15:59
Indently
Рет қаралды 96 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 67 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 20 МЛН
WHO LAUGHS LAST LAUGHS BEST 😎 #comedy
00:18
HaHaWhat
Рет қаралды 19 МЛН
Scary Teacher 3D Nick Troll Squid Game in Brush Teeth White or Black Challenge #shorts
00:47
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 81 М.
Modern Python logging
21:32
mCoding
Рет қаралды 161 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 42 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 740 М.
10 Nooby Mistakes Devs Often Make In Python
24:31
Indently
Рет қаралды 52 М.
C# Developer Tries Python - Challenge 1
14:52
Tom Lynch
Рет қаралды 49
Diffie-Hellman Key Exchange: How to Share a Secret
9:09
Spanning Tree
Рет қаралды 134 М.
Всегда снимай кольцо на речке
0:34
RICARDO
Рет қаралды 2,7 МЛН
小天使和小丑离家出走#short #angel #clown
0:36
Super Beauty team
Рет қаралды 27 МЛН
Surprise gift for the cat 🥰🥳👻
0:30
Ben Meryem
Рет қаралды 3,9 МЛН
Best father #shorts by Secret Vlog
0:18
Secret Vlog
Рет қаралды 11 МЛН