Choice of containers Information technology, even embedded devices, is about information gathering, processing or calculation, and control. Input and data needs to be juggled around and maybe sorted. In this article, we want to point out some fundamental implications in the choice of a data container. Vector The first container is the array or “vector”. […]
Open source implementations of malloc
On (very) small embedded systems without a full OS (e.g. because there is only a scheduler), one can (and should) usually live without dynamic memory allocation. But sometimes, it is really needed or it is just more convenient. It is possible to write your own simple dynamic allocator on top of a pre-defined memory region, […]
Object-orientation in C – Part 4
We continue to build on the example in Part 3, but we go another step further. Even more abstraction and information hiding can be achieved by partially mimicking (part of) the COM manner of programming: strictly talking with interfaces. This style of coding is not for everybody, nor is it a fit for every project. […]
Object-orientation in C — Part 3
For non-trivial class hierarchies the method proposed in Part2 is probably not optimal. The main reason is that there is only one C struct which is used by base and subclasses. Consequently, the hierarchical tree is only implicitly contained in the data structures and therefor, in this last part of the series, we introduce a […]
Object-orientation in C — Part 2
In Part1 we have laid the foundation of how a class could look like in C. This simple class is good for creating an Abstract Data Type but it doesn’t support polymorphism and inheritance…yet. Here is an UML diagram (made with dia) of what we are trying to achieve in this post: Admitted, the example is not very original […]
Beware of premature optimization
One should only write optimized code? No, one should not write only optimized code. One should write maintainable and readable code, which adheres to the KISS principle. Depending on the foreseeable scenario, certain optimizations could be introduced in order to meet the performance requirements. The dangers of early optimization “fever” are loosing yourself in the […]
Object-orientation in C — Part 1
Object-orientation Object-orientation is about classes and objects. A class is an abstract data type: data type: because it defines a new type to work with by providing data and operations on this data, but also abstract: because it encapsulates this data and hides implementation details behind an hopefully nice and clean interface. An object then […]
3 ways to boost your performance as a developer
If you wish to boost your performance as a developer by a non-trivial factor then here are three ways to help you achieve this: loosely couple automate testing automate delivery I saw people -myself included- that started applying these rules and went from being unproductive and frustrated about coding, to being productive and in control […]
Adopting MISRA-C guidelines in your software development process – best practices
Implementing functional safety by means of achieving a certain safety integrity level (SIL) is a matter of reducing risks. On the software side this results among other things in the adoption of a language subset, which often is a required SIL parameter. As C and, to a lesser extent, C++ are popular programming languages for developing embedded software, a […]
Recent Comments