软件复杂度是什么

作者: 网络工程  发布:2019-09-06

最让自家吃惊的不是复杂度是哪些,而是复杂度概念有温馨的适用范围。

Is software programming going to become a necessary skill for everyone in the future, like reading and writing? Will programming become mainstream?

图片 1Brian Kernighan

The human-computer symbiosis

因为就如是从早到晚挂在嘴边的话,反倒没去稳重推究过,根据wiki的解释:

We could still define computer as a tool, an extension of our body and mind, but it is a tool that makes its way into every aspect of our lives. We spent increasingly more waking hours interacting with them than with our peers. Imagine some aliens visiting earth, if they cannot comprehend the difference between life and machine, they may very well believe humans are slaves of computers, and for good reasons.

Programming complexity (or software complexity) is a term that encompasses numerous properties of a piece of software, all of which affect internal interactions. According to several commentators, there is a distinction between the terms complex and complicated. Complicated implies being difficult to understand but with time and effort, ultimately knowable. Complex, on the other hand, describes the interactions between a number of entities. As the number of entities increases, the number of interactions between them would increase exponentially, and it would get to a point where it would be impossible to know and understand all of them. Similarly, higher levels of complexity in software increase the risk of unintentionally interfering with interactions and so increases the chance of introducing defects when making changes.

So I would call it a human-computer symbiosis. To be an effective person in this society, you have to understand how to communicate with computers as well as other human beings. In this sense, the ability to use computers is as important as talking, reading and writing.

程序复杂度是对软件内部繁多震慑内部关系关系的属性的陈诉。软件的复杂度介于complex(像讲混沌理论的《复杂》那本书中的复杂)和complicated之间:complicated是指事物难以通晓但以丰盛的大力和知识最终是可分晓的,complex描述事物内部实体的涉及关系、随着实体数量的扩充最终不可能被完全知道。即软件的高复杂度导致增添无意的涉嫌关系的高风险,最后在做改变的时候更易于引进破绽。在更极致的意况下,软件复杂到差不离无法修改。

But right now, most of communication with computers is one-way: people get information from these devices. People do write, draw and make stuff on computers, but in these cases, the intended audience is other human beings. Most people just don't talk directly to their computers, other than simple mouse clicks and taps on a touchscreen.

The idea of linking software complexity to the maintainability of the software has been explored extensively by Professor Manny Lehman, who developed his Laws of Software Evolution from his research. He and his co-Author Les Belady explored numerous possible Software Metrics in their oft cited book,[1]that could be used to measure the state of the software, eventually reaching the conclusion that the only practical solution would be to use one that uses deterministic complexity models.

But there is a group of people who do just that for a living: programmers. They talk to computers every day, sending commands and directions to them, asking them to finish certain tasks. And they wrap these commands into packages called software and distribute them to others, so everyone could use these to effectively talk to computers. Programmers are like translators between human and computer.

软件复杂度最初是在Manny Lehman教授的软件演进法规中提议的,他还提议了过多沿用至今的衡量软件的指标。

To live comfortably in a foreign country, you cannot rely on a translator, you need to learn the local language. Similarly, if you can write programs, when you need computer to perform a specific task, and no single piece of available software can fulfill your need, you can write it yourself.

比起Lehman教师的原理和每行bug数等他提的这个衡量软件的指标:

So, theoretically, everyone should learn how to write computer programs. But the real world is never that simple.

图片 2Lehman's Law

Citizen Programmer

作为一名严俊的地农学家,Lehman法则也即软件复杂度的适用范围确最让自己大惊失色:

There are schools of thoughts on whether we should consider programming as a necessary skill for average citizen. I believe it will become more of a necessity over time.

In his 1980 article,[1]Lehman qualified the application of such laws by distinguishing between three categories of software:An S-program is written according to an exact specification of what that program can doA P-program is written to implement certain procedures that completely determine what the program can do (the example mentioned is a program to play chess)An E-program is written to perform some real-world activity; how it should behave is strongly linked to the environment in which it runs, and such a program needs to adapt to varying requirements and circumstances in that environmentThe laws are said to apply only to the last category of systems.

Today most people don't have a problem using software written by other people (and for free). The exisitng software seems to give them everything they need, and some more. There are surely some pain points, but mostly people just accept the status quo, or expect professionals (programmers) to solve the problems for them. They don't have a strong urge to get involved in the mysterious business of programming. Software business works because the products capture this most common need of users [6]. But as computing seeps into every aspect of human lives, people start to have very customized requirements that exisitng software just fail to satisfy. In business world, requirements of customization for a particular company keep software consulting alive, but this will increasingly happen on a personal level as well. Yet it is hard to imagine people hiring programmers to write software just for her alone. Instead, the more logical prediction is that she will learn to write programs. Programming is currently a professional skill, but it doesn't have to stay that way. I think personalized software requirements (the long tail) will drive people to start writing code, especially when they find out programming is not that hard, and getting eaiser [7].

