Why Learn Programming?
- To improve job prospects. There are many programming jobs available, although many of them require an alphabet soup of specific expertises. However, there are many jobs which aren’t directly programming, but in which programming will be useful, and even necessary – especially the STEM jobs, such as electronics engineering.
- For fun. Making a machine do stuff for you can be very satisfying. My personal favourite is pretty math pictures such as Mandelbrot sets and harmonographs. If you look at all the FOSS programs available now, I think that most of those were made for fun rather than profit.
- To accomplish some task, such as cataloguing your orchid collection. Even if such a program – or a similar one, say for cataloguing stamps – already exists, you can adapt it to better suit your needs. When we ran our online shop we wrote ‘extensions’ to make OpenCart work the way we wanted. Then we sold them! (We do not endorse OpenCart)
- To help you to better understand the digital age in which we live. Computers are ubiquitous, learning programming and ‘computational thinking’ will greatly help you to understand the possibilities and limitations.
- To improve your logical reasoning. Programming involves logical constructs such as “if (this is true) then do (this thing) otherwise do (that thing)” and “while (this is true) do (this thing)”, and some others. You may be able to use this style of logic to analyse some problem domain, e.g. a business task, at a high level of abstraction.
- To improve your communications with programmers. If you have regular interactions with programmers, e.g. as management, or client, you would then be better able to communicate your instructions or requirements and understand their issues.
Why Python?
I’ve used many programming languages, including Basic, Fortran, C/C++, Java, Perl, PHP, JavaScript, Ruby, and Python. My favourite is Python, because it’s very straightforward and easy to read and write. It’s now one of the most popular programming languages. There are many ‘libraries’ available for it (pre-packaged routines to do common tasks). Just to give a trivial example, compare the following Java and Python programs:
Java:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
Python:
print ("Hello, World")
I’m sure there are good reasons for Java to be so verbose, but the Python style works pretty well too. Now to be fair, as you advance in your programming you might want to write your programs like this:
#!/usr/bin/python3
def main():
print("Hello, World!")
if __name__ == '__main__':
main()
or even like this:
#!/usr/bin/env python3
# This is the HelloWorld class with a single method.
class HelloWorld(object):
@classmethod
def main(cls, args):
print ("Hello, world!")
if __name__ == '__main__':
import sys
HelloWorld.main(sys.argv)