Coupling and Cohesion in C — A Deep Dive With Examples
Deep dive into coupling and cohesion in C with examples. Learn to build modules with high cohesion and low coupling for maintainable code.
Software design principles applied to C — SOLID, DRY, KISS, YAGNI, design patterns (state machine, observer, strategy, factory), code smells, refactoring, and firmware architecture.
Deep dive into coupling and cohesion in C with examples. Learn to build modules with high cohesion and low coupling for maintainable code.
Learn defensive programming in C with practical examples. Validate inputs, prevent buffer overflows, use assertions, and handle errors gracefully.
Learn the 5 most common error handling patterns in C: return codes, output parameters, goto cleanup, error callbacks, and error structs. With practical examples.
Learn how to test embedded C code with unit tests and mocks. Use Unity/CMock frameworks to test on your PC without hardware.
Compare 4 firmware architecture patterns: super-loop, time-triggered, event-driven, and RTOS-based. Choose the right one for your embedded project.
Learn how to design a Hardware Abstraction Layer (HAL) in C. Build portable, testable embedded code with clean hardware interfaces and mock implementations.
Build a complete driver interface in C combining Strategy, Factory, and DIP patterns. One interface, multiple hardware implementations, fully testable.
Learn the Liskov Substitution Principle with practical C examples. See how interchangeable modules (like storage drivers) should behave consistently through a common interface.
Learn the Open/Closed Principle with practical C examples using function pointers. See how to extend behavior without modifying existing, tested code.
Learn the Single Responsibility Principle with practical C examples. See how splitting a module into focused responsibilities makes code easier to maintain, test, and reuse.