Python 弱掉了!中國工程師開發「文言文 - 工程師

By Franklin
at 2019-12-20T20:52
at 2019-12-20T20:52
Table of Contents
※ [本文轉錄自 Reewalker 信箱]
作者: i19890813 (Duham) 看板: Gossiping
標題: [新聞] Python 弱掉了!中國工程師開發「文言文
時間: Thu Dec 19 13:09:43 2019
1.媒體來源:
techorange
2.記者署名
郭家宏
3.完整新聞標題:
Python 弱掉了!中國工程師開發「文言文程式語言」,讓你的 coding 充滿文學情懷
4.完整新聞內文:
不管是 C 語言、Java 還是 Python,常見的程式語言大多是英文,因此想當個工程師,
一定要有基礎的英文能力(至少要看得懂 if、else、return、float、int 吧)。但你有
想過用中文寫程式嗎?
中國有個 GitHub 帳號為 Lingdong Huang 的工程師,開發了一款「文言文程式語言」,
讓你用文言文寫程式,在萬行程式碼中展現你的人文情懷。
那麼,這款文言文程式語言是什麼神物?
變數定義、for 迴圈全變成了文言文
有個 twitter 帳號為 Barret 李靖 的中國網友轉發了 Lingdong Huang 的文言文程式,
我們以 Barret 李靖貼在 twitter 上的程式碼,帶你了解要怎麼用文言文寫程式。
寫程式前要先定義環境。在文言文的版本中,寫法是:
--
吾有一術。名之曰「快排」。欲行是術。必先得一列。曰「甲」。乃行是術日。
--
這個程式要執行快排的工作,而工程師先為這個程式定義「列」。
寫程式也需要定義變數、行、列名稱等等。文言文的寫法是這樣的:
--
吾有三列。名之曰「首」。曰「頷」。曰「尾」。
--
工程師定義了三個列。
至於 if、else 邏輯與 for 迴圈,文言文是這樣的:
--
凡「甲餘」中之「丁」。
若「丁」小於「甲一」者。
充「首」以「丁」。
若非。
充「尾」以「丁」
也。
云云
--
用「凡」代表 for,「若」代表 if,「若非」代表 else if。不同的是,英文只用大小
括號代表迴圈的運算範圍,而在文言文中,結尾還多了「也」、「云云」,增添一層中華
韻味。
工程師通常會為程式做註解,方便後續的編輯與溝通。文言文的寫法是這樣的:
批曰。「「曼德博集。亦稱曼德布洛特複數集合。複平面上组成分形之點之集合也。」」
英文寫法是打斜線,文言文則是寫「批曰」,有種古人吟詩作對、或是鑑賞畫作時,為他
人的作品寫下評論與簽名的味道。
有興趣的朋友,可以去 GitHub 看看文言文程式語言,試著用文言文寫段程式。
5.完整新聞連結 (或短網址):
https://buzzorange.com/techorange/2019/12/18/coding-in-ancient-chinese/
6.備註:
中國國產程式語言不遠了
--
作者: i19890813 (Duham) 看板: Gossiping
標題: [新聞] Python 弱掉了!中國工程師開發「文言文
時間: Thu Dec 19 13:09:43 2019
1.媒體來源:
techorange
2.記者署名
郭家宏
3.完整新聞標題:
Python 弱掉了!中國工程師開發「文言文程式語言」,讓你的 coding 充滿文學情懷
4.完整新聞內文:
不管是 C 語言、Java 還是 Python,常見的程式語言大多是英文,因此想當個工程師,
一定要有基礎的英文能力(至少要看得懂 if、else、return、float、int 吧)。但你有
想過用中文寫程式嗎?
中國有個 GitHub 帳號為 Lingdong Huang 的工程師,開發了一款「文言文程式語言」,
讓你用文言文寫程式,在萬行程式碼中展現你的人文情懷。
那麼,這款文言文程式語言是什麼神物?
變數定義、for 迴圈全變成了文言文
有個 twitter 帳號為 Barret 李靖 的中國網友轉發了 Lingdong Huang 的文言文程式,
我們以 Barret 李靖貼在 twitter 上的程式碼,帶你了解要怎麼用文言文寫程式。
寫程式前要先定義環境。在文言文的版本中,寫法是:
--
吾有一術。名之曰「快排」。欲行是術。必先得一列。曰「甲」。乃行是術日。
--
這個程式要執行快排的工作,而工程師先為這個程式定義「列」。
寫程式也需要定義變數、行、列名稱等等。文言文的寫法是這樣的:
--
吾有三列。名之曰「首」。曰「頷」。曰「尾」。
--
工程師定義了三個列。
至於 if、else 邏輯與 for 迴圈,文言文是這樣的:
--
凡「甲餘」中之「丁」。
若「丁」小於「甲一」者。
充「首」以「丁」。
若非。
充「尾」以「丁」
也。
云云
--
用「凡」代表 for,「若」代表 if,「若非」代表 else if。不同的是,英文只用大小
括號代表迴圈的運算範圍,而在文言文中,結尾還多了「也」、「云云」,增添一層中華
韻味。
工程師通常會為程式做註解,方便後續的編輯與溝通。文言文的寫法是這樣的:
批曰。「「曼德博集。亦稱曼德布洛特複數集合。複平面上组成分形之點之集合也。」」
英文寫法是打斜線,文言文則是寫「批曰」,有種古人吟詩作對、或是鑑賞畫作時,為他
人的作品寫下評論與簽名的味道。
有興趣的朋友,可以去 GitHub 看看文言文程式語言,試著用文言文寫段程式。
5.完整新聞連結 (或短網址):
https://buzzorange.com/techorange/2019/12/18/coding-in-ancient-chinese/
6.備註:
中國國產程式語言不遠了
--
Tags:
工程師
All Comments

