After the knowledge of more code management--2015 on the pit

Source: Internet
Author: User
Tags blog layout

Objective

There is no limit to learning, and the ability to manage code will always need to be improved.

A few months ago also feel that r language, business to use all learned 7788, these months in their own department Chi Chi in the report automation, each pit one step a quasi, just understand write code, understand a bit of language features is important, get a set of scientific management code method, but is imperative.

So here's a summary of the various pits I've stepped on over the last few months, and some of the more appropriate ways to look at the experiences of the great gods and learn software engineering in the course of these months. In the 2016, I really need to learn more about how to manage code scientifically, scientific development

Please note, because I belong to the cross-professional halfway decent write code, just getting started, software engineering classes are only half, there must be a lot of concepts are not clear, the following is either too small white or mistakes, welcome to guide the direction, a lot of exchanges and exchanges

Spit A hole in the pit of a step

Not to read in the blog Park will be seen, this blog post belongs to the blogosphere @ tail ar http://www.cnblogs.com/weibaar All

Only guarantee in the blog Park blog Layout Clean and the code block and picture correctly display, he station reproduced please keep the author information respecting copyright AH

I started around July, one by one, the department's reporting requirements in the R language Automation, the code more accumulate, the demand has gradually accumulated, began to trample on the pit,

(See 1 2 3 for a few links to this business need)

These pits are summarized in the following ways:

1, reporting requirements more and more complex, the logic itself is very complex, and then to do a variety of processing, resulting in more code to write longer, it is difficult to locate said where to write, absent-minded

2, very hard to write good code test run, Report automation correct, the result of business out of the picture, to add this figure that figure, add this data that data, go back to change, find code everywhere implicated, often change a place, will follow change N place, also prone to error leakage change, maintenance difficulties

3, found that some statements with the code is repeated, such as reading the same data, do the same processing, but because the code is often maintained, the same steps appear in n versions throughout n programs, error-prone

4, with the understanding of programming language, gradually has a more efficient method, looking back, feel some local logic is chaotic, inefficient, but implicated too deep, dare not change

In short, found that the past buried writing code does not work, the number of lines of code on a certain amount, the amount of modification also up, in the maintenance of more problems.

Then the tangled ah think about it, first think of a lot of soil methods, and then according to the study progress of the software engineering, only to find that these problems have been touched by people, and then there is a system of solutions, so here is a list of what I feel more useful, worthy of further research and practice of the idea:

To use the thinking of engineering management to manage software development, in the early stage as far as possible to divide the clear requirements, the middle development by module division, and set up a unified interface, distinguish between the easy to change and difficult to change the business, the basic analysis of the wheel project, to ensure the reuse.

Next, let's talk about:

1, to use the thinking of engineering management to manage software development

In the Academy online-Software engineering class, it is mentioned that the development of the complex and changeable. Because of this complexity, people will be introduced to the concept of engineering to manage software development, so if you have this project at the end of programming, strictly control the progress, learn some methods, you can achieve a multiplier effect.

2, to study the needs in the early stage, and split a good clear function block, in order to break one by one.

Research good demand, demand confirmation, rework the odds are not small, and direction clear, not easy in the analysis of the process lost everything.

Then the need to confirm, you can put the general structure of the program to design, divided the functional block. Then, in the organization of code, you can partition the function block, easy to locate long code (such as different scripts, or with {}, etc., when opened with notepad++, you can directly put this part of the code block collapsed hierarchically)

Second, the function block is clear, you can list the difficulty of its development Ah, the degree of relevance Ah, schedule a schedule, there is time to focus on the inside a module to do, once on the solution of a problem, direct, convenient, lightweight.

3, after dividing the function block, through the flow chart structure diagram, the large function block is connected together, the unified interface

After studying the requirement and dividing the large function block, the general flowchart and the structure diagram of the whole program can be drawn.

For example, using R as an automated report with 4-5 source data, you can put the source data 1, 2, 3, 4, etc. are listed in the function of reading the source data, and then the relationship between them, screening conditions, processing methods, etc., are drawn on the flowchart. The source data, intermediate steps, the final results are listed before programming, so that the flow of this automated report can be replicated, and development and optimization, you can quickly locate the code location, you can do a small range of iterative development, step by step to complete the complex system, to avoid writing code is lost in the direction of writing.

Not to read in the blog Park will be seen, this blog post belongs to the blogosphere @ tail ar http://www.cnblogs.com/weibaar All

Only guarantee in the blog Park blog Layout Clean and the code block and picture correctly display, he station reproduced please keep the author information respecting copyright AH

And this is a good thing, is that the flowchart can clearly see the relationship between functional blocks. Then we can write each module or function, first of all, to clarify a common interface between them. To avoid saying, modify a part of the code, and then unknowingly, affect the subsequent development of all the code. Ensure that each block is independent of each other, the relationship is clear, this can alleviate a lot of subsequent programming work.

Let's look at a simple example:

4, attention to distinguish between volatile and difficult to change the demand, in the processing of business, refining business, accumulate code base.

Have heard a view, a good programmer, often can be used freely a lot of common functional modules. When doing system development, they often do not start from the zero programming, but some common blocks stacked into the system, and then clarify the relationship and compatibility of all aspects, to achieve a rapid development process.

In fact, in the business, some needs are often present.

For example, I go to the automation of the R language Report, a department of commonly used source data, often there are a few categories. I can specifically write a small module to deal with a class of source data, and then each time the analysis, the corresponding reading data module out, direct reference to the new analysis. And to read the data module to do a unified management and scheduling, to ensure that the version is unified. So later if you want to do what analysis, you do not have to copy the code from another program script, but modify the process of reading the data, to ensure that it has a corresponding classification, so that, modify a place, or a bug, we just process a process, a script file can be, modify the wheel, The last accumulation is not a separate program, but a wheel that can be reused

In doing so, as the more code is written in the business, the more repetitive the demand, the faster we develop, which allows us to focus more on the implementation of the new features, the setup of the overall system, and the error between the programs and so on. Finally achieve the so-called "older more popular" knowledge accumulation.

To do this, we need to develop a volatile and difficult to change the needs of a refining and extraction, to timely realize, what is repeated to do, what is occasionally to do. The complex business of splitting, streamlining, refining, see through the nature of the transaction.

Data reference

Looking back above, I feel that some places I have written is not particularly clear. After all, software engineering and so on are still newly learned, and the current code volume is not large enough to work together.

With the software, the larger the programming size, the more complex the management, like I just write to myself thousands of lines of code, I have been stuck in the dilemma of managing these code for a long while. Sometimes it's hard to imagine that in an enterprise-class software development process, a code base is maintained by hundreds of people, and it doesn't crash and update at all times.

It is believed that with the increase of seniority and the expansion of the knowledge of the world, the complexity of managing the whole process becomes a hurdle that we must take.

Thanks to the confused period of reference to the various materials, not fully listed, think up on the addition:

Academy Online-Software engineering

Faq

There are tips that veteran veterans know and novice don't know

How about maintaining a five hundred or six hundred-line program?

Business code related

How do new programmers find bugs in complex code?

At the end, attach your blog total directory of blogs, blog Park @ Tail ar:http://www.cnblogs.com/weibaar/p/4507801.html

And recently also in accordance with the 2016-year plan to try to operate the public number, search " tail said number " can, temporarily just started not much content, planning blog put some more technical content blog, the public number of essays more, interested in more exchanges.

Ah haha 2016 also insist on at least one Bo per month ...

After the knowledge of more code management--2015 on the pit

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.