Home > Back-end >  How modular, learning new technology will each write code to make the next can be reused
How modular, learning new technology will each write code to make the next can be reused

Time:05-08

I am now in learning control, for example, do some buttons, text and layout, I think when doing project can call directly rather than knock again for learning and code, said team leader can take these things to make class, specific how to do?
I now want to qt all controls are simple to do a class, I can call you can achieve?

CodePudding user response:

Please keep in mind: the source code itself whether writing structured object-oriented or comply with the design patterns or agile... Is not important, the important thing is whether you using structured or object-oriented or comply with the design patterns or agile... Method named identifier, read, modify, inspection, test source code,

Mean you program structure seems more reasonable, more concise, does not necessarily than looked a mess when running or modify the program structure are less likely to make mistakes, more convenient to modify, wrong where is easier to find the cause of the error and the error, it is easier to correct mistakes,

Try comparing
Library (on the classification of the book is structured enough)
And
Any search engine (is considered to be a flat structure data, only support full-text retrieval)
Which to process information more convenient, more efficient,

So
Rather than strive to refactor your code make it looks more concise, more reasonable
Learn as laborious grep, sed, awk,... This kind of full-text search and batch editing tools,

The more complex structure, the harder it is to change, the more difficult it is to debug,
Sometimes (or even most of the time), seems more reasonable, more concise code, run up the worse performance, when something goes wrong, the more difficult it is to find reasons to find what went wrong after correction, the more difficult,

Programmers do not try to avoid mistakes, but focus on quickly discover and correct mistakes, really in a quick way to solve the mistake easily, "rapid failure" than "to prevent error", Fred, George

Before Microsoft c # editor's development director Jay Bazuzi listed some questions to help find the right direction; He felt that former colleagues should use these questions to ask yourself; Actually regardless of where is the work of developers should always ask yourself these questions:
In pieces to ensure this problem will not appear again, "what should I do?"
Pieces to a less "Bug, what should I do?"
Pieces "to ensure that the Bug is easy to be repaired, what should I do?"
In pieces "to keep on changing fast response, what should I do?"
In pieces "to ensure that my software running speed, what should I do?"
If most of the team can ask yourself from time to time, is bound to benefit from, because these are really powerful,

CodePudding user response:

. Don't you yourself control is not a class now?

CodePudding user response:

1. The design must be top-down, it must be sure to do it [specific consideration: their prepared to realize the function of the module is what? What output? Which input to achieve functional need?] [don't can't consider these how to consider the specific code]
2. The design module is the one and only one module in the brain, don't go to consider how to docking with other input/output module, the design of [color=# 0000 ff] die faster input/output interface is not affected by external interference
[/color]3. module function is single, as simple as possible!!!!!! Module function is single, as simple as possible!!!!!! Module function is single, as simple as possible!!!!!!

. Other temporary can't remember

And then design a lot of independent, single function modules, here are mostly abstract, not application oriented
Followed by according to specific requirements, the scene design a frame similar automobile chassis [], connect each module [the connection process due to the independence of the input/output interface height when module design principle, the theory is likely to be encountered interface interface does not match with the actual needs, so, I think the connection process is also a kind of connection module [concrete expression of the most common is kind of get and set properties in the function] ,
  • Related