By Yedda
at 2019-12-21T06:30
at 2019-12-21T06:30

By Annie
at 2019-12-21T15:26
at 2019-12-21T15:26

By Cara
at 2019-12-25T22:12
at 2019-12-25T22:12

By Faithe
at 2019-12-26T02:19
at 2019-12-26T02:19

By Blanche
at 2019-12-30T10:38
at 2019-12-30T10:38

By Lauren
at 2019-12-31T10:13
at 2019-12-31T10:13

By Zanna
at 2020-01-05T02:51
at 2020-01-05T02:51

By Lydia
at 2020-01-06T13:04
at 2020-01-06T13:04

By Sierra Rose
at 2020-01-08T14:17
at 2020-01-08T14:17

By Daniel
at 2020-01-10T20:01
at 2020-01-10T20:01

By Erin
at 2020-01-14T15:51
at 2020-01-14T15:51

By Lydia
at 2020-01-18T22:04
at 2020-01-18T22:04

By Dorothy
at 2020-01-19T00:01
at 2020-01-19T00:01

By Callum
at 2020-01-19T17:15
at 2020-01-19T17:15

By Rachel
at 2020-01-24T12:33
at 2020-01-24T12:33

By Jessica
at 2020-01-26T14:24
at 2020-01-26T14:24

By Edith
at 2020-01-28T05:03
at 2020-01-28T05:03

By Belly
at 2020-01-31T02:25
at 2020-01-31T02:25

By Audriana
at 2020-02-04T18:52
at 2020-02-04T18:52

By Harry
at 2020-02-09T09:41
at 2020-02-09T09:41

By Kristin
at 2020-02-10T08:32
at 2020-02-10T08:32

By Doris
at 2020-02-11T01:28
at 2020-02-11T01:28

By Oliver
at 2020-02-12T15:56
at 2020-02-12T15:56

By Franklin
at 2020-02-17T15:09
at 2020-02-17T15:09

By Joseph
at 2020-02-17T23:25
at 2020-02-17T23:25

By Lily
at 2020-02-18T15:02
at 2020-02-18T15:02

By Irma
at 2020-02-20T13:09
at 2020-02-20T13:09

By Sierra Rose
at 2020-02-23T09:56
at 2020-02-23T09:56

