Thinking in current programming way

Source: Internet
Author: User

 

 

I. Problems to be Solved
  • Function Description and expression, that is, function implementation

  • Structure Description and expression, that is, functional organization

  • Business Description and expression, that is, the final goal

2. Description and Expression of functions
  • At first, people used commands to encapsulate circuits to express their functions.

  • Later, people used functions to encapsulate commands to express functions.

  • Later, people used libraries to encapsulate functions to express functions.

  • So now, what can we use to encapsulate the library to express the function? [Question 1]

3. Our description and expression of the structure 3.1, programming principles
  • At the beginning, people use words to describe simple, correct, flexible, and efficient prinles les related to software structures, such as "modularity", "loose coupling and high cohesion", and "abstraction and implementation hiding ", but there are still unreasonable structures.

  • Later, people strengthened programming languages to support these principle and invented various paradigms.

3.2, programming paradigms

In the Encyclopedia of English, we put forward that in the process of understanding and understanding the real world, humans generally use three construction rules:

  1. Differentiate objects and their attributes, such as the size or spatial location of a tree and a tree.

  2. Differentiate the entire object and its components. For example, distinguish between a tree and a tree branch.

  3. The formation and differentiation of different object classes, such as the formation and differentiation of classes of all trees and classes of all stones

  • Structured Programming, object-oriented programming, functional programming, generic programming, and various Generative programming have been used to express the structure of software.

  • Structured Programming has solidified the second rule that people understand the world: distinguishing the entire object and its components

  • The object-oriented method adds the first and third rules and strengthens the second rule.

  • If the classification is correct, it seems that the object-oriented expression capability is sufficient. Why do we still need functions, generics, and AOP?

  • Using a systematic way of thinking, we can find that object-oriented is actually a kind of "meta Paradigm", and what we call daily object-oriented is actually "business space Object-Oriented ", generic and functional expressions are "Object-Oriented algorithm space", while AOP can be understood as "Object-Oriented structure space"

  • So now, what space does we need most? Question 2]

3.3, object oriented principles, idioms, and patterns
  • At first, people used texts to describe prinles les about software structures in OO paradigm, such as the "liskov replacement principle", "Open and closed principle", and "Dependency inversion principle". However, there are still unreasonable structures

  • Later, people invented various idioms and patterns to support these principles.

  • However, idioms and patterns are still described in text, such as valid tive XXX, gof, POSA, and peaa. Therefore, there is still an unreasonable structure.

  • As a result, people invented direct language features to solidify various idioms and patterns, such as Java's "synchronized" to solidify "scoped lock idiom", "monitor object" (posa2), etc.

  • But only a few simple idioms and patterns are solidified. So now, what can we use to solidify complex idioms and patterns to eliminate unreasonable structures? Question 3]

4. Business Description and Expression
  • I have worked in the graphic image field, communication field, and information management field, but I use the same or similar programming languages, and they are all implementation-oriented.

  • So what should we use to describe the business directly? Question 4]

V. Post-model age
  • First, let's look at [question 3]. The current mainstream ideas are non-formal model languages or model systems, and we think that each specific implementation of the model can be slightly changed. This may be true.

  • But in the same project, repeated code segments are considered as bad smell and are eliminated using idioms and patterns. Therefore, in different projects, similar or identical code segments are not considered bad smell in the entire software development field?

  • Let's take a look at [question 3]. Various frameworks have made another answer, including. net and J2EE, Loki and spring are the most impressive ones. They are developed based on various models and provide a development platform based on models.

  • Loki uses template metaprogramming to automatically create various pattern skeleton at compilation. Based on Loki programming, you only need to write a single part of a specific pattern and then pass it as a parameter to Loki, A variety of reasonable structures will be obtained.

  • Spring uses Java metaprogramming and configuration to implement the IOC mode and interceptor mode (posa2, AOP is an automated Implementation of interceptor mode), based on IOC and AOP, spring further reinforces the factory mode, proxy mode, responsibility chain mode, observer mode, and so on. If you decide to use spring programming, try to make the infrastructure based on spring, instead of just using it locally.

  • However, there are still many frameworks that are not popular and have not been discovered. We still need to understand the model, and the database-based solution leads us to get another [problem 1 ], so what technologies can bring behind the scenes and make us feel that they exist? Or is it actually everywhere, entering the post-model age? Question 5]

Vi. solution space
  • Let's take a look at [Question 2]. In the end, we want to solve the problem. Therefore, we should call the space we need most as the solution space. Let us put it in two parts: "Description" and "Implementation, let's just draw all the current paradigm as "implementation space"

  • So what is the object-oriented paradigm that describes the space? Question 6]

VII. Several final Issues in the Post-programming age
  • [Question 1 ],
    What can we use to encapsulate the library to express the function?

  • Question 4 ],
    What should we use to describe the business directly?

  • Question 5 ],
    What technologies can bring the model back to the background, so that we cannot feel the existence of them? Or is it actually everywhere, entering the post-model age?

  • Question 6 ],
    What is the object-oriented paradigm of "Description space?

  • Haha, What Is DSL and lop?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.