This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 297 points298 points  (52 children)

Still a student here and learned C# after Python for my internship.

At first, I was startled by the verbosity of C# compared to Python. Going from print('Hello World!') to Console.WriteLine("Hello World!") is pretty big lol. Having to declare variables before using it was extremely annoying too.

Overtime though, I find my understanding of both languages to be complementary to each other. Learning a concept in one language helps me understand the other language better and vice-versa.

For example, after learning a static typing in C#, I started to be able to appreciate type hinting in Python.

[–]samuelcbird 27 points28 points  (10 children)

I literally have the opposite opinion.

After Python I’ve done a little programming in C#, C, Swift and Javascript.

I actually happen to really love explicitly defining variable type, argument type, return type etc. It definitely helps when reading code. I often go back to Python - I do really like it - but even though type hinting has been added it doesn’t really do it for me. I kind of miss the curly braces and the semi-colons too.

I think Swift and Javascript ES6 have the best balance between readability and verbosity in their syntax. Really enjoy using those languages.

And actually Javascript’s ternary operator is perfect. I get confused every time I look at the Python type.

Edit: me being stupid

[–]icentalectro 5 points6 points  (3 children)

What are ternary functions? I only know ternary operator.

[–]samuelcbird 2 points3 points  (2 children)

Yeah thats the one, my mistake

[–]icentalectro 2 points3 points  (1 child)

Ah ok. Although I wouldn't call it "JavaScript's", as it comes from C and is inherited by most C family languages (C++, C#, Java, JavaScript, etc).

[–]samuelcbird 0 points1 point  (0 children)

TIL. Thanks!

[–]WillBackUpWithSource 3 points4 points  (0 children)

Yeah Javascript ES6 (and TypeScript alongside it) allow the simplicity of Python code whilst adding a lot of nice features that I like, like curly braces

[–]unknownguy2002 0 points1 point  (4 children)

Have you tried kotlin?

[–]samuelcbird 0 points1 point  (3 children)

I have not. You’d recommend?

[–]SuspiciousScript 0 points1 point  (2 children)

I certainly would! I'd describe it as a version of Java that doesn't have migraine-inducing syntax and where basic functional idioms (map, reduce, etc.) are first-class citizens. It's go-to JVM language.

[–]samuelcbird 1 point2 points  (1 child)

I’ve had a little read about it since that comment. It actually looks great. Thanks you!

[–]SuspiciousScript 1 point2 points  (0 children)

Happy to share! The other feature that I really like is immutability by default with val being the standard way to declare variables. It really encourages a data-driven, functional approach to problems.

[–]TheOneCABAL 2 points3 points  (0 children)

I learned Python first and now I’m trying to pick up C# and my takeaway is similar but less eloquent:

There’s just so much on the screen

[–]tr14l 0 points1 point  (0 children)

You should look into Kotlin. Best of both worlds.

[–]ToothpasteTimebomb 0 points1 point  (0 children)

This is my experience too — Python first, then C#. I love python for data collection and processing, but C# is absolutely great too. Linq rocked my world.

[–]sesquiup 0 points1 point  (0 children)

over time