当前位置:网站首页>Notes on software development

Notes on software development

2022-07-06 07:41:00 Wang Chongwei

This is not a note , Want to write something casually , It can be regarded as an essay . I haven't written for a long time , Maybe the logic will be confused , Write what you think .

Explain , My technical level is not very good . It's just a temporary thinking record .


What happened :

  1. Recent work , The program needs to add standard communication and functions . When adding and designing relatively large programs , Need to design program structure , Will consider a lot , How to decouple , Layer to layer interface , Between modules , Parameters ,ram,flash, Running speed .
  2. Last week, I got up A video of Wang Mu learning science .
  3. These two days , I also discussed with a big man , Some of my own in programming , framework , restructure .
  4. Recently began to learn about aoutosar The hierarchical structure of .
  5. A new project , It takes a short time , Complete coding from zero , To delivery .

To sum up, I have produced some programming , Maybe it has nothing to do with programming .


One . Software Engineering

I majored in mechanical and Electrical Engineering , There is no theory course of software engineering . It can only be said that in the project , In the learning process of programming , More or less contact .

What is software engineering . I highly recommend you to see “ Wang Mu studies science ” This up A video of 《 How does the idea behind software engineering affect programming 》. The following points , I also intercepted it from the video .

1. Software engineering is highly complex .

This complexity refers to the high internal coupling .

Triple coupling : Coupling between functions , Coupling between people , The coupling of the past and the future .

  • Coupling between functions : Software development , How to design and divide levels and modules , This is all done by people .

  • Coupling between people : The trouble caused by the cooperation of many people .

  • The coupling of history and future : The new functions are updated on the basis of the original , It is not only influenced by history , Also consider the update iteration of this module in the future , Change and uncertainty .

2. The idea of decoupling

Without losing function , Exchange performance and resources for lower complexity .

  • modularization : Decoupling between functions
    High cohesion and low coupling .

  • layered : Decoupling between requirements and implementation
    such as : operating system ,autosar. It mainly supports and completes the upper level . Layering is more business driven .

  • Patternization : Decoupling for the future
    Design patterns 、 Basic paradigm 、 Programming principles . I don't know what to do , These rules are the bottom line . The uncertainty of the future is decoupled , Avoid a lot of holes .


For these , Most of the time, I feel deeply . For example, I need to add standard communication and functions to the existing foundation , The protocol stack needs to be introduced , Object dictionary . The meaning of dozens of objects needs to be set to specific functions , The infrastructure cannot be used directly , Need to do conversion . Most parameters also need default values , Parameter setting , It can be saved . Function requires timing , performance , wait . Other code needs to be optimized to , Provide flash, and ram.

Thinking about fighting the uncertainty of the future , And reduce some complexity , Do some interface modules , Unrelated agreements , Irrelevant hardware . This decoupling will be a little thorough . But often performance , Efficiency is getting lower , More resources .

The coupling brought by history , When you add it, you don't want to be really coupled , Some layers are more inclined to refactor , Refactoring needs to be considered , Future modifications and uncertainties . Task time node , No more refactoring is allowed .

Not much collaboration with colleagues , Otherwise, the complexity is many times more .

Think about how to do less coupling , More efficient , Entangled to the end can only choose how to choose .

Two . Engineering compromise

The compromise here , It is also the choice mentioned above many times . This word is in my impression , Or undergraduate junior 《 Automatic control principle 》 Teacher Ju , The compromise of control in class . About , Controller design , Adjusting the speed , And no overshoot .

And want to adjust quickly , It is contradictory not to overshoot . Think low complexity , Less coupling , Also want high performance and efficiency , It is also contradictory to occupy less resources . This kind of thing that you can't have both fish and bear's paw , Engineers face many . Every time I face , We need to consider all aspects , Make a choice , Make a choice , Make a compromise .

It's an ability 、 Experience , This ability also needs to be consciously exercised , Analyze in every compromise 、 experience .

The charm of the project is also reflected in this way . A lot of time is often urgent , With limited resources , In the process of many compromises . Sometimes it's compromise , More often than not, it's a trade-off .

3、 ... and 、 Against complex 、 Adapt to complex

Complexity is something we don't want , It's also inevitable . Human brain is very powerful , As long as we accept , And training , Our brain will become complex .

I work with a colleague , Yesterday I looked at my computer book , say , I don't know why it was so simple in College , Just don't understand . It looks so simple now .

Because the brain is trained to work , The complexity of the brain is increased , Looking back , Natural and simple . It's like doing linux Classmate , Suddenly I have to do something rtos, That's also a dimension reduction blow . How many levels of complexity have you directly reduced .

The complexity of confrontation , Improve the complexity we can face , It is also resisting the complexity of the future , uncertainty .

Reading also increases the complexity of our hearts , Before brushing the video , See a sentence from teacher Dong : Books cannot solve problems , But books can stop you from worrying about some problems . It may not make you a very successful person , Books often make you a more profound and comprehensive person .


If you see the last , Thank you for taking these two minutes .

原网站

版权声明
本文为[Wang Chongwei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060735599049.html