Python vs. C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Python vs. C

I started learning Python around 6 months ago or so and I'm starting to feel like I'm getting the hang of it pretty good. I've been thinking of trying C next but to me it seems that almost anything that can be programmed with C can be done in Python. Can anyone with experience in both languages offer some pros and cons?

15th Jun 2017, 12:03 AM
Aaron Nelson
Aaron Nelson - avatar
15 Answers
+ 7
C or other compiled programming language offers much more powerful (rather than interpreted languages as Python)... but todays, computers have enough power to handling almost all with the seconds: if needed, some libraries are compiled with other languages, and then interfacing with Python (or others). In fact, cases where compiled languages are really mandatory are really few, and I think it will be more advised to improve and master skills in one language rather than study many less or more at same times ;)
15th Jun 2017, 12:11 AM
visph
visph - avatar
+ 6
I choose CPython The best of the two options. C is strong and if you use C++with it, it can have more uses than Python.
15th Jun 2017, 12:29 AM
Manual
Manual - avatar
+ 5
C is an easier, smaller, simpler, and more logical language. It's more powerful but it isn't used a lot for app dev. I love C but C++ is a better option now you've already learned Python. If you'd asked what to learn first, I'd have said C. But it's too late. So unless you're going to write kernel modules, or critical backend stuff, it saddens me to concede C++ is a better choice unless you're a serious coder. But as pointed out already, stick to one language at a time.
15th Jun 2017, 1:36 AM
Jamie
Jamie - avatar
+ 4
go for both you can buckle up your c codes in python python besides being fun crunches hard jobs nicely lots of libs unless performance issues you'd want to stick with python but learn both costs nothing
15th Jun 2017, 5:29 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 4
@Cheesy Game Studio: Learn knitting, you can have a sweater this winter ^^ (almost such related to question than your answer ;P)
15th Jun 2017, 8:05 AM
visph
visph - avatar
+ 3
visph, I often think that about Cheesy's posts. They're quite cheesy. I wonder if it's a coder testing a chatbot.
15th Jun 2017, 9:09 AM
Jamie
Jamie - avatar
+ 3
[offtopic] @Jamie: you've double posted ;) [/offtopic]
15th Jun 2017, 12:15 PM
visph
visph - avatar
+ 3
Not so grievous itself, all the more if it was a mistake ;) Thanks anyway to have corrected it ^^
15th Jun 2017, 2:08 PM
visph
visph - avatar
+ 2
I use Linux exclusively and Python allows me to write small yet powerful scripts to help me accomplish various tasks. I don't think I'll be getting into "front-end" programming yet anyway and to be honest I like programming the "back-end" apps or scripts lol.
15th Jun 2017, 11:48 AM
Aaron Nelson
Aaron Nelson - avatar
+ 2
Aaron that's a good decision. You'll also benefit from bash (or a more POSIX shell) scripting after python. It may make life easier for helpers you mention and python syntax has some similarities (not loads, *some*) to bash. Then if you plan on ever doing front-end remember python has *bindings* for just about everything anyway so python will see you through your frontend needs mostly. When you need power, learn C because it'll really help with lower level backend stuff performance wise and because of not depending on python (IIRC quite a few embedded systems don't have python and most Debian children are on 2.7 still) But, yes, one language at a time, definitely. Glad you reached that conclusion and glad this thread was helpful.
15th Jun 2017, 12:12 PM
Jamie
Jamie - avatar
+ 2
Wow... you've retrieve the best answer mark from mine, for a not directly related answer to your original question (more congratulation than information about Python versus C ^^): it doesn't matter so much, but let say it's hard, all the more than @Jamie answer doesn't be totally right: - Bash isn't really an equivalent to Python, as its purpose is mainly to automatize external tasks/commands launching - Debian provide Python2.7 as well as Python3.x besides, and it's just a question of time before ecosystem of Python scripts will be mostly on 3.x than on 2.7
15th Jun 2017, 2:02 PM
visph
visph - avatar
+ 2
@visph: Oops, double post removed. This is embarrassing :o I think maybe I tapped "post" too many times since internet is slow where I live and I get frustrated sometimes :( :( * Double frowny face for double posting, lol. About my post, I think you might have misunderstood me. I wasn't saying bash (BASH, I'm lazy too use caps on this new keyboard) was the same as python, I wash saying shell scripting was a useful skill because some smaller systems may not have python or may have older python than 3. There's also the overhead, of course. What I was getting at as one skill to compliment another. As to Debian providing python3, I know it does, but the default /usr/bin/python is 2.7 and changing it to 3 can cause problems. I know the Debian dev specs say to make new code 3 and update existing code from 2.x to 3, but that's going to be a long time still for the update considering how much software we're talking. Stretch (Debian 9) will still default to 2.7 (btw stretch is going to be released in just 2 more days!!! Yaaay!) so we'll have to wait a long time still for the default python to be 3. @Aaron: Great, sounds like you've got all you need then :)
15th Jun 2017, 3:11 PM
Jamie
Jamie - avatar
+ 1
thanks everyone for the answers! I really like Python so I think I'll just work on mastering it instead of jumping into something new.
15th Jun 2017, 11:45 AM
Aaron Nelson
Aaron Nelson - avatar
+ 1
@visph i guess I did by accident. big thumbs. sorry.......
15th Jun 2017, 2:05 PM
Aaron Nelson
Aaron Nelson - avatar
0
@Jaime actually it was because of BASH that I decided to try Python. I'm pretty fluent in BASH but I like the way Python is structured and how the code is syntaxed. Plus it can do some things easier that BASH just can't.
15th Jun 2017, 1:54 PM
Aaron Nelson
Aaron Nelson - avatar