当前位置:网站首页>Five skills of selecting embedded programming language

Five skills of selecting embedded programming language

2022-06-24 17:38:00 Software test network

For new projects , What programming language should embedded developers use ? This article will explore some suggestions for choosing the right programming language for embedded developers .

Suggest #1 – Avoid dead or dying language

as time goes on , Programming languages are no longer popular , It's inevitable . Invented a new way of doing things , Invented a new language to solve today's programming problems . The language that used to be used is disappearing , Instead, a new language .

Please note that , Assembly language is the second language in the world 8 The most popular programming language ! however , You know how many people are actively writing applications in assembly language ? in the majority of cases , Assembly language is dead . Of course , We occasionally write assemblers to optimize certain functions , But we don't write assembly language every day . therefore , Please make sure the language you choose is not dead or disappearing .

Suggest #2 – Choose an object-oriented language

Almost every system today can be data driven 、 Object oriented architecture to describe . I believe that many embedded systems naturally fall into this design paradigm , There's no need to torture our designs to get them . however , Choosing a programming language that supports the concept of object-oriented programming is very important to build an extensible and reusable software system .

When we look at the list of programming languages for embedded systems , We will notice a small problem with the first five languages ; C Object oriented and assembly languages are not ! They do not provide the modern toolset that embedded developers need to implement modern software architecture . Besides , These languages require a lot of extra work to get the functionality naturally built into other languages .

Suggest #3 – Use only standardized language

People who build commercial products that must be maintained and updated for many years should not use non standardized language , Unless they can afford the technical debt associated with constantly upgrading software . In image Rust Before the same standardized language , The norms of the language are constantly changing . As language develops and determines the best way to do things , It's changing . This means that you may use a compiler to get the results A, Then use another compiler to get the result B. The same language , Different results , It's all because the language is not standardized !

Although the new language is exciting , But for most enterprises, it makes sense to use standardized language . I believe that the development of these standards and their use have positive significance . image C++ Such a language is a good choice . C++ There is a well-defined standard , The standard is updated every three years . result , It provides developers with new technologies and new functions to improve their software , Make language live . It also provides a consistent standard , In this way, the team does not have to bear the technical debt of change , If they don't want to do this . contrary , They continue to use the standard version they use .

Suggest #4 – Balance language runtime weights

A key consideration for embedded development teams is the runtime weight of their language .

If you check C/C++, You will find that running C The code size required by the application is much smaller than 1 KB. The overhead of running code is negligible or even non-existent , C/C++ With lightweight runtime weights . If you check Python or MicroPython, You will find that this is not the case . MicroPython Interpreters are usually built to 300 – 400 KB Between ! The overhead of running the interpreter is relatively small , But the weight of the interpreter is quite high .

If the cost of memory is considered cheap or unimportant , Then heavyweight runtime may not be a big deal . under these circumstances , Use something like MicroPython Such a language can bring many benefits . for example , Almost everyone knows Python Or you can learn it quickly . Besides , It has strong adaptability , There are more coding standards than people think . Upgrading application code can also be as fast as updating some script modules .

In any case , Embedded development teams should carefully consider the costs associated with the language of their choice . for example ,python、Java、Labview Etc. may have higher runtime costs than other languages .

Suggest #5 – Use the language that suits you

in the final analysis , you ( The team ) You need to decide which features and languages best suit your needs . for example , If the whole industry is turning Python, But assembly language makes more sense , Because you provide a manually optimized library , Then choose assembly language . On the other hand , If you have a bunch of C Legacy code written , And hope to continue to use existing assets , Then please use C.( Or package your C Code and use C++!).

Don't let the language fashion of our time persuade you to change . contrary , Use a meaningful approach and consider the suggestions we discuss in this article .

Embedded developers and teams can indeed choose rich programming languages to develop their embedded software . The language they choose will depend on the type of software they write 、 The needs of companies and the technical debt they incur when maintaining code . When choosing the language to use , The recommendations in this article should provide some additional considerations . When in doubt ,C/C++, In especial C++, May be a good default .

原网站

版权声明
本文为[Software test network]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211543395080.html