软件复杂度只适用于E-type型的软件,也即与具体世界打交道的这部分软件或有个别软件中的对应此部分

The storm is coming

假设将三个类别的代码分为项目标开垦者本身维护的代码和应用的别的库、操作系统接口、别的外界接口,还会有三个品类提需要外界其余人使用和调用的接口部分,全体与这么些其余东西打交道的率先就自然是内需思量复杂度的。

And there is another driving force. Software is eating the world. More and more human endeavers are being replaced by software. Software, an invisible force, looks everywhere for jobs that can be defined with fixed rules and processes, and do those jobs more efficiently and cost-effectively with code. People's jobs will be replaced by computers. And once that happens on a large scale, people will realize that the best strategy is not to fight this force, but to cooperate with it. In other words, people will start writing code to automate their own jobs. I thinks this is already happening in U.S, codeacademy, a website teaching average people how to write programs, got 1 million users in

附带全体完毕的是具体世界的人(产品主管、客户、本人)的心愿,而还未成为一个SPEC的一部分也都以急需考虑复杂度的。也即代码成为了末了愿望的表述,并非先有SPEC作为发挥,代码只是达成之,那么正是S和P类型了。

  1. It's a signal that people smells the storm coming and get prepared.

--那犹如也与《代码大全》中提议的软件技术员到底是技术员照旧技术职业的争论嵌合,《代码大全》中感觉古板中分别程序猿与技术事业是程序猿不造作最后顾客供给的标的程序员只现出图纸,程序员的产出是图片并非东西,但在软件行当,代码就是观念也是成品,就是图纸也是实物,软件技术员就是技术专业也是程序员,软件独有一份图纸也即代码自个儿。

It’s no wonder so many people are buying into learn-to-code campaigns. The technology industry is where the jobs are.

而那个可以一定为SPEC,与以贰个SPEC交互的代码,是不适合复杂度规律,大概从概念上来讲,是绝非复杂度的!

Besides, there is just more data generated every second, thus more software is needed to make sense of those data. Up to now, most data we see are generated by human beings (text, numbers, images, etc). From the computers' perspective, human beings are very low-bandwidth input devices. But now computers are generating oceans of data from sensors on mobile and various embeded devices. There will be overwhelming amounts of data for us to process, and we cannot do it without the help of software.

--从《代码大全》的对程序猿和工友的分化看,也即出现此能完好表达的SPEC者是为技术员(即使小编恶意的存疑其实对绝大大多软件的对象来讲,世界上一纸空文那样的SPEC),达成者视为工人。而《代码大全》的下结论以为软件程序员不可能区分工人与工程师。

Keep it simple, stupid

初看十分振撼,细细揣摩并无道理。那个代码本质上正是二个SPEC的消息的切实可行落实,他从未复杂度定义中的complex和complicated,像举个例子的国际象棋的平整,他们既是已经被反映为三个分明的已存在的SPEC在先,那她不也许complex到十分的小概清楚,也即不须要复杂度管理。不过思虑实现国际象棋法则又就像是足以再分为两部分?

On the other hand, programming is getting easier. Writing programs used to be very hard, a skill that some high IQ folks take extensive training to master. It used to look more like rocket science than like writing essays. Now it's different. The evolution of programming languages, and the open source movement enable most people to get engaged in this game with very little effort.

那让自家对有关难点的掌握都有了刷新,后来看了InfoQ刚出的那本《谈谈架构》中等教育授单元测量试验时候对代码实行分类,感觉测量试验是测业务测完成,而实际不是去测跟境况打交道的代码,两个应该能清楚的差别,进而在最完善的景况下单元测验应该完全没有必要mock,mock是系统一测验试的时候才须要的事物。

If there is one rule of natural selection in software world, I think it is simplicity. If you look at the evolution of programming languages, you can see the pattern: In assembly, you have to understand the concept of registers; In C, registers are gone, but you have to manage memory and deal with pointers, which remind you that you are still operating a machine; then garbage collection comes around in Java, and pointers are abstracted away (objects, references); with scripting languages like python, programs are literally very close to natural languages [1]. There were some missteps where stuff get complicated, like classical inheritance, COM, C++ templates and design patterns [2]. But these complexities generally become irrelevant over time, because they add friction to coding. That's why Javascript wins in the end as a ubiquitous language. Not only because it is the de facto standard in web browsers, but also because it is very, very simple: it gets rid of the class hierachy/inheritance nonsense, which is constant headache for programmers. And I believe programming languages and tools will continue to evolve. It can become more tolerant of ambiguity; or may take diagrams instead of text as input; there are a lot of ways to make it easier to learn. IFTTT is taking a very promising direction here.

从那么些S,P,E的角度看,还可作出比相当多新的分类,对广大难点有了四个新的见解,可以有一个泛化的新的思路。

