Engineering ideas summary

Preface: I Wonder Technology was founded and two years Jack has been a long time, although the company has not registered, but our project has been developed to version 1.2, due to various reasons to stop the development of the project. Jack began writing a book on the road, and I also faced finding a job to do, before looking for a job, I want to put this thing two years of study were summarized and re-set, as if to help people, can be considered did a good thing.

Give our project, as well as reconstruction projects and rewrite how we use engineered thoughts at introduction.

We have developed a Web-side 3D WebGL engine and online editor, where Jack is responsible for the engine, I am responsible for system development and 3D editors company's official website, forum, hosted platform. During this period I was also familiar with the engine and the development of a free camera function engine, and integrated into the editor used to this end, I would like to summarize the next two years to follow Jack learned engineering ideas.

First, the foundation of large-scale projects: Test Driven Development

New to TDD when I think, I am sure, like me, confused, in the end spend so much time writing tests are not necessary, especially in front-end development classmates, many companies do not ask you to test, so the larger environment basic front-end programmer will not write test. Let me enumerate the advantages of automated testing:

  • Lower costs: the programmer to capture the automated testing bug, become a test case, put this bug is fixed, there is after any remodeling to make this bug can reproduce the error, so we do not need the test team
  • Reducing the time: just write the test again you can always reuse, efficiency certainly higher than artificial
  • Correctness: as long as the test code coverage more product codes, we can guarantee the accuracy of the product code
  • Code reusability, scalability: when the project develops to a certain order of magnitude, there is no automated testing support projects, difficult code maintenance and reconstruction
  • Test Readability: Good test can also be used as easy to read document
  • Increase confidence: help us to increase confidence in the software also allows users more confidence to use our products

Our editors test coverage reached 87%, covering all the business logic code editor to interact with the engine, we project an iterative process, I feel more and more the importance of automated testing. In addition, test-driven development Another advantage is that we demand during design time, to write the test first developed in the form of, in this development process, we analyze the demand from the user point of view, in turn, can help us improve our own code design, programming, there are tests to ensure correctness of the code.

So at the time of writing 3D engines or rich Web applications (such as nails, tools, websites), I think companies need to consider automated testing, otherwise the project can not be developed in an iterative consequences may occur.

Second, the Design by Contract: increase the robustness of the code

What is Design by Contract?

Design by Contract (DbC) is a method of designing computer software. This method is described, software designers should be defined as a software component formal, accurate, verifiable interface specification, which extends the abstract data type for priori, the experimental conditions and general definition invariance. These specifications known as the "contract", it is a metaphor, similar to the commercial contract / contract conditions and responsibilities.

When we developed in-house, each completed a function, the code will be checked, Jack will be reconstructed according to their own past experience, in the reconstruction process and I grasp the benefits and necessity of Design by Contract. As the functional programming paradigm we use, function is the basic unit, so magnified contract design advantages, so we write a lot of contracts for the specific function, using a priori conditions and after experimental conditions to ensure robust function.

Priori: to ensure that input API is our desired input, for example, we have designed an array operation API, we need to ensure that parameters as an array, this time we write a priori conditions, warranties parameters of type array, before proceeding, if not throwing an error.

After the experimental conditions: to ensure that the output API is our desired output, such as a particular API, requires the output data is not empty, this time we write experimental conditions, expect him to return value is not empty.

When we need to run on the line to ensure that incorrect positioning, product lines based on our experience, most of the error comes from good design contract, so that we can quickly navigate to the location of the problem, so I think we can when we designed the API use the design by contract, to ensure robust API.

Third, team norms

Specification defines an internal team is an important thing to ensure is like a person, like a complete team productivity, and enables a seamless transition between the team members to complete the work, do not worry member movements and other issues. Let me introduce the specification of our team.

1.git submit specifications
We use cz-customizable library norms and specifications submitted CZ

2. Code Specification

The person in charge of programming code standards primarily project specifications, or use a mature team, programming specifications, the main way to execute code review of the use of new programming habits specifications down, each taking time after the completion of code review function is particularly important, first ensure the quality of the work of newcomers, the second program to ensure that the new specification.

Fourth, automation tools

I always believe that people will make mistakes, but the machine will not, so we need to repeat the work team often performed manually to the machines to do the big companies have internal tools team is dedicated to do this thing, the two of us, then of course also write our own automation tools.

Previously mentioned sentence to see grade programmer's article, put aside the use of tools, the gap between the programmer and the programmer is not great, and the use of new tools, programmers can cultivate a new way of thinking way, thus prompting them to update their thinking.

1.Vim operation command

When I know Jack, when not working together, the late Jack gave me guidance is learning Vim and TypeScript, and I gave up many times in the course of three months of learning Vim, but the next day to pick it up again finally able to form muscle memory, from the feel of programming Vim brought me pleasure, and I have been from repeat doing things manually, using advanced tools to quickly complete the thought, before writing code using the keyboard with the mouse, move the cursor slowly , resulting in slow programming. After using Vim pure keyboard operation, often feel when the programming he is very powerful, and often self-satisfaction, which is also part of the fun of programming.

2.Emacs

Internet has often been discussed Vim and Emacs what good or bad, I use Emacs primarily use Emacs-org were TODO management, still use vim operation command, also need to learn Emacs base command, when recording notes and TODO, heartfelt feel easy to use.

3.chrome plug

Because we are editing is running on the chrome, so use a good chrome plugin can help us to operate on the browser.
I think the best is Vimium plug-in, use the vim command in the browser, operating, most of the time do not need to use the mouse will be able to smoothly browser.
There are other plug-ins are private, choose according to personal preferences, in which I will not introduce more.

4. Automated Deployment

When the local project pushed to the remote server, write tools to automate the deployment of the project, the project published to ensure correct and simple.

5.CI test checks

Project released a new version, pushed to the remote server, to automatically run tests to check CI, ensuring that all tests pass submit.

6. Automatic release

Project released a new version, the version number of the update automation, execution publishing process.

Conclusion: in fact, was quite reluctant to end their two-year business career, sentimental farewell injuries since ancient times, but each of us has their own lives to live, my friend and teacher, and Jack, Jack thanks for many years of teaching and care. In the third year graduate, I graduated from Wonder Technology, and after the road is still sky high the birds to fly.

Guess you like

Origin www.cnblogs.com/xiaohaoxuezhang/p/11713479.html