Skip to content
← Back to Community
Python or C?
Profile icon
h
has Hacker Plan
Crcoli7307

Python or C?

So I just started learning C, I've learned Python for about 3 weeks and I would like to compare and contrast them a bit and give them both pros and cons.

Demo

For this demo, I will be making a Pin Verification program in both Python and C. The objectives are:

Pros and Cons

Python

Pros:

  • Python is Easy to Learn
  • Python usually takes less time and fewer lines of code to write.
  • Python can easily make variables and inputs

Cons:

  • You can not make "big" software with Python, for example, you can not make a full operating system with just Python.
  • More people know python so there is a higher chance of someone already making/made what you want to make.

C

Pros:

  • You can make "big" software such as full operating systems and large programs.
  • Fewer people know C as it is harder to learn which means you have a lesser chance that someone is already making what you are making.

Cons:

  • It is confusing to learn C at first because there are lots of squiggly brackets and parentheses.
  • It takes more time and lines to write a program.
  • Just to make an input you have to print the question then use scanf to save it to the variable.

Conclusion

So, you tell me, what do you think is better. I equally like both. But you can do more with C but Python is easier to learn. Let me know what you think in the comments!

Voters
Profile icon
29kima
Profile icon
NupurSarkar
Profile icon
LiyaLinesh
Profile icon
saarthaks53
Profile icon
Seikowo
Profile icon
MajdZaher
Profile icon
EfeTatlidil
Profile icon
Boneng
Profile icon
EAdags
Profile icon
mobarmij
Comments
hotnewtop
Profile icon
bmtrnavsky

I feel like C is far more common than you think. Pretty much every Computer Science student ever learned C in college even if they do not use it in their day-to-day job. the question is really more about what do you want to do and what language is best suited for it. For instance if I wanted to build enterprise software I might invest in C but as a data scientist R or Python would be far better.

Profile icon
MultiLangCoder

C

Profile icon
a-repl-user

for a sec there i thought C: was a smiley face

Profile icon
TheDrone7

Quick note: It doesn't matter if someone has already made what you're planning to make, there's always room for improvements and you can always do that.

Also, which language should be used is a very subjective question and depends on a lot more factors. Try adding more content such as examples and who uses what and for what purposes.

Profile icon
Oruma

I agree Python is easier to learn compared to C but the interesting part is that C has more advantage to Python.

Profile icon
ZXDANIEL

C is the better choice. When I started off python I found a lot of things counter-intuitive. Python is a bit like driving with automatic while C is more manual. This is rather important since what differentiates a code monkey from a human is the level of understanding...

Profile icon
BenK9

my opinion is python because you can use staff like Cython or Numba to give it c speed and larder community with allot of libs

Profile icon
The-Adventure-B

python

Profile icon
Triph

So, in my opinion, python is nice since you need less time to write code , but , like any programming language, has pros and cons. Remember this is an opinion from a guy that is a mediocre in python and a starter in C(c++).

Profile icon
IgorCeapa1

Python is based on C (C++)
So C is 100 level for a pythonist
Gues what You should do

Profile icon
JimmyNuetron

PYTHON FOR THE WIN

Profile icon
Smoke52ru

Javascript :)

Profile icon
MrGCODE

Python

Profile icon
AibekImankozhoe

Exactly Python!
Python Programming language is heavily backed by Facebook, Amazon Web Services, and especially Google.

Profile icon
[deleted]

python lol, who tf is making a os in 2021?! xd

Profile icon
[deleted]

I took some weeks to learn Python, myself, for use in some visual novels. It was my first programming language. I'm currently learning C. I use manuals for both things. In my experience, Python is, indeed, much easier. C has given me a lot of headaches in the beginning. Things are sailing smoothly now...
I also found out that learning C clarifies some things I couldn't figure out in Python with Python-centered tutorials, as Python takes inspiration from C. It's like learning C is helping me with Python, somehow.
A good comparison, thanks for making it. Much appreciated.~

Profile icon
DynamicSquid

Umm... I don't think you can compare Python and C, as those are two completely different languages. For example, right off the top of my head, I know Python can be used for web scrapping, while C cannot. So comparing them wouldn't really work.

Also on the issue of number of lines, I don't think that really matters, or is a fair way of comparing languages. Syntax, white spaces, and all that don't really matter. It's more about what a language can do rather than how it looks.

Also, Python can be used to make big projects. YouTube, Google, Reddit, all made using Python.

Profile icon
Crcoli7307

@DynamicSquid Very Interesting...

Profile icon
CSharpIsGud

@DynamicSquid C can do web scraping, there isn't really much if anything python can do that C cant.
Its just that while you can make a web scraper in C, its many more orders of magnitude more complicated and harder to do and for most of the reasons people use a web scraper its impractical

Also, its more likely that companies like google only use python for certain portions of their services, due to its speed. Things like database etc.. most definitely are written in another language

Profile icon
DynamicSquid

@CSharpIsGud Oh I didn't know that! That's pretty cool.

Profile icon
CodeLongAndPros

@DynamicSquid On the LOC issue:

You seem to like the lines-of-code metric. There are many lines of GNU code in a typical Linux distribution. You seem to suggest that (more LOC) == (more important). However, I submit to you that raw LOC numbers do not directly correlate with importance. I would suggest that clock cycles spent on code is a better metric. For example, if my system spends 90% of its time executing XFree86 code, XFree86 is probably the single most important collection of code on my system. Even if I loaded ten times as many lines of useless bloatware on my system and I never excuted that bloatware, it certainly isn't more important code than XFree86. Obviously, this metric isn't perfect either, but LOC really, really sucks. Please refrain from using it ever again in supporting any argument.