By Dora
at 2020-02-28T09:53
at 2020-02-28T09:53

By Oscar
at 2020-03-02T04:37
at 2020-03-02T04:37

By Liam
at 2020-03-03T02:53
at 2020-03-03T02:53

By Poppy
at 2020-03-03T06:55
at 2020-03-03T06:55

By Cara
at 2020-03-04T12:47
at 2020-03-04T12:47

By Joe
at 2020-03-08T20:03
at 2020-03-08T20:03

By Rachel
at 2020-03-12T09:57
at 2020-03-12T09:57

By Bennie
at 2020-03-12T22:29
at 2020-03-12T22:29

By Heather
at 2020-03-13T22:53
at 2020-03-13T22:53

By George
at 2020-03-15T20:06
at 2020-03-15T20:06

By Lauren
at 2020-03-17T21:30
at 2020-03-17T21:30

By Elma
at 2020-03-22T01:25
at 2020-03-22T01:25

By Una
at 2020-03-23T15:24
at 2020-03-23T15:24

By Rachel
at 2020-03-26T01:09
at 2020-03-26T01:09

By Erin
at 2020-03-29T02:18
at 2020-03-29T02:18

By Aaliyah
at 2020-03-29T13:20
at 2020-03-29T13:20

By Adele
at 2020-04-01T20:06
at 2020-04-01T20:06

By Kyle
at 2020-04-05T09:27
at 2020-04-05T09:27

By Yuri
at 2020-04-06T02:38
at 2020-04-06T02:38

By Lauren
at 2020-04-10T06:28
at 2020-04-10T06:28

By Caitlin
at 2020-04-13T08:42
at 2020-04-13T08:42

By Noah
at 2020-04-18T05:09
at 2020-04-18T05:09

By Andrew
at 2020-04-22T17:04
at 2020-04-22T17:04

By Barb Cronin
at 2020-04-24T08:16
at 2020-04-24T08:16

By Necoo
at 2020-04-28T08:15
at 2020-04-28T08:15

By Tracy
at 2020-04-30T08:05
at 2020-04-30T08:05

By Kyle
at 2020-04-30T19:30
at 2020-04-30T19:30

By Christine
at 2020-05-02T23:00
at 2020-05-02T23:00

By Genevieve
at 2020-05-06T09:01
at 2020-05-06T09:01

By Eartha
at 2020-05-08T16:40
at 2020-05-08T16:40

By Gary
at 2020-05-12T16:05
at 2020-05-12T16:05

By Connor
at 2020-05-17T13:10
at 2020-05-17T13:10

By Tracy
at 2020-05-20T02:41
at 2020-05-20T02:41

By Edward Lewis
at 2020-05-23T12:54
at 2020-05-23T12:54

By Liam
at 2020-05-27T08:40
at 2020-05-27T08:40

By Poppy
at 2020-05-27T10:23
at 2020-05-27T10:23

By Olive
at 2020-05-28T04:23
at 2020-05-28T04:23

By Jack
at 2020-05-28T11:53
at 2020-05-28T11:53

By Rosalind
at 2020-05-29T10:59
at 2020-05-29T10:59

By John
at 2020-05-29T13:53
at 2020-05-29T13:53

By Hamiltion
at 2020-05-30T22:09
at 2020-05-30T22:09

By Tracy
at 2020-06-02T14:52
at 2020-06-02T14:52

By Robert
at 2020-06-03T20:59
at 2020-06-03T20:59

By George
at 2020-06-07T03:53
at 2020-06-07T03:53

By James
at 2020-06-10T06:42
at 2020-06-10T06:42

By Donna
at 2020-06-11T05:35
at 2020-06-11T05:35

By Ina
at 2020-06-11T16:34
at 2020-06-11T16:34

By Liam
at 2020-06-14T18:55
at 2020-06-14T18:55

By Poppy
at 2020-06-18T03:52
at 2020-06-18T03:52

By Tracy
at 2020-06-22T03:37
at 2020-06-22T03:37

By Frederica
at 2020-06-26T03:00
at 2020-06-26T03:00

