i teach both at the same time in an intro to programming course, precisely because they complement each other well as learning languages that hit different areas; either is a perfectly reasonable starting point python will do more things for the programmer's convenience, as opposed to c leaving every little minute detail up to the programmer to manage but on the other hand, c syntax will be much closer to other languages you'll pick up over time skills will be trained by either or both, it really doesn't matter. you need to learn about variables, data structures (foremost: arrays), loops, branches (like if), and functions. either one will give you practice with those that will be applicable to other languages pick the one that you can use to engage with a project you're interested in or, barring that, the one you'll have the most support for in your life, such as accessibility to classes or fellow learners or such if you really can't decide, flip a coin and start on one. switch to the other at any time if you're bored, confused, or curious Answer from eruciform on reddit.com
🌐
Reddit
reddit.com › r/learnprogramming › c or python?
C or Python? : r/learnprogramming
July 21, 2021 - C++ was created as a superset of C, or basically "adding OOP concepts to C", cue the "++" part. ... OOP was never necessary tho. ... C will not help you for AI. C is mainly used today in system (driver) programming and embedded systems. Python on the other hand is quite commonly used for ML and AI.
🌐
Reddit
reddit.com › r/learnprogramming › python or c for a beginner?
r/learnprogramming on Reddit: Python or C for a beginner?
March 2, 2023 -

I'm fully new to programming and have been doing research on what a good first language to choose is. For the most part, I have seen Python and C. I do plan on learning both but I don't know what to start with. What are the pros and cons of starting with each? Which one trains universal programming skills better? What do you recommend?

🌐
Reddit
reddit.com › r/learnprogramming › am i crazy or is python way "easier" than c/c++? help me appreciate lower level languages!
r/learnprogramming on Reddit: Am I crazy or is Python way "easier" than C/C++? Help me appreciate lower level languages!
October 6, 2020 -

I love Python. It comes so naturally to me. I can flow with Python. With C or C++ it feels a lot more choppy or bumpy or just overal gross. I'm sure this is because Python is "high level" and C++ is "low level" but that doesn't make me enjoy coding in it. Give me your thoughts and opinions on this topic, I want to be more understanding towards it all because I want to love C++

Top answer
1 of 5
838

Yes, there are a lot of things about Python that make it easier to use than C or C++. The thing about different languages is that they tend to help you solve different problems. Python is a flexible, expressive language, which makes it very nice to write, but Python is less efficient than C or C++. If runtime performance isn't a big deal, then Python is a great tool.

I am a big fan of statically typed languages like C and C++. Every variable having an explicit type gives me a whole lot of useful information when I first look at a piece of code I've never seen before. Also, C is kind of required for certain types of programming, like operating systems and embedded systems.

Here's one reason to knuckle down and learn some C. C gives you a much better picture of how your computer actually works, especially once you start to play around with pointers. It's hard, but it's good for you, kinda like eating your vegetables. You'll have a better understanding of things when you go back to using whatever language you prefer.

2 of 5
170

I recommend doing the Nand2Tetris course. You will develop your own fully object oriented language from scratch. Once you are done you will have a really good appreciation of low level languages.

The final goal of the course was to develop a game that can run at a playable frame rate. Drawing on the screen, from a single dot to a diagonal line has a performance penalty. I was able to make performance optimisations that would have only been possible using low level languages. I spent hours and hours going through memory addresses and tracing every single pixel change in the graphics memory to make it work.

Once you are done, languages like C/C++ will become a breeze. Great course, highly recommend it.

🌐
Reddit
reddit.com › r/learnprogramming › what is the difference between c and python?
r/learnprogramming on Reddit: What is the difference between C and python?
August 7, 2020 -

Hi! Today I started learning C after passing my python exams. But I dont understand why C needs a compiler when I run it on visual studio code. When I installed python I only had to install visual code studio and an extension.

Top answer
1 of 4
2
Python programs are generally interpreted, instead of compiled. It sounds like you already happened to have Python installed on your system when you started.
2 of 4
2
Your computer doesn't understand C or Python. It needs a program to convert the human-readable source code into machine-readable computer instructions. In the case of C, you typically run a program ahead of time to convert the source code to machine instructions, then just pass around the bundle of machine instructions (an "executable file"). This step can take a while, partly because the program that does this conversion takes its time to optimize the code as it goes, like eliminating lines of code that don't change anything. In the case of Python, you typically translate the source code to machine instructions when you run it, so if you're sharing a Python program with someone, you typically send them the source code. This makes Python programs much slower to run than converting it to machine instructions ahead of time, but Python allows you to change the program so much while it's running that it has a hard time figuring out which machine instructions it needs to use in any given spot until it gets there anyway. Because C programs are distributed as machine instructions and Python programs are distributed as source code, this means that you need Python's interpreter on your computer just to run a Python program, even if you didn't write it yourself. If you didn't have to install Python yourself, it's likely because your computer's operating system has some utilities written in Python, so the program was already installed in order to run those. Since you only need a C compiler to build software and not to run it, the operating system probably didn't come bundled with the C compiler.
🌐
Reddit
reddit.com › r/learnprogramming › should i learn python or c?
r/learnprogramming on Reddit: Should I learn Python or C?
July 9, 2024 -

