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”。很咬文嚼字吧,事情已经开始变的复杂了。

如果我们需要去做一个工程上更复杂的,例如创建一个作业调度程序,情况又会怎样?我们不能只是简单的说“创建一个作业调度器”,我们需要指出它是如何跟系统结合起来的,完全掌握程序的输出结果,包括内部代码。我们必须描述每个变量、每个行为如何产生,深入细节。说实话,用现在的标准编程语言更容易实现这些,

所有的这些并不是用来说明不需要提升我们的编程语言,我只是想试图说明,无论编程语言如何的简化,如果你不懂得代码背后的逻辑,用任何语言都不可能编出程序。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值