By Callum
at 2020-06-30T07:54
at 2020-06-30T07:54

By Harry
at 2020-07-03T22:10
at 2020-07-03T22:10

By Edwina
at 2020-07-05T09:33
at 2020-07-05T09:33

By Annie
at 2020-07-09T05:35
at 2020-07-09T05:35

By David
at 2020-07-09T20:32
at 2020-07-09T20:32

By Freda
at 2020-07-12T05:34
at 2020-07-12T05:34

By Gary
at 2020-07-17T03:24
at 2020-07-17T03:24

By Aaliyah
at 2020-07-20T13:28
at 2020-07-20T13:28

By Barb Cronin
at 2020-07-23T04:07
at 2020-07-23T04:07

By Una
at 2020-07-24T12:39
at 2020-07-24T12:39

By Mary
at 2020-07-26T00:32
at 2020-07-26T00:32

By Xanthe
at 2020-07-29T09:35
at 2020-07-29T09:35

By Suhail Hany
at 2020-07-31T18:49
at 2020-07-31T18:49

By Daniel
at 2020-08-01T21:50
at 2020-08-01T21:50

By Michael
at 2020-08-04T02:20
at 2020-08-04T02:20

By Joe
at 2020-08-07T07:32
at 2020-08-07T07:32

By Elizabeth
at 2020-08-11T12:06
at 2020-08-11T12:06

By Emma
at 2020-08-15T16:41
at 2020-08-15T16:41

By Kumar
at 2020-08-19T20:57
at 2020-08-19T20:57

By Catherine
at 2020-08-20T04:26
at 2020-08-20T04:26

By Zanna
at 2020-08-23T16:37
at 2020-08-23T16:37

By Susan
at 2020-08-25T09:16
at 2020-08-25T09:16

By Jake
at 2020-08-27T05:51
at 2020-08-27T05:51

By Ida
at 2020-08-29T00:11
at 2020-08-29T00:11

By Kyle
at 2020-08-29T14:01
at 2020-08-29T14:01

By Daph Bay
at 2020-09-02T04:49
at 2020-09-02T04:49

By Annie
at 2020-09-06T09:40
at 2020-09-06T09:40

By Caitlin
at 2020-09-09T01:41
at 2020-09-09T01:41

By Regina
at 2020-09-11T09:24
at 2020-09-11T09:24

By Frederic
at 2020-09-13T11:48
at 2020-09-13T11:48

By Tom
at 2020-09-18T02:12
at 2020-09-18T02:12

By Hardy
at 2020-09-19T09:09
at 2020-09-19T09:09

By Kristin
at 2020-09-22T17:33
at 2020-09-22T17:33

By Oliver
at 2020-09-27T08:26
at 2020-09-27T08:26

By Gilbert
at 2020-09-30T06:28
at 2020-09-30T06:28

By Elizabeth
at 2020-10-01T21:12
at 2020-10-01T21:12

By Eden
at 2020-10-04T16:07
at 2020-10-04T16:07

By Una
at 2020-10-09T04:22
at 2020-10-09T04:22

By Elizabeth
at 2020-10-09T19:43
at 2020-10-09T19:43

By Delia
at 2020-10-12T08:11
at 2020-10-12T08:11

By Jacob
at 2020-10-13T17:37
at 2020-10-13T17:37

By Jacky
at 2020-10-14T05:58
at 2020-10-14T05:58
Related Posts
有不限科系的工程師嗎?

By Bennie
at 2019-12-20T19:31
at 2019-12-20T19:31
大家的公司會有統一集合式的新生訓練嗎?

By William
at 2019-12-20T19:21
at 2019-12-20T19:21
輪班設備工程師的未來發展

By Quanna
at 2019-12-20T16:52
at 2019-12-20T16:52
年薪破5百萬!亞馬遜正妹工程師曝9優

By Lucy
at 2019-12-20T15:21
at 2019-12-20T15:21
新思不玩亞洲TDDI,外資憂聯詠、敦泰受波

By Liam
at 2019-12-20T14:34
at 2019-12-20T14:34