Writing this series has been a tedious process. Reading this series isn’t easy either. Because it will open up its own bad debts and hit a sore spot… It’s a technical article and a code life.

First, the common programmer’s confusion

As of today, I have been working on Android for 4.11 years. I am a rookie in front of IT veterans and a soldier in the short history of the Internet, especially mobile devices.

I graduated from college with mediocre qualifications and never worked in a large factory, but I have never stopped pursuing technology. I have worked in small companies as Java engineer and Web engineer, but I always believe that I am an Android engineer. Due to the nature of the company, I can only focus on project schedule and product demand. See new things immediately learn, but basically no use, memory optimization, power optimization, low-end machine adaptation, IO stream optimization and so on. The six design principles, 21 design patterns, componentization, etc., are all just dancing around in their own lives without any sense of right or wrong.

The algorithm repeated learning, in the end found that there is no use, learned to forget to learn, I do not know how long can persist in this environment…

The salary also swings back and forth in a fixed range, because there is no demand that can’t be done by a person with four years’ working experience in principle, so the company is not short of such people, because a person with three years’ working experience can also complete the work and work experience becomes less in demand when the price varies.

Second, ensure the correct way of research and development

From the very beginning of my work, the teacher who ushered me in said:

One requirement is 90 percent design and thinking plus 10 percent hand speedCopy the code

Yes, this is the rule that everyone should follow in the software industry, only good design and thinking can make better things. Hypothesis generation, while thinking about extensibility and reusability are difficult to maintain the code, in the long term, in the face of demand, to think, don’t know how to design is a operation, although can present on the phone, but the reusability of extensibility is almost zero, over the years that has formed the vicious cycle, when someone to find you a needs assessment: how long does it take to complete, It’s impossible to give an exact time. And if they did, they were full of errors. How should we improve our ability in this aspect of design, so that we stand out from so many programmers, of course, this is certainly not simple to use the SYSTEM API, SDK and familiar with its principle so simple. Anyone who is good at using the Internet can stand on someone else’s shoulders and accomplish the basic requirements of a programmer, but some things don’t work.

2.1 First of all, we should have the right research and development methods:

The right way to develop? You’re teaching me how to do things? Haha, a lot of people, when faced with a need, absolutely hit the ground running

Study yourself from different angles, good writing habits, features of the language you write, avoiding weaknesses, and thinking clearly about how to design.

That’s a pretty sloppy summary. The goal of a 10 year programmer is to be a PM, an architect. The former tends to manage, the latter is still on the front line. Generally large factories have architect positions, architects in the Internet industry also belongs to one of the top existence, their RESEARCH and development habits and patterns can be explored for research and development.

2.1.1 the architect

The system architect is the technical person who finally validates and evaluates system requirements, gives development specifications, builds the core architecture of system implementation, and clarifies technical details and clears up major difficulties. Focus on the “technical implementation” of the system. Therefore, he/she should be a master of a particular development platform, language, and tool, able to provide the most appropriate solution for common application scenarios, and have enough knowledge of the development team to be able to assess the cost to his/her team of implementing specific functional requirements. The system architect is responsible for the design of the overall system architecture, from the requirements to the design of every detail should be considered, grasp the entire project, make the design of the project as high as possible efficiency, easy development, convenient maintenance, simple upgrade, etc.. — Baidu

I believe that everyone knows the name of architect and is struggling for it. Have you ever thought about the following questions:

2.1.1.1 Architecture Value

The value of architecture is embodied in two aspects, one is its behavior value, and the other is its architecture value. I used to think that the existence of an architect is to make code better and more standardized development and make it highly extensible. If the company has an architect, I can learn to design better and improve my development strength.

However, when I really got to know the role of architect, I found that the previous way of thinking only in technical terms was ridiculous. Why should the boss continue to pay for a product that could not maintain normal income or long-term profit and loss?

It was when I read an example in the book “The Way to Clean Architecture” that I learned the hard way about companies and the value of programmers. This has certainly happened to all of us, and it is very likely that the current company is experiencing it.

Example: Company of a certain product after a period of time, is not only the size of r&d team, threw the cost and the benefit of production will increase, this is the microscopic appearance of a company to grow, in our research and development is the WBH, but the cost of each line of code, each version r&d productivity and wages paid by the company Angle is needed for each product version is a very large consumption, Preparation:

  • Number of early engineers and major releases

Obviously, of course, the data is exaggerated, but it can describe the problem. Many companies’ products, after the financing expansion, will expand the r&d staff on the later version, so it seems that there is no problem, which is also a sign of the stronger development of our research and development.

  • Concurrent productivity Number of lines of code required per release

It’s easy to see the problem in this diagram. As the company grows, you can see that the number of engineers grows rapidly, but the amount of code per release is hard to move forward after a certain point, for two reasons

  1. The product doesn’t offer anything new, but the company needs to keep expanding
  2. The architecture of the software is so poor that the time it takes to get a release up to date is so inefficient that it’s time to think about why

Do we programmers need to pay attention to this data? After all, it’s not our business. Of course, it’s not our business.

The success of a project has a great relationship with its corresponding personnel organization structure. Often, the failure of a project is caused by a group of people who are unclear and corrupt in thought

But you have to be responsible for your future, and you have to be responsible for your salary, so it’s important to think about these issues and how we relate to each other, and make sure that you’re able to leverage your value and profit within a well-defined organization.

  • Change cost per line of code

As the version moves forward, the company will find that more and more money is needed for the later version after the labor cost is taken into account. At this time, I feel the hardship of capitalists and the difficulty of starting a business

  • Develop productivity and product versions

