- Hands-On Embedded Programming with C++17
- Maya Posch
- 251字
- 2021-08-20 10:20:45
C++ language features
We previously took a look at the explicit nature of changes to data and system state that defines imperative programming as opposed to declarative programming, where instead of manipulating data in a loop such functionality could be declared as mapping an operator to some data, thus spelling out the functionality, not the specific order of operations. But why should programming languages necessarily be a choice between imperative and declarative paradigms?
In fact, one of the main distinguishing features of C++ is its multi-paradigm nature making use of both imperative and declarative paradigms. With the inclusion of object-oriented, generic, and functional programming into C++ in addition to C's procedural programming, it would seem natural to assume that this would all have to come at a cost, whether in terms of higher CPU usage or more RAM and/or ROM consumed.
However, as we learned earlier in this chapter, C++ language features are ultimately built upon the C language, and as such there should in turn be little or no overhead relative to implementing a similar constructs in plain C. To resolve this conundrum and to investigate the validity of the low-overhead hypothesis, we'll now take a detailed look at a number of C++ language features, and how they are ultimately implemented, with their corresponding cost in binary and memory size.
Some of the examples that focus specifically on C++ as a low-level embedded language are taken with permission from Rud Merriam's Code Craft series, as published on Hackaday: https://hackaday.io/project/8238-embedding-c.
- Raspberry Pi 3 Cookbook for Python Programmers
- ATmega16單片機(jī)項(xiàng)目驅(qū)動(dòng)教程
- Learning AngularJS Animations
- 顯卡維修知識(shí)精解
- Instant uTorrent
- Augmented Reality with Kinect
- Python GUI Programming:A Complete Reference Guide
- Camtasia Studio 8:Advanced Editing and Publishing Techniques
- 筆記本電腦維修不是事兒(第2版)
- 筆記本電腦應(yīng)用技巧
- “硬”核:硬件產(chǎn)品成功密碼
- 可編程邏輯器件項(xiàng)目開發(fā)設(shè)計(jì)
- 分布式存儲(chǔ)系統(tǒng):核心技術(shù)、系統(tǒng)實(shí)現(xiàn)與Go項(xiàng)目實(shí)戰(zhàn)
- Nagios系統(tǒng)監(jiān)控實(shí)踐(原書第2版)
- PIC系列單片機(jī)的流碼編程