Recently, I read a couple of blog posts about how they learned Python or just attempted to learn. I commented on the posts, but I feel its a good timing to write about how I learned Python and what I think about how people should learn.
This post might sound very opinionated, and it sure is. Please feel free to respond to my points or add how you learned Python.
Contents
1 tl;dr bullet points
You only need to learn Python with two things:
- Python interactive mode, i.e. $ python
- A good tutorial, the official one is more than enough.
More than these are just creating unnecessary burdens or obstacles on your learning course, interference, and confusions. Beside the tools, you also need to have:
- Sense of logic
- Mathematics: algebra (minimum)
- Reading skill
- Patience
Keep simple and essential.
2 How I learned?
If I recall correctly, I began in 2006, the time around Python 2.3 or 2.4. I was still a Windows user back then, so I actually learned Python on Windows and even coded and packaged a program for using with iTunes.
When I started, I simply picked one tutorial after installed Python. I sat down and spent an entire day reading the tutorial and thats how I learned Python.
You dont need any fancy IDE, you dont need to sign up any classes. The only things you need are listed in previous section, plus little time and patience.
Python is a great programming language, its worth learning if you can code. I still remember when I first read about its list comprehension syntax, I was so amazed by it.
3 Not everyone can code
First of all, everyone should realize that not everyone can code. Its good that someone wants to learn about programming, but its just not a thing for everyone.
I dont understand why other programmers and organizations think everyone can code, even believe that there was a need for that. I believe there is even a term like code literacy
Its just terrible idea to establish. Coding is just like an art or any profession. Not everyone has the gene in their blood.
If you cant code, then you cant. If someone cant code, then they just cant code. Dont try to push it. Lots of bad coders around, who are just better off coding once and for all. I am quite glad Python doesnt seem to have those bad coders as many as PHP and JavaScript have.
I sometimes blame television show for faking computer scenes, those make people think coding is just as how they look on television. Let me tell you this: those are 100% rubbish, nothing is even real. Yes, they look cool, but just a scene pieced with fake stuff.
4 Why no IDE
I strongly recommend not learning Python or any programming language with an IDE. Why?
- Because you need to learn syntax right first.
- Because you dont need an IDE to tell you about function arguments when you are just a beginner.
Follow tutorial, read every word. Once you know how to code in correct syntax, then you can think about IDE if you really need one.
If you use IDE, you may not even think about reading any manuals, but just pull in whatever IDE gives you, and thats when a land mine might slip into your code because you simply dont know entirely what you put into your code.
Learning with IDE can give you a false sense about the language, and possibly blind you. IDE is a nice tool, but only after you have learned the programming language.
5 Library Reference
When I code in Python, the only extra tool I have is Vim while coding. Nothing else, no IDE, no debugger, no completions. So, how do I know how to use a library? I check up the reference manual.
Pythons documentation is a bit different, it might take you a moment to get used to them. But once you are familiar with its flow and typesetting, it becomes very easy. Reading descriptive text about arguments is quite enjoyable.
Years ago, almost two decades ago, I had printed Reference manuals of Delphi. Several heavy books, I read them, function by function, VCL by VCL, it was a fun time. I also read ECMAScript standard specification, you can learn quite something from reading specification, even its quite technical.
Reading is important just like everything.
6 Be patient
If you want to be a good programmer, then be patient, or just dont bother trying to learn codingand anything.
From time to time, I saw really scary code and whoever coded the piece wasnt even aware of how terrible the code is. You can tell by just reading the code that the person hadnt even gone through any tutorial.
Some like
- cant even write in correct syntax
- cant even use print statement (Python 2) right
- incorrectly indent the code, not meaning PEP 8 by any means, it just adds space at wrong place
- use eval when there is absolutely no need for that
- worst of all: typo
Simple typo and doesnt even bother to search the error message. If they do, the search engine probably have corrected for them.
I cant understand the frustration for new learners, but sometimes its just simple mistake. Cool you ahead and review everything. If you have done right, thats learn the correct syntax first, most of time, you wouldnt have any problems.
Be patient, learn the syntax right first and only once.
7 Closing words
I agree that Python is easy to learn, but that also means its easy to make mistakes when you are careless.
Lots of people dont even know about basic things, and produce awful codes while believing they have achived something. Recently, Ive tried to point out for them potitely without sounding over judgemental, but I actually want to tell them: Go back and read through the tutorial.
Try to learn Python at once.
0 comments:
Post a Comment