Yeah I want to learn computer programming and I’ve stated teaching myself Python but I’m not sure if thats the best program to start out on or not. So yeah plz help me
This question is asked quite a bit and the majority of people answer with a C language. There are definite benefits from learning c / c++ first due to the syntax being similar to java and because it is so widely used, but I would still vouch for Python as the best language for someone who has no prior programming experience.
The cons of Python are pretty clear:
Unless you’re an avid unix/linux user, you aren’t going to run into it very often. (note that you can use Python on Windows)
The syntax isn’t all that similar to other languages.
It’s not used as frequently as c / c++.
It’s more resource intensive than c / c++.
The nice part about python is that it’s an easy to learn language. You only need to take in a few concepts at a time, and having experience with the general concepts an OO language like Python will help you in learning another OO language like c or c++.
I like to use the ‘hello world’ example to make the point. Here is ‘hello world’ in c++:
—-
#include <iostream>
using namespace std;
int main()
{
cout << ‘hello world’ << endl;
return 0;
}
—-
In this simple program, there are several concepts that you would need to understand. like #include (and certain compilers have mandatory includes which can be problematic if you are new). You need to be aware of namespaces, functions, cout, endl, strings, returns, bracket and semicolon usage, etc. It’s alot to take in if you have never dealt with it before. Also, the difficult syntax results in poor readability to the new user, which can result in bad programming habits like excessive nesting and overly complex implementations. As a final note on c++, you will have to put up with the nuisances of forward calling or the painstaking debugging the first time you learn about / experience overflowing buffers and the way c++ rounds numbers.
Now for ‘hello world’ in Python:
—-
print ‘hello world’
—-
That’s much less of an eyesore. There are 2 concepts: 1) the print command, and 2) strings. Plus, even if you had absolutely no knowledge of Python, you have an idea of what this program actually does. Readability is a major pro.
====
In all, I’d at least take a look at c / c++. If you have trouble with it or if you simply have time and want to learn in more casual sessions, Python is a great choice.