r/code • • Jul 07 '20

Halp pls! Should I learn Python or C# first?

I'm 13 years old and I really want to learn a programming language. I know a little bit of Html and Python (from school) but I want to learn more in my free time. I love making games, I made some decent games on scratch (I'm not proud of it). Which language should I learn first? What are the possibilities and limitations with both? Please use simplified terms since I'm new to this. Thank you

11 Upvotes

19 comments sorted by

8

u/CodeSamurai Jul 07 '20

Hello and welcome!

As you're probably already seeing, Python and C# are two very different languages (and they have very different uses), but there is a good amount of overlap between the two. In learning one, you'll learn a bit about the other without even knowing it. This is true of many languages.

I learned C# first, utilizing it mainly in the .NET stack (a stack is a collection of languages and technologies used together to create an application). C# is a fantastic language for learning the basics of coding and introducing you to some of the higher-level topics that you will eventually start encountering. C# will help you get a better feel for types (strings, characters, integers, decimals, enums, custom classes, etc) and how they can be manipulated and used within an application. Because C# is a compiled language, it will help keep you honest and make you think about the types you are using and why. If you use a type the wrong way, you will get a compilation error before the program even runs which is great instant feedback and will help build good habits.

However, Python is also a fantastic language for learning how to code. It is (arguably) easier to read, can be more forgiving when it comes to types, and is much quicker to spin up and "just try" something. It's a great language for folks just starting out as well as an incredibly powerful language that is used by data scientists and other coding professionals. I'm currently using it to dive into Computer Vision techniques and can tell you that it is an absolute blast.

All that to say: try them both and see what piques your interest. If you're into making games, you might look more into C# and Unity. Unity would be a great way to learn C# and let you make games at the same time. There are a ton of great tutorials for starting out with Unity and C#. Unity will also let you write JavaScript, another great language to have under your belt.

Learning a programming language should be just as interesting as it is challenging. Have fun with it, ask questions, make mistakes. It's all worth it, I promise.

2

u/A-Random-Dud3 Jul 07 '20

Thanks for the reply. I have a few questions

1.Is unity a language or is it a place to write different programming languages?

2. Which courses would you recommend for learning C#p?

Thanks again for the great reply

4

u/CodeSamurai Jul 07 '20

No problem! Happy to help.

Unity is an application (free to download and use) that will let you make games using C#, JavaScript or Boo. If you go to Youtube and search "Unity Tutorials", you will see a huge amount of tutorial videos that will walk you through how to make very simple 2D games. It might look a little daunting, but Unity is actually pretty easy to use and understand. You only write code to define the behavior of objects within the game. Everything else is basically drag-and-drop. It's a ton of fun.

As for tutorials, it would depend on what you end up wanting to do. I can pass along some good Unity tutorials if you'd like. Udemy has some great paid classes for learning C# and Unity (usually less than $20 for a whole course). There are also some decent Python tutorials out there. A lot of it will depend on what you want to do (make a game, simple application, image manipulation, etc).

1

u/A-Random-Dud3 Jul 08 '20

Hey sorry to annoy you again. I'm currently downloading unity but I found 2 free options. One is for students and the other is for personal use. Is there a big difference between them? The student one requires proof that I'm studying programming in a school or college which I don't have

2

u/CodeSamurai Jul 08 '20

No worries!

The student version will give you more bells and whistles to mess with, but you don't need to worry about that right now. Just download the personal version and start with that. If you're still into it once you're in college, you can use your student email and get the student version.

1

u/A-Random-Dud3 Jul 08 '20

Thank you! I have a student email for school. Can I use that? And btw I've started to mess around with it this morning (in 3d) do you reccomend starting in 3d or 2d?

2

u/anavid7 Jul 07 '20

That's awesome that you are taking initiative to learn coding! Learning at this age will pay great dividends in the future. If I can I would like to add one thing to the conversation. It seems like you are leaning to C# and I think that is a good idea for a first language. Python has several core differences when compared to other languages (non static variable types, no semicolons). This gives it particular strengths in different areas. You will find that C# will have similarities between other common languages like Java, C, or C++. This means that even though Python may be easier to pick up for someone new to programming it might be better to start with something that you know will translate to other languages. That being said it is completely up to you and if you choose python I have no doubt you will learn other languages just fine! Good luck!

1

u/A-Random-Dud3 Jul 07 '20

Thank you so much!

I just thought I'd do something productive with my 12 hours of free time 😂

Do you think 3 hours per day is good enough?

1

u/anavid7 Jul 10 '20

3 hours would be plenty. More importantly do what you wanna do, I have a feeling that you will spend more then 3 hours when things start to click! But also don't force yourself. Learning code and coding is a form of art in some ways so if if you're not feeling it wait until the inspiration hits.

3

u/[deleted] Jul 07 '20

python is easy but very easy to make mistakes with, i think C# is the way to learn since its much more traditional, theres line endings and curly braces which will help you understand the purpose python's indentation. i vote C#

1

u/Poptartqueen6 Jul 07 '20

How is python easy? In the beginning but is. But then it gets a bit tough. I guess some people are easier at picking it up than others.

