Article title: an effective programmer-ancient philosopher. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Chapter 2. Ancient philosophers
In a book about programmer productivity, reading chapters about ancient philosophers may make you feel abrupt, but this is true. The results show that some philosophical ideas discovered by ancient (or not so old) philosophers have a direct impact on building high-quality software. Let's take a look at how the philosophers comment on the code.
The "nature and ancillary nature of things" theory of Aristotle
Aristotle has established many scientific branches that we are familiar with Today. in fact, most scientific research originated from him. He classifies, cataloguing, and defines all his thoughts on the natural world. At the same time, he is also the founder of logical and formal thinking.
A logical principle defined by Aristotle is the difference between the essential and ancillary properties of a thing. For example, five bachelors all have brown eyes. Unmarried is their essential nature, while brown eyes are affiliated. Because you cannot infer from this: all single Chinese have brown eyes, because the color of the eyes is indeed just a coincidence.
Okay, but what does it do with the software? A slight extension of this concept will remind us of the essential and affiliated complexity of things. Essential complexity refers to the core of the problem to be solved, which is composed of difficult problems in software. Most software problems involve complexity. Affiliated complexity refers to things that are not directly associated with the solution, but we still need to solve them in any case.
For example. For example, there is a problem. its essential complexity lies in tracking customer data: getting data from the web page and saving them to the database. This is a simple and intuitive question, but to make it work in your organization, you must use an "old" database supported by poor drivers. Of course, you need to worry about database access permissions. If some databases on another host contain similar data, you must use cross-check to ensure consistency. Now, you need to connect to the host and extract the data in a format that you can use. At this time, you find that you cannot directly connect to the database, because there is no connector in the tool you are using. No way, you can only let others extract data for you and store it in a data warehouse, and then you can get it from there. Does this sound like the job you're working on? The essence of complexity can often be described in a word, but the affiliated complexity is often endless.
No one wants to spend more time on affiliated complexity than on essential complexity, but as it accumulates, many organizations eventually spend more time on it than on essential complexity. SOA (Service-Oriented Architecture) is so popular today because many companies are trying to get out of the increasing complexity of affiliated services. SOA is an architectural style that binds two distinct applications so that they can communicate with each other. Few think this is the reason that drives you to use SOA. However, this is indeed what you want to do when you have many programs that need to share information but cannot communicate. But in my opinion, this is purely an action that adds additional complexity. In the vendor's mouth, the SOA architecture is equivalent to the enterprise service bus (ESB). its main selling point is that the solution to the middleware problem is to make it more intermediate. Will increasing complexity reduce complexity? Almost impossible. Therefore, be cautious with vendor-driven solutions. Their primary goal is to sell their products, and the second (or perhaps) is to make your life better.
Identifying a problem is the first step to get rid of the consortium complexity. Think about the processes, strategies, and technical difficulties you are using. Knowing how to improve may fundamentally cause you to discard things that do not contribute much to the entire problem, but are troublesome. For example, you may think that you need a data warehouse just now, but it actually brings far fewer benefits than its increased complexity. You cannot eliminate all the complexity of the software, but you can continue to reduce them.
Prompt
Focuses on essential complexity to eliminate affiliated complexity.
Occam Razor principle
Sir William of Occam * is a monk who hates gorgeous decorations and complex interpretations. His contribution to philosophy and science is the principle of the Occam Razor: if there are several interpretations of a phenomenon, the simplest interpretation is often the most correct. Obviously, this is closely related to the nature of things we discuss and the theory of affiliated nature. This principle has an unexpected impact on the software.
As a member of the software industry, we have been conducting an experiment for the past decade. This experiment started in the middle of the 1990s S, mainly because developers found that their development progress was far behind the growth of software requirements (in fact, this was not a new problem at that time, this problem has existed since the idea of commercial software emerged ). The purpose of the experiment is to create tools and environments to improve productivity of common developers, even if some people, such as Fred Brooks (to see his man-month myth) we have already told us some chaotic facts in software development. This experiment attempts to verify whether we can create a language that limits the destructive power of programmers and free people from trouble; can we make the same software production without having to pay a lot of money to the annoying software technicians (even if you're still worried about not finding enough software technicians at that time? These ideas have created tools such as dBase, PowerBuilder, Clipper, and Access, and contributed to the rise of 4GL (the fourth generation language), which combines tools and languages, such as FoxPro and Access.
But the problem is that even with such tools and environments, you cannot do all the work. My colleague Terry Dietzler created a "80-10-10" rule for Access (which I like to call Dietzler's law ). This law says that 80% of customer needs can be completed quickly; the next 10% requires a lot of effort to complete; but the last 10% is almost impossible, because you cannot "take the lead" of all tools and frameworks ". However, users want to meet all their needs, so the 4GL (Visual BASIC, Java, Delphi, and C #), as a general target language, came into being. The emergence of Java and C # is mainly due to the complexity and error ability of C ++. in order to free general programmers from these troubles, language developers have built some quite strict restrictions in it. After that, the "80-10-10 rules" were changed, and the work that could not be completed was minimal. These languages are common target languages. most of the work can be done with enough effort. However, although Java is relatively easy to use, it often requires a large amount of encoding, so the emergence of the framework, the emergence of Aspects, a large number of other frameworks flocked.
The following is an example. This Java code is extracted from a widely used open-source framework. try to find out its purpose (I will only prompt you for its name ):
[1] [2] [3] [4] Next page