Programming will never be “easy”

Programming will never be “easy”

編程真的容易嗎?

你認爲呢?

程序固然不難,難的是行業邏輯

 

原文:http://mdmstudios.wordpress.com/2010/08/28/programming-will-never-be-easy/

 

There seems to be this idea going around the internet that the reason someone isn’t able to program, is because languages aren’t good enough yet. A couple of people I have seen with have gone so far as to insinuate that the reason programming is to hard for most people, is because we design our languages to be too hard, just to keep people away from programming, and to secure our jobs. In reality, programmers are not trying to make their jobs harder, they are constantly trying to make their jobs easier. The truth of the matter is, programming is just hard.

Some people argue our current languages are too cryptic, other people argue that we need to abandon text-based languages all together, and just use GUI languages. What people don’t realize, is if GUI languages were actually easier, everyone would understand electrical engineering. Most people don’t understand electrical engineering, not because they don’t understand how to connect wires, but because they don’t understand the logic, math, and general engineering behind it.

As for the argument that programming languages are too cryptic, this is just a misunderstanding of what people really want. What people really want, is magic. So is an easy programming language impossible? No. Programming languages have plenty of room to get easier, and to evolve, however the act of programming itself, will never truly be easy, unless you are doing the most basic of tasks.

So just for amusement, what would the easiest programming language look like? Lets say we want to create a window with a table view that adds entries when someone clicks a button. What people would like, is to have a language that would understand some message such as

“Create a window with a table view, and then when someone clicks a button, add an entry to the table view”

While in theory its fully possible to parse a fully human-language, and then generate intermediate code based off of that, in reality, we don’t have that type of technology quite yet, as well as there isn’t near enough information given. What style of window? Initial position? Color? What about the table view? What type of data are the entries storing? How does the user interact directly with the table-view? What about menu items?

Also, what happens if we create two windows? How do we address first one, then address the second one? Well, we have to have some sort of variable naming convention, such as “Create a window named window1” wait, that’s going to be a challenge for the parser to interpret, are we naming the window window1, or are we setting a variable called window1? Lets redefine our variable definition syntax. “Create a window with title ‘Window 1’ and variable name wnd1”. Rather wordy, and already this language is getting complex.

What if we need to do something complex on an engineering level, such as create a scheduler? We can’t just go “Create a scheduler”, we have to figure out how its going to tie in the system, and fully understand the outcome of the code we write, as well as the internal code. So we’d have to describe every variable creation, and every action, to extreme details. It’d be easier to do it in a standard programming language, quite arguably.

All of this is not to say trying to advance programming languages is a bad idea, I’m just trying to explain, no matter how easy the programming language is, if you don’t understand the logic behind the code, you won’t be able to write it in any language.

 

譯文: http://sd.csdn.net/a/20100913/279351.html

操作系統開發工程師mdmstudios曾發表過一篇博文《Programming will never be “easy”》,文中他表示,有些人做不了編程的工作,就抱怨編程語言不夠好,更有甚者說是因爲開發人員把編程語言設計的太難,以便使開發人員的飯碗更安全。而mdmstudios表示真正的原因是:編程本來就是很難。外刊IT評論對本文進行了翻譯,現轉載於此。全文如下:

網上似乎流行着這樣一種說法,認爲有些人之所以做不了編程,是因爲編程語言不夠好。我還看到有一部分人更甚,拐彎抹角的暗示說,編程之所以對大多數人而言很困難,是因爲我們把編程語言設計的太難,讓人們敬而遠之,讓我們這部分的人的飯碗更安全。事實上,程序員可並不想讓自己的工作變的更困難,他們一直在想辦法讓工作更簡單。事情的真正原因是,編程本來就是很難。

有些人議論說現在的編程語言太晦澀難懂,另外一些人說我們應該完全拋棄文本形式的語言,而採用GUI語言(可視化編程語言)。可是人們需要明白,如果GUI語言真的這麼簡單易懂,那是否人們都懂得GUI的電子工程技術呢?大多數人都不懂電子工程技術,這並不是因爲他們不懂得如何去接線,而是因爲他們不懂得邏輯,數學,和其中的基本工程技術。

至於有人說編程語言過於晦澀難懂,這是因爲我們誤解了他們真正想要的東西,他們真正想要的其實是:變戲法。那麼,一種簡單的語言是不可能存在嗎?不。我們的編程語言還有很大的改進空間,需要去進化,然而不論編程語言自身如何改進,編程永遠不會是一個簡單工作,除非你只做一些最基礎的任務。

讓我們來增加一點娛樂效果,最簡單的編程語言應該是什麼樣的?打個比喻,我們需要創建一個windows窗口,裏面有張表單,當有人點擊按鈕時,表單裏就會增加一條記錄。人們想要的就是一種能夠理解像這種信息的語言:

創建一個帶有表單的窗口,當有人點擊按鈕時,往表單裏增加一個條目

雖然理論上完全存在對人類語言進行完整分析的可能,而且以此能立即產生相應的編碼,但現實中,我們還沒有這種技術,而且,我們也沒有獲得足夠的信息支持。什麼樣的窗口?初始位置在哪?顏色?什麼樣的表單?裏面保存什麼樣的數據?用戶如何跟這個表單直接交互?菜單條目有哪些?

同樣,如果創建了兩個這樣的窗口又該怎樣?如何去定位第一個,如何去定位第二個?而且,我們需要有某種的變量命名規範,例如“創建一個叫窗口1的窗口”,等一下,這會讓語法解析器產生困惑,究竟是要創建一個標題爲窗口1的窗口呢,還是要命名窗口變量爲窗口1呢?讓我們來重新定義一下我們的變量定義句法。“創建一個標題爲‘窗口1’的窗口,並把變量名定義爲“窗1”。很咬文嚼字吧,事情已經開始變的複雜了。

如果我們需要去做一個工程上更復雜的,例如創建一個作業調度程序,情況又會怎樣?我們不能只是簡單的說“創建一個作業調度器”,我們需要指出它是如何跟系統結合起來的,完全掌握程序的輸出結果,包括內部代碼。我們必須描述每個變量、每個行爲如何產生,深入細節。說實話,用現在的標準編程語言更容易實現這些,

所有的這些並不是用來說明不需要提升我們的編程語言,我只是想試圖說明,無論編程語言如何的簡化,如果你不懂得代碼背後的邏輯,用任何語言都不可能編出程序。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章