2

u/[deleted] Jul 07 '20

once you understand the fundamentals of programming as a whole you just need to figure out the syntax, which isnt that hard

1

u/Poptartqueen6 Jul 07 '20

I guess so. Any pointers on how to learn it and improve on it?:) I only took an intro course a few months ago.

2

u/[deleted] Jul 08 '20

I'd consider the fundamentals of programming, that almost every language will implement in one way or another are these:

  • Arithmetic operators/operations - addition, multiplication

  • Types - how are numbers represented, how are letters represented (abstract), how bytes are represented in a program

  • Variables - a container for a type instance (mutable)

  • Conditional Statements - gives us a way to control the flow of the program based on a given condition

  • Loops - a conditional statement that will continue until the condition is true

This is the real bare down, kind of high level interpretation of what the fundamentals are, but I'd go deeper and read how the computer actually sees the code and how your source code is changed from a text file into an actual executable. I think it's really important for a programmer to have this low level knowledge of how the computer actually works with software. If you can get an understanding of that you will be leagues ahead of a lot of people.

Here's kind of a little example of programming languages and how they have these fundamental concepts implemented. You'll see they're all similar, the real differences are more with learning the libraries through documentation.

python

if condition:
    my_var = 1 + 2 / 1
    print('do this if condition is true!')
else:
    print('condition is false')
            
    while 1:
        print('condition is false')

C/C++

if(condition) {
    int myVar = 1 + 2 / 1;
    printf("do this if condition is true!");
} else {
    printf("condition is false");
    
    while(1) {
        printf("infinite, since 1 is always true");
    }
}

C#

if(condition) {
    int myVar = 1 + 2 / 1;
    Console.WriteLine("do this if condition is true!");
} else {
    Console.WriteLine("condition is false");

    while(1) {
        Console.WriteLine("infinite, since 1 is always true");
    }
}

JavaScript

if(condition) {
    var myVar = 1 + 2 / 1;
    console.log("do this if condition is true!");
} else {
    console.log("condition is false");
    
    while(1) {
        console.log("infinite, since 1 is always true");
    }
}

1

u/Poptartqueen6 Jul 08 '20

Thanks so much for the helpful tips! Really appreciate it:)

Do you have any recommendations for books, resources, websites and online courses? Been looking at freecodecamp.com (or whatever it's called) and some free courses offered by Coursera. Any thoughts and/suggestions?

1

u/LinkifyBot Jul 08 '20

I found links in your comment that were not hyperlinked:

I did the honors for you.


delete | information | <3

1

u/[deleted] Jul 08 '20

I'm probably one of the worst when it comes to asking about books lol, i learn languages now a days by looking at the language documentation haha

I can recommend the following

  • C Programming Language (ANSI C) by Brian W. Kernighan and Dennis M. Ritchie - This is a classic book probably still used at unis, this is what i was taught with. The book was great but can be very, very stale at times and difficult to understand. I'd read it now and reread it later down the road to solidify your understanding.

  • Beginning C++ Through Game Programming 3rd Edition by Michael Dawson - I don't know why this book stuck with me for so long but it made me really understand C++ and object oriented programming. I think I read it from front to back like 3 times or something before it really clicked. It's an easy read and is fun to do the projects at the end of each chapter.

My favorite resources other than just googling it for C and C++ are https://www.cprogramming.com/ and http://www.cplusplus.com/doc/tutorial/. Also, you can use man to find info on specific functions in C if you don't get it, like google 'man printf()'.

Find something you love about programming and run with it. I loved games and wanted to make games so I used that C++ book to learn and it was wicked fun. If you want to be successful in learning you have to find something that will keep you learning.

Good luck!

3

u/shumumazzu Jul 07 '20

JavaScript is really fun and easy to do on the web because it's very accessible and you can even get an app on your phone so you can code on a bus etc (I used to do that). https://www.w3schools.com/ teaches you everything you need to know. I started out making really simple "games" that weren't very much fun (I never finish any of them). As someone else said, you can use it in Unity but I wouldn't recommend it because it's slower to compute than C#. My recommendation would be to learn both C# and Python, but maybe Python first because it seems to be getting added to everything. In my profession I use Maya which uses python, or more specifically pymel. I don't actually use python alone so I'm not familiar with how easy it is to develop with or how quickly it computes graphics etc. The entertainment industry is pretty stressful and unforgiving but knowing programming languages makes me pretty invaluable. Not a lot of artists know how to code. I also use the Unreal engine which is free, but it uses blueprints which you have to learn or c++, which I was able to learn because I know all those other ones already. I can manage c++ but I have no formal programmer education and it is very high end with the garbage collection, syntax, pointers, etc. I actually recommend you learn c++ because everything will be easy after that. All these languages are pretty much the same when you learn more than three of them. I love C# but I only use it for wpf windows tools like file renamers, multithreaded sub directory file finders, a rendered image tracker and verifier, and a ton of other really lifesaving one off user tools.

2

u/[deleted] Sep 17 '20

I'm about your age and I started with c# because of the unity game engine

I recommend c#