I am a high school student. I want to become a "good" software engineer in future. I want to learn programming due to my interest in computers and technology. I don't have any specific goal or interest, like web development or any other.

Some say to start with Python, as it will help to start easier, then learn other languages.

Some say to start with C, as it will teach me basics of programming and will make it easier to learn other languages. Python will make it difficult to learn complex languages, like C++, and I will learn bad habits from Python, as it is very easy.

I know I may be wrong, but I don't have much knowledge about programming. Please help me decide between Python and C.

🌐
Reddit
reddit.com › r/learnprogramming › c++ vs python
r/learnprogramming on Reddit: C++ vs python
June 10, 2023 -

I'm going to be a senior next year in high school, and I have a lot of free time, should I learn python or c++ or Java? I want to do cs in college and become a software engineer. also it would be great if you can provide a YouTube series/website that teaches it for free

Find elsewhere
🌐
Reddit
reddit.com › r/learnprogramming › c/c++ or python, which one to start with in 2024?
r/learnprogramming on Reddit: C/C++ or Python, which one to start with in 2024?
January 29, 2024 -

Hi all, it’s the same old question, which language should you start with as someone new to the world of programming.

Typical at university level in engineering majors (Electrical Engineering) you are usually taught C. Thats where i got introduced to programming for the first time. But the way universities are structured, it’s not always the best place to learn programming especially in a non-CS major.

Long story short, I find myself with this passion to dive deep and actually understands what programming is not just a language, but as they say, you have to start somewhere, hence the title statement, where do you start from in 2024?

I narrowed down these options as Python seems to be the most beginner friendly language whereas a languages like C/C++ has always been regarded as the languages to under to understand every other language with ease and especially to really understand the “source code” to programming itself.

Appreciate any advice/experiences, thanks!

🌐
Reddit
reddit.com › r/learnprogramming › java vs python vs c++
r/learnprogramming on Reddit: Java vs python vs C++
May 23, 2023 -

Hey y'all, I'll be needing to choose either one of Java, python, c++ or web programming for my second semester in electronics and communications but i have no idea where to start from

I've learnt all the basics of c programming in my first semester and i have to choose between the above mentioned for the second semester and it's really rattling my brain

Which of them would be better for a beginner to programming language and which would be most helpful in the future, if you'd have to say?

Thanks in advance!

Top answer
1 of 5
264
All of those languages are useful in different situations. Python's very popular with scientists, ML engineers, and the like. Non-programmers who need to write programs love it because it's approachable and has a plugin for basically anything. It's my favorite language for writing tiny, one-off programs and doing hackathons and coding competitions and stuff. Java's the workhorse of the corporate world. If you're writing a giant application full of business logic for a big corporation, and you're gonna maintain it for two decades, Java's still the default choice. C++ is the most powerful option. If you need something to go as fast as it can go, C++ is your default choice. But whole types of bugs around stuff like memory that are basically impossible to cause in Python or Java are really easy to cause in C++, and its error messages aren't so much legible as they arSegmentation Fault (core dumped). You can go far with any of them, and there's a good chance you'll end up learning all three at some point.
2 of 5
88
Love Python, but I’m in the “it’s better as your 2nd/3rd language” camp. The others are ‘harder’ and force you to gain a deeper understanding. Then you can pickup Python super easy. “Oh hey, it basically works the same but just does all the fiddly bits for me”. But you would know what those fiddly bits are, and can check the docs and be certain that behind the curtain it really is doing what you think it is. People who do it the other way around seem to have it harder, they don’t know how much Python is doing for them, why, or that it even is.
🌐
Reddit
reddit.com › r/python › is c better than python?
r/Python on Reddit: Is C better than Python?
November 6, 2021 -

I'm currently studying Data Science and AI, and I'm using Python as a main language but a friend told me to learn a high-level python and then migrate to C because C is better, faster etc. But now I'm confused, I don't know if I continue using Python or I already start now learning C. What do you guys think about that? PS: Thank you guys for the all support, now I understand a bit more about programming languages, thank you so much!

🌐
Reddit
reddit.com › r/learnpython › how much different is python from c, c++ etc?
r/learnpython on Reddit: How Much Different is Python from C, C++ etc?
September 28, 2019 -

I was talking to a co=worker the other day. He said that for embedded or hardware C & C++ are the languages used. i asked why and he really didn't know

First, how much of a difference is there from Python vs. C, C++?

Second, what is C used for embedded or hardware?

Thank you

Top answer
1 of 3
14

The whole point of python is that modern computers are amazingly fast and cheap, so python sacrifices run speed for programing ease. Much of the boilerplate code required in other languages is automatically done in python. So compared to other languages python is super fast to program, but slow to run. On a modern computer that slowdown is usually barely noticeable, so it's often a good choice.

Microcontrollers used in embedded applications are not that fast. So there's still a lot to be gained from optimized code only available with C or similar. However people can and do use python. Google "circuit python" sometime, it's really easy.

