May, 27, 2021

為甚麼90%的Python 自學者半途而廢

Python 學習之路的四個階段和陷阱

Blog - How to learn python in a correct way

學習寫程式不容易,尤其是自學。這不是有沒有天份的問題。自學編程,最難的地方在於過程中充滿陷阱,如果沒有適當指導,會令人走不少冤枉路。我很清楚當中的難關,因為當初我就是一個自學者。我還記得當初走過的冤枉路,還有當時有幾無助。所以當我聽說只有4%的學生能完成網上課程,我一點都不意外。

 

接下來,我會和你分享我自學Python的經驗。我把自學過程大致上分成四個階段:蜜月期、幻滅期、曙光期、成熟期。每個階段的陷阱和心態都不一樣。

 

一開始的數小時:蜜月期

一開始的數小時是整個過程裏最爽的一個階段,你會學到Python的基本概念和語法。正常的導師還會介紹Python的用途,包括數據科學、程式交易、軟件開發之類。由於一開始內容比較簡單,很容易會有種幻覺是自己很快便會成為無所不能的黑客。對,我就這樣幻想的。

 

10至30小時:幻滅期

我記得我在收到第一份功課後幻想就破滅了,感覺就似我不會游水但被拋落水。雖然頭幾個小時學過基本語法,但對如何將這些部件組裝起來卻完全沒有概念。最恐佈的是,你會人生第一次見到bug,而且你整個編程生涯將會無法擺脫它。編程是一種偏執狂運動,它要求準確到極致;只要稍有錯誤你的程式就不運行。但是一個初學者面對bug會好無助。

 

當我做第一份Python功課時我感覺好絕望。其實我對課程無任何不滿,老師是MIT 的老教授,講解得非常好。但我最後花了幾日時間去除一個bug:我攪混了space同tab。如果你對Python有所了解,你就會知道在Python的語法裏四個space等於一個tab,但原來它們不可以混合使用。

 

我嘗試了好幾個方法去求救。我上論壇去問同學,又去找助教。不過,我製造問題的速度永遠超過助教能應付的程度。而且我是網課學生,助教自然不會很熱心。

 

30至50小時:曙光期

當你平安渡過幻滅期,前面就是曙光。你會開始感覺到之前所學的部件如何組成一個程式,就好像一切東西忽然有了意義。而且,你會明白之前學的一大堆語法,為何非學不可。這個階段的目標不僅是吸收更多知識,還有是累積實戰經驗。一旦成功運用Python解決到一兩個真實世界的問題,你就能夠建立自信和累積以後自學所必需要的資源。

 

聽上去很簡單,實際上這個階段同樣不好過。關鍵是之前兩個階段都是在温室裏學習,功課是預先設計好的。然而,真實世界充滿不確定性。例如,很多時候寫一個Python 函數,因為真實場景裏函數有可能要面對很多怪異的輸入,導致它未必會如你預想般正常運作。

 

我第一個真正有用的作品是一個自動從某網站下載檔案的程式。可惜,它在下載數千個檔案後崩壞了。當時我始終想不通原因,因為既然它已經下載了數千個檔案,證明它至少可以運作吧。最後,我終於發現問題所在:因為下載太多,我被網站封鎖了。我經過幾個星期後才想通這一點,因為有日剛好我銀行帳戶登入太多次被封了。

 

50小時後:成熟期

最後,你會到達成熟期。在過五關斬六將後,你終於有足夠自信熟練地用Python 寫程式。當然,Python 的世界很大,這一刻你可能還有99%的領域未開拓。然而,你已經知道當有問題時,怎樣去克服技術上的困難。你知道怎樣找技術問題的討論和答案,你也知道怎樣閱讀官方文檔,知道怎樣利用工具去除錯、測試等,知道怎樣理解程式的錯誤訊息。路還很長,但Python開發者去到這個階段,就能自己走下去。至於走到多遠就看各人的修行。

 

 

怎麼辦

我希望你沒有被嚇到,我之所以寫這篇文,是因為所有這些困難都有方法克服:

 

  1. 組團一齊學:找一班想學的人一齊學。你會節省超多糾結的時間
  2. 找一個老手:最好找一個老手帶一帶你。他不一定是一個專家,但他可能只需幾秒就解決到困擾你幾日的問題
  3. 設立目標:找一個你感興趣的領域,並圍繞這個領域去學。例如你想寫一個自動交易系統,就以這目標去倒推你需要學甚麼編程技能

 

當然,你亦可以報讀MasterPython設計的課程。MasterPython 的課程讓你跨過幻滅期,大大縮短你要走的冤枉路。課程內容亦包括實戰項目,使你累積真實場景的經驗。我們的目標是每一個學生都能到達成熟期,並盡量消滅途中的陣痛。

6 reasons to learn python

Why learn Python?

01.

Top 1 language

Ranked as the most popular programming language in the world. It means it is most needed.

02.

Easy to Learn & Friendly

Python is designed for easy understanding and it reads like plain English.

03.

Shortcut to Tech World

Learning Python as your first coding language can be the easiest step to get into the Tech World.
04.

Code for AI & Analytics

Python is like the default language for AI & Analytics as most related tools are in Python.

05.

Multi-purpose Language

Python is a general-purpose language, which means that it can be used to build about anything.

06.

High Demand for Jobs

From the Developer Survey, Python was one of the most in-demand languages in recent years.

Why MasterPython?

Our In-person courses are For all the beginners who want to get into tech world

“Why it doesn’t work?”, “It’s another Error Message and I don’t understand…” There are too many pitfalls at the start of learning a programming language. We know how difficult it is to learn Python without any help when you do it completely online, that’s why we tailor all of our course in in-person setting to help you pass through the hardest part in your learning journey – the Learning Threshold.

Why MasterPython? Best Python Courses in Hong Kong & Singapore

Advantages of Our In-Person Courses

01.

Walk you through the learning threshold

Everybody needs help at the beginning, especially for programming. Our in-person courses are deliberately designed to make your success easy by walking you through the learning threshold.

02.

Learn, Checkpoint, Apply - We make it engaging

Effective learning is a systematic process. Learn – to absorb new knowledge. Checkpoint – to check if you fully get it. Apply – to ensure you can put it into practice. Engaging learning starts here.

03.

Ask your Questions in class, get clear as you progress

It is not unusual to spend a couple of hours just on solving one little error in Python when you just start learning, and that’s really discouraging. That’s why we are here in class to answer your questions to make sure you progress.

MasterPython helps you pass through the Learning Threshold - Best Python Courses in Hong Kong & Singapore
Walk you through the learning Threshold with us.
Disadvantages of Learning your first programming language online