Our r&d productivity is going to be very poor in the eyes of our shareholders, and we’re going to get busier and busier

The more people there are, the lower the productivity is. The first version takes three months to go from 0 to 1, but the subsequent versions cost more and more, and the input and output are seriously inconsistent

There are many reasons for the above problems, but in terms of code additions, it must be that the architecture of the code has become a mountain of shit.

The architect exists to solve these problems, and this is the value of his existence.

  • Where did the first architect come from?

There are no architects in the world. As more people type code, there are architects.

Since the beginning of the 20th century when there were programs; From read-write devices, when someone ties I/O operations to specific code; When the Macintosh came along, when Windows came along, when Liunx came along, when mountable hard disks came along, the architect came along.

They write and write I/O device-independent; Develop language and platform independent; Extracting long term combat experience into patterns…

Their existence is the bright star in the river of Internet, is a valuable spiritual wealth, because of them, the program is called software, because there are enough extensions to make the program “soft”.

They are enduring, with layers of practitioners coming and going, creating greater value. He comes from you and from me. From countless great programmers who use keyboards and rely on ideas.

2.1.1.2 From you or from me?

Joke, I never felt like I could be an architect… From the beginning of my career to now, LINE by line of code, module by module, to start to use design patterns, began to use various principles, began to pay attention to scalability, maintenance, began to think about how easy to develop, how easy to upgrade, how to compile faster, began to think about the three-party SDK in an accident quick replacement…

Wait, turn to the above to see baidu’s definition of an architect. I, I was doing what architects do, a tear in my eye…

Why am I still a programmer and not an architect, even though I do their work? It is my use is not mature enough, the use is not standardized enough flexible. Small function can not see the big picture, so need to deeper learning, learning a variety of skills.

2.1.1.3 When do YOU become an architect?

The answer is no. Architects must be employees who work in the front line. Only by experiencing the difficulties of research and development can we find the problems of architecture. Any architect comes from a programmer; no one suddenly becomes an architect.

Let the architectural behavior accompany the development

2.1.1.4 Is the value of the architect consistent with that of the programmer

With the above understanding, the values and responsibilities of architects are clear. Are they the same as programmers? They may get paid well and do very little, but they have the same value as the average programmer

At the same time, people praised the grand design of Tian ‘anmen, but also praised the greatness of the working people

So our values are the same, a good architecture needs a soul to lead, but also needs to be refined everywhere, needs good programmers to improve.

And a software architecture is not laid from the beginning, because no one knows the direction of the software will not change in the future, so a good architecture is constantly expanded and designed with the development of the business.

The architecture and neat way, quite a lot of Suggestions are provided for the software architecture, for example, wants to design software architecture should guarantee its independence, to have clear boundaries, slightly and level measurement, there should be the direction of the macro and micro implementation, need to keep good test boundary and high-level software design should not consider the specific implementation, at the beginning of the architectural design, You may consider adding or deleting data, but you will never design to use a relational or mapped database.

These design problems that can not be seen in the early stage can only rely on the rich experience of architects to constantly adjust the architecture suitable for their own business, and flexible adjustment is inseparable from the architecture that changes due to business, more inseparable from the implementation of each component, each line of code.

I think you’ve got a pretty good idea of what the problem is,

To be an architect, you have to start with every line of code, every component, from the micro, from the design of every line of code.

2.2 How to Become an “architect”

The above discussion has been very clear, to become an architect, the first thing to do is to be a qualified programmer, to be responsible for any line of code, a component, to be good at thinking programmer, so we can study from the following aspects to improve ourselves.

2.2.1 Get to know your own programming language
Java Language programming Paradigm - Java bytecode and bytecode operations (understanding bytecode operations and virtual machine instructions helps you write better code)Copy the code
2.2.2 Proficient in using various design principles
- Single blame principle - Open closed principle - Richter substitution principle - Interface isolation principle - Dependency reversal principleCopy the code
2.2.3 Proficient in using various design patterns
- The design pattern needs to be benchmarked according to your own requirement scenarioCopy the code
2.2.4 Proficient in building principles of components in the architecture (such as components in Android)
- How to define a component - component aggregation, coupling - how to deal with dependencies between componentsCopy the code
2.2.5 Make your own code have good scalability and maintainability
2.2.6 Proficient in using “use cases” to design our code
2.2.7 Apply it to research and development

What else do we need to do before that?

2.2.8 Insist on learning the excellent writing method of the corresponding language every day
2.2.9 Study the blind area of knowledge in the corresponding field every day
2.2.10 Read giant books every day
2.2.11 Stick to it every day

Of course, this series is not for you to spend all day thinking about how to design code and how to study architecture. The real purpose of architecture is only one:

Meet the requirements of building and maintaining the system with minimal labor costs. Let the system work properly

A good programmer needs to combine his own strength to create benefits for the company from the perspective of the company, so as to ensure his own interests and realize his own value. How should we create profits, we study together.

How do you balance that with the conflict that you’re developing,

  1. Ensure that requirements are met
  2. Ensure the normal operation of the software
  3. Using the Eisenhower Matrix Principle (separately)

Iii. Follow-up planning of the architecture in r&d

From the beginning to today, every line of code comes from books, from the network, from netizens, so I hope that someone can work with me to complete this series, so that it can be a beacon on the road to the Internet. I hope to learn anything that can improve myself. I will talk about these points mentioned in 2.2 and learn them one by one. It becomes code, it becomes Demo, it becomes my programming habit. Anyone who wants to participate in the series can email me at [email protected]

All of the above considerations are suggested in the book “The Way to Clean Structure.