I wish I start coding at the age of ... 4
(image taken from here)
UPDATE: I have this interesting question by one of my blog reader, Riky Lutfi Hamzah, via email : "Sometimes, I find it difficult to focus when learning something, including Python. I am very interested in Python and web development, but when I tried to start, I always tempted by other languages. Is there anything else that you can show to me, of why I have to learn Python? And how to focus on Python technology to developing applications?". I answer this question in the last section of this article. Hope it helps!
After almost half year blogging in this cool Pythonblogs platform, I realize that I never take into account that some visitors maybe a total beginner to Python. Or even, a total beginner in software development in general. I think I am enjoying pouring all my experience in Python and rather neglect the thought, "What happen if persons who are totally new to software development, somehow got stumbled to my blog?". I realize this thought, when in my previous article is the first time I officially talk about what is Python module and Python package: I neglect a very important concepts of Python software development.
If you reading this, chance are that you are in your initial process of trying to master software development in general, or Python software development in particular. I will use this series to publish a very quick article, but still highly practical, that if applied, will help you master this broad topic of software development process. I am not a lecture, got to remind you though. But, I always have this keen interest of trying hard to transfer the passion of developing software and pour all of my gathered knowledge to anyone who have the potential to learn programming.
There will be a general concept of software development for sure. But Python will always be the main programming language being use to demonstrate the discussed concept. Although having said this, I may have a sidebar that talk how other programming language (that I know of) implement it. And, as always, I will make sure that each chapter come with a code example that you can clearly follow and test in your own computer.
Great. What are we waiting for? Let's do this!
What is Programming?
Lets make this simple: "Programming is the act of entering computer instructions, also called code, into a computer program, to make computer able to complete certain tasks".
Computer are dumb machine. Just watch it lay still in your nap, or sit helplessly on top of your desk. If programmers at your computer manufacturer don't enter code into its BIOS memory, it will stay dumb forever. After that, there must be a valid special computer program called operating system --that being developed by group of people or a software company-- installed, to let your computer boot up and able to run your other special purpose computer program. This bold term, is the one that this blog were always talk about: developing our own computer program to do just what we want.
And you know what we call a person that do programming?
What do I Need to Become a Programmer?
First of all, a computer.
No, this is serious. You won't be able to program a computer, when you don't have a computer. That's why this project existed: one laptop per child. You don't necessarily have to own your own computer. You can rent it or borrow it. Or use your school computer. I remember that in 1995, I spare some cash from my petty cash, and use it to rent a computer at my neighbourhod. Back at that time, it was priced at IDR. 1.500/hour (around $1.33/hour). It was fun back there: learning Quick Basic in a 80386 40Mhz computer, with memory capacity around .. 16MB (?). Kids these days will laugh at this computer specs. But really, it still is the the most memorable programming experience I have in my entire life as a professional programmer.
Second, you must posses the eagerness to learn without a nearby teacher.
Today you have the internet. This is your teacher. Or, to be exact, a divine means to get to your teacher. Learn computer programming by autodidact. Taught yourself. Don't be afraid to ask anything in any forums. Yes, there are people who somehow get annoyed by newbie questions, but the one who like to help you are far many. That's why I kinda dislike when someone down vote a questions or answers in StackOverflow: it takes courage to post question or answer.
Third, prepare your computer with related computer program (or also called software) to make you easier in learning computer programming (or also called software development).
We have infinite number of ways to program a computer. Sorry, just an exaggeration. Of course it's finite. But as it keeps growing, we can be sure that as long as the earth still moving, we will always have new ways to program a computer. Remember one thing, at this present time, you can't speak to a computer to program it. So, you can't say, "J.A.R.V.I.S, make me a program to calculate the best way to travel to Asgard" (Sorry, if I have to crush your child hood for this). But, that is _in_the_present_time_. Later, you can learn that we are always trying hard to make computer closer to us, by means of natural language, voice recognition, image recognition and many others.
Before that dream come true, in the mean time you will have to master one in the thousands of programming languages existed to help you program a computer. There are many views of programing languages, but I am going to use the view, that there are high-level programming language and low-level programming language. We are going to program a computer using one in the thousands of high-level programming languages ever existed in the planet.
By the way, in case you were wondering why we use high-level programming language, this is the machine-code to add two numbers and place the result in specific area (register) in a computer (taken from Wikipedia):
000000 00001 00010 00110 00000 100000
Or the more easier way to do that (in assembly):
1 2 3
MOV BX,23 MOV AX,10 ADD BX,AX
And now, this is how we do this in Python programming language (our choosen one):
1 2 3
a = 23 b = 10 c = a + b
From the above example, in term of easy to understand, surely you will choose our beloved Python programming language, right?
PS: there are interesting article on how one can program a computer by voice (but still, it will be translated into a computer programming language, not directly understand by computer)
There are so many ways to answer this question. But one thing I can be sure of is, I can't say, "This is the best programming language. Ever!". Why? It's because I have encountered so many problems in my software development life, and I always have this wisdom to be correct, "The right tool for the right job". There will be cases where Java is the best tool to solve a problem, or C#, or C++, or PHP or even ... Lisp!
But still, I can certainly answer to why I seems to be extensively use Python in my career:
It has low learning curve. Maybe the lowest. Trust me. Even if at the moment you are a total newbie in software development area, just give me some time to publish several articles in Python for Beginner series, and I am sure you will find yourself to be in a great confident in developing your own software.
- It still ranked within the Top Ten programming language in TIOBE index and the most popular programming language in CodeEval.
- What does point #2 implied? Simple: if you are going to get serious in Python, you will find yourself in a much easier way to find a Python job, than it is to find a Delphi job (ever heard of Delphi? ).
My first article in this site does state why I choose Python as a teaching aid. Have a look!
One final important things to discuss in this subsection: who is the creator of Python? Or, the history of Python itself. It was Guido van Rossum, a dutch computer programmer, that gave birth to Python. You can enjoy its historical background of the creation of Python, in his own article about history of Python. I really enjoyed that article!
The Creator of Python
Although Guido is the creator of Python, through out of its history, Python has been attracting many programmers through out the globe. And, nowadays, there are legal foundation specifically founded to ".. promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers.", called Python Software Foundation. Thus, don't worry if someday Guido was hit by a bus (of course we hope not!), we can rest assure that its development will still continue (aah, the acceptance phase..).
Great, How do I Start Programming in Python?
Good question. Go to this download page and download installer that match your operating system. Install it. After that, open your console (either DOS Prompt in Windows or Bash Console in Linux) and follow this guide (I am using Windows 8.1 by the way):
1 2 3 4 5 6 7 8 9 10
C:\Users\Eko Wibowo>python Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AM D64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a = 23 >>> b = 10 >>> c = a + b >>> print(c) 33 >>>
Congratulation! That is your first program in Python!
PS : If you are Windows users and have trouble running Python command, try this StackOverflow Q&A.
You will have plenty coming your way. I will use this series to channel articles designed to help newbie in mastering Python programming language. But, as this site consisted of many article series, you can freely browse them and follow its articles (sigh, I haven't add a better site navigational control in this site).
I know I haven't officially talked about what is Github and why it can help you master software development field, but for the time being, you can follow a public github repository I created specifically for this series: pythonthusiast/python-for-beginner.
Stay tuned for my next articles!
Update: Answers to Article Questions
There are several questions asked in the above question.
First, "How to stay focus in one technology and not get tempted by others?". Set a goal. If you don't have one, well, chance are that you will walk in your path halfway, then get turn around to others before you even begin to have a good grasp in the current technology that you just started to learn. I know, even defining a goal can be somewhat challenging: how to stay disciplined in achieving a goal? I have on tip that prove to be very effective: strive for a job that use technology that you long to master, e.g. Python. Or, if currently you have already have that job, try to implement some or all features to use Python. Decide that it wisely though. Have a look at hourly Python jobs at freelance marketplace such as oDesk, read the job description thoroughly and made that as your target goal in learning Python. Using this approach, you can easily assess your skills. Another way is to follow obediently to a tutorial series (e.g my Flask Bio Application series): starting from the first article and set a goal to finish until the last one.
Second, "Is there anything else that you can show to me, of why I have to learn Python?". I always think in the bigger picture. And I always enthusiast in a technology that can live in diverse environment: desktop, server and mobile. I think I can read your mind: you are thinking of Java. It can live in those environments. And to me, Java is my most prominent skills or, historically speaking, the longest one that have been accompanying me since 1997. We all know that Python lived in desktop and server, but in the recent years, Python is growing toward mobile application as well. Have a look at Kivy for instance. And that, my friends, is one important reason why I pursue my path in Python. This is just too good to be true: being able to develop a great application with so little effort, yet so much power in hand! And I haven't even started with Raspberry Pi!
Previously, I always though that Java have the largest library there available. But as I am diving deep inside Python, I realize that I gotten mesmerized by the same huge library there available in Python world. What does it imply? A great confident in developing any kind of solution for problems being brought by your client.
Lastly, "And how to focus on Python technology to developing applications". Well, don't be . Never stuck yourself in just one technology. Although I work extensively in Python, I will always have a keen interest in another software development platform and will always love when have to work to integrate those technology. You will be a much better software developer when you also master another way to solve the same problem, using a different software development platform.