The other reason programming gets easier is, the human kind has amassed a lot of working code over the years [3]. Thanks to open source movement, these code are available for everyone. For a lot of projects today, programming is more about integration than about writing original code. Sometimes you just need to duct-tape and wire existing pieces together to make a new piece. Actually,duct-tape programmerstend to be great programmers, too.

姑且打住,今后再思索。

LightTable [8] is a very promising IDE that makes coding much more visual and interactive. It strikes me that the developer of LightTable gets inspriation from Bret Victor's talk Inventing on Principle [9], which rocked my world when I first watched it, and prompted me to think in the same direction. Sometimes it feels strange that our programming tools look so primitive [10], while software created with them are so advanced. It's like making a space ship with hammers and axes. Now things are starting to look better, and LightTable is just going to be a start. Equipped with these tools, programmers don't need to maintain the mental model while coding [11], and this alone will probably be the tipping point where programming becomes mainstream.

Be there or be square

So we can say the computer is moving towards human beings by making itself more approachable - with a simpler programming interface. But I won't bet it can go all the way, namely, to understand natural languages, at least for now [4]. Instead of waiting for AI to happen miraculously some day, I think human kind will move towards computers by learning to write code, especially when they have a compelling urge to do so, and will meet the computer at some sweet spot where the best human-computer symbiosis can be achieved.

References [5]:

http://www.forbes.com/sites/venkateshrao/2012/03/27/github-and-the-democratization-of-programming/

http://www.avc.com/a_vc/2011/10/program-or-be-programmed.html

http://readwrite.com/2013/12/18/learn-to-code-trend-2013#awesm=~orWQ7SDD22CypP

大家有功练,人人来编制程序

http://www.itgonglun.com/episodes/22

http://www.itgonglun.com/episodes/21

2014-1-7

Just read a blog named 'to code or not to code':http://blog.alicialiu.net/post/23137460703/to-code-or-not-to-code

[1] - They even take away the curly braces just to make it resemble English.

[2] - I think the hackers invent these convoluted mechanisms for two reasons:

To challenge themselves, and feel intellectually superior. It does make one feel good about himself to make a simple thing complex; hackers keep re-inventing the wheels (NIH syndrome) for the same reason. They even celebrate writing the most obscure code:http://ioccc.org/. Mastering a cryptic language that few could understand is cool for some people.

To scare others away from entering this field. Complexity in programming may not be a bug, but rather a feature. Programmers may subconciously raise the entry barrier to their trade by making it complicated (or seemingly complicated), because they understand how powerful it is to be able to speak the computers' language, and at a gut level, hope to keep the privileges to themselves, and maybe even to guarantee a monoply (think Google - what would happen if a lot of people know how to index the web?) Theological education was once very complex, because it was a superpower to be God's proxy, and the Church had every intention to keep the bar high and dissuade most people from doing it. Maybe history is just repeating itself - Computer is the new God.

A few relevant links:http://www.quora.com/Design-Patterns/Why-do-programmers-talk-less-about-design-patterns-now

[3] - Very valuable treature for human kind. In some sence, Github is like Federal reserve bank.

[4] - Siri is still just a moron, with less intelligence than any 5-year old.

[5] - The first 2 interviews are about Github and Codeacademy. They both claim programming will become more mainstream. You can say they have ulterior motives in preaching this idea, because they can profit if more people start to write programs. But I don't see any bias in their arguments:

When human beings acquired language, we learned not just how to listen but how to speak. When we gained literacy, we learned not just how to read but how to write. And as we move into an increasingly digital reality, we must learn not just how to use programs but how to make them. In the emerging, highly programmed landscape ahead, you will either create the software or you will be the software. It's really that simple: Program, or be programmed.

[6] - Y Combinator's motto is "make something people want". I would go further to say "make something that captures a large common subset of what people want." People want different things, but there is a largest common denominator: Facebook - socialize, Google - find stuff. If you target everyone, the LCD is small, and competition is fiece; but you could target a certain group of people (niche market, vertical fields) where the LCD is large, and go deeper, as long as the market is large enough to justify your effort.

[7] - Treehouse CEO said CS degree is just a rip off. I believe he said that just to demystify programming, and formal CS training does have its value. On the other hand, people don't need to be a top hacker to write useful software, just like you don't need to be Ernest Hemingway to write some emails. Programming has so many levels, and the democratization of programming means more people will be happy writing code close to the surface.

[8] -http://www.kickstarter.com/projects/ibdknox/light-table

[9] -http://v.youku.com/v_show/id_XMzUyOTI4MDI4.html

[10] - Basically, it is just a dumb text editor waiting for your input. When you are typing in code, it does very little (auto complete, etc), when it can do much more meaningful things, like running code that has been written in real time and show you intermediate result, or visualize the control flow and data structures.

本文由今晚买四不像发布于网络工程,转载请注明出处:软件复杂度是什么

关键词:

上一篇:没有了
下一篇:发展大数据建设数字中国,大数据这五年