2 of 3
7

Python is interpreted; C/C++ are compiled. A Python file is read by a Python interpreter and executed by "compiling" each Python line into machine code on the fly. Note this means that the Python interpreter - itself a program - first needs to start.

C/C++ being compiled means their source code is fed through a C/C++ compiler and it outputs an executable. That's already in machine code so there's no separate program that needs to run first. And it can optimize lots of things, much better than the Python interpreters can.

In C/C++ you have direct control of memory so you can do things like actually free up memory right when you no longer need it. In Python, you let Python handle that for you and it will do it at some point. Basic structures are also smaller - for example, a Python list of 2 integers uses something like 150 bytes (ballpark, from memory so forgive me if that's wrong). In C/C++ an array of two integers is twice the size of one integer - so it would probably be 8 bytes total. The difference is less drastic when you compare, say, 1000 integers but for the most part arrays of 2 or 3 things are very common and C/C++ wins by a mile here. On an embedded system you not only have a slower CPU you have less memory and don't want to waste it on Python setting up pointers to structures and its own overhead just to store two integers. More esoteric, but in Python the list and the integers are all in the heap whereas in C/C++ you'd be able to put them on the stack - this may seem like "OK, whatever" but the heap itself has an overhead to request memory and with Python you'd probably have at least 3 hits to create a list of two integers but in C/C++ you can avoid the heap entirely.

This is of course a gross oversimplification. Key takeaways are the lack of overhead (interpreter), optimizations, and the principle of not paying for what you don't need (direct control over memory usage/heap vs stack/smaller structures).

🌐
Reddit
reddit.com › r/learnprogramming › c or python?
r/learnprogramming on Reddit: C or Python?
March 5, 2020 -

Hi
So i'm a person who likes using MCUs as a hobby. I've been using Arduino and it's pseudo language but now i'm trying to step further into programming so I bought a couple of ESP32, which uses C instead of Pseudo C, but it can also be adapted to use python.
So I'm trying to decide which one is best for me to start learning more concepts.
I know python is easier but slower than C. That kind of time edge is not really important for my MCU projects. However, I also know that learning difficult things make easier for you to understand easier languages in the future (like python)
Any thoughts or advice about this?
I understand basic programming concepts and I have a small and brief history of front end webpage programming with HTML, CSS and very little js, as well as medium Powershell knowledge.

🌐
Reddit
reddit.com › r/leetcode › honest opinion: c/c++ or python?
r/leetcode on Reddit: Honest Opinion: C/C++ or Python?
July 15, 2024 -

Most of my life I have worked on C programming language and used it in embedded programming, I love to code in it. But when I jump to Leetcode for solving things, I see C takes a lot of time, lines of code, whereas python does the job in few lines itself.

But still I think with C I am knowing what I am doing it gives me more freedom to actually see what is going in background whereas for python, boom, include some magic** and it works like a charm,

I am open to learn Python but not sure will it help me out in real world interviews, if someone asks me something, i am not a competitive programmer, I want to just learn new things and use them in my work,

any guidance should I go for python? or stick to C?

e.g. Sorting algos we need to implement in C to solve a question, max I can use is a qsort but python does the job using sort() function not sure if many python programmers know what goes in the background of sort() function, I may be wrong

🌐
Reddit
reddit.com › r/learnprogramming › what should i learn first, python or c++ ?
r/learnprogramming on Reddit: What should I learn first, Python or C++ ?
August 4, 2021 -

I'm in my first year of CS engineering. I have learned C. Its about time I pick up new language but Im confused if i should learn python or C++ first.

I have to learn both of them ultimately(requirement) but what order would be easier and less hassling.

🌐
Reddit
reddit.com › r/c_programming › choosing between c and python: navigating career prospects as a cs student
r/C_Programming on Reddit: Choosing Between C and Python: Navigating Career Prospects as a CS Student
February 8, 2024 -

Hello, I'm a 21-year-old CS student facing quite a dilemma. Over the past year, I've been learning C as part of my university program. This curriculum covered basic concepts such as if statements, arrays, loops, and strings. (This year, we're delving into pointers and memory allocation.) However, I'm eager to secure a job. In my country, the two most popular languages for employment appear to be Python and JavaScript. Consequently, I've started learning Python. Nonetheless, I've come across opinions online suggesting that Python might not be the best choice due to its perceived limitations in data types. So, I'm left wondering: should I continue learning C or switch to Python and begin my job search?

🌐
Reddit
reddit.com › r/learnpython › how different is python from c++
r/learnpython on Reddit: How different is python from C++
July 10, 2022 -

Sorry in advance if this is the wrong place to ask this, but I wanted to do a small summer project and the program I was hoping to use is python based. I'm not at all an expert at c++ for starters, I just took a semester long class with the program and was hoping that at least some of taht knowledge would be easily transferable to python

Edit: looking at all the replies has been incredibly helpful. Looking through everything has really helped make the similarities and differences pretty clear between the two, so I’m sure it’ll be a process to get used to it but it doesn’t seem like figuring things out in python for what I want to use it for will be won’t be incredibly difficult.