Where to Start? (C vs Python) Part 2

Libraries and Programming Concepts

The plethora of libraries available for Python is one of its very big advantage. You can find a library for almost anything that you want to do with Python, be it reading an excel file to extract data or plotting your data on a 3d animated graph. This extensive list of libraries is the reason why programs in Python are so short when compared to other languages. While this is very helpful and time-saving for a programmer, in my opinion, the use of a dedicated library for every single task hides the actual mechanism of computer programming and makes it seem almost like magical. C supports libraries as well, and being so old there are numerous libraries available for it, but C as a language does not emphasize the use of ready-made libraries. This is where the minimalism of C shows up, when you learn C, you are only concerned with a few libraries that provide the basic operations needed, and everything else can be done using the basic libraries although with more effort than Python. It should also be noted that while Python does have hundreds of libraries, sometimes you do need to spend time digging up the right library for you and reading the documentation to understand how the library is meant to be used.

While it is relatively easy to avoid complicated programming concepts such as memory management and pointers when using Python because it does everything for you, if you want to use C, you cannot run from such stuff. This in a way also highlights the different levels of understanding of actual computer programming that you can get by learning these languages. Python is a high level languages, which means that you do not need to worry about the computer hardware itself for the most part. C on the other hand, is somewhere between a high level language and a low level language like Assembly which is totally dependent on the computer hardware you are using. This does not necessarily mean you need to do all the low level stuff in C for every scenario, but C does allow you to do it if you need, in fact, C allows you to directly use Assembly code as part of a C program. Having all these capabilities, C is obviously much more powerful and faster than Python.

Which language is the best to start with?

Think of this scenario, while it’s true that Python has libraries for almost anything you need, what if you find yourself working with a problem that requires something new and there isn’t a library available? Learning to program in Python does not necessarily teach you to deal with such a situation. In C, you would make your own library for whatever you need, and this is true in Python as well, but you should know that a lot of the libraries in Python are also partly written in C because Python just does not give you the freedom to do something out of the norm, and this is the biggest weakness of Python in my view. As an analogy, Python is like a fancy calculator, while C is the mathematics itself. If all you need to do is general computations, it is much easier to learn and use the calculator. You don’t even need to understand the mathematics behind it if you just learn which buttons to press for your needs, but what happens if someday  you need to do an operation that the calculator does not support? If all you did was learn to use the calculator, you will feel lost and helpless, because you don’t really understand what is actually going on inside the calculator.

So to answer the question, it really depends on what you want to do with it. If you need a language to do general stuff without spending too much time understanding programming concepts then Python is the way, and it is a very efficient at that. However, if you truly want to understand how computer programming works, and want to have the freedom to be able to just build whatever tools you need, then C is the way to go. In my opinion though, there is a middle ground where you start off with C, learn the basic programming concepts and then just move to Python for its practicality in general-purpose scenarios. Once you understand a language like C, moving to other languages is almost as easy as understanding a new syntax and some basic functionality that is exclusive to the language itself. It is also possible to start with Python and then learn a language like C later if you need to, and this path will surely make C a little easier to learn, but if you expect that you will eventually need to move on to C, then its best to start off with it.

Bottom line, Python allows you to start coding and do some “cool stuff” without having to spend time understanding the very science of programming. On the other hand, C will let you start creating meaningful programs while leveling up your programming understanding and learning experience, but this would entail hardwork and a lot of time spent studying.

Mr Panda

Advertisements

3 thoughts on “Where to Start? (C vs Python) Part 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s