Feabhas Blog
blog.feabhas.com · Company blog · on HN since 2012
Feabhas, an embedded software training company, writes about C, C++, CMake, and tooling for embedded development.
What HN saysHN links it for practical C and C++ posts, with commenters citing it in discussions of memory protection, strings, and code structure.
18HN people shared it
3linked it in comments
40stories submitted
1.1Kstory points
2 years agolast shared
2012people per year2026
Most-shared posts
- 1CMake Part 1 – The Dark Arts3 people · 108 points · first shared 2021 · 69 comments on HN
- 2CMake Part 2 – Release and Debug Builds3 people · 6 points · first shared 2021 · discussion on HN
- 3‘Abusing’ the C switch statement – beauty is in the eye of the beholder2 people · 237 points · first shared 2017 · 147 comments on HN
- 4C++20 Modules with GCC112 people · 142 points · first shared 2021 · 108 comments on HN
- 5Custom Allocators in C++2 people · 2 points · first shared 2019 · discussion on HN
- 6Becoming a Rule of Zero Hero2 people · 2 points · first shared 2015 · discussion on HN
- 7A convenient untruth: Array notation in C is a lie1 people · 180 points · first shared 2016 · 172 comments on HN
- 8VSCode, Dev Containers and Docker1 people · 178 points · first shared 2021 · 228 comments on HN
- 9On the evolution of programming style: How far C++ has moved from its C roots1 people · 98 points · first shared 2012 · 71 comments on HN
- 10Demystifying C++ lambdas1 people · 28 points · first shared 2014 · 9 comments on HN
- 11Memory consistency made simple(ish)1 people · 27 points · first shared 2016 · 4 comments on HN
- 12An Introduction to Docker for Embedded Developers – Part 2 Building Images1 people · 8 points · first shared 2017 · discussion on HN
- 13Function Parameters and Arguments on 32-bit ARM1 people · 6 points · first shared 2016 · discussion on HN
- 14CMake Part 4 – Windows 10 Host1 people · 4 points · first shared 2021 · discussion on HN
- 15A brief introduction to C++ Concepts1 people · 4 points · first shared 2018 · discussion on HN
What HN people wrote when they linked it
twic · 2015-10-03
The "new hardware protection mechanism called MPU available on some new ARM Cortex-M microcontrollers" is a device which lets the operating system define up to eight memory regions (sixteen on the M7), optionally with holes in them. In each region, permissions can be set for read, write, and execute, and the policy for cacheing and sharing between cores can be controlled (although this is presumably not really relevant for single-core microcontrollers).
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/B…
https://blog.feabhas.com/2013/02/setting-up-the-cortex-m34-armv7-m-mem…
It's a bit like a normal MMU bit without virtual memory.
zackmorris · 2023-10-02
The only modern language that gets it right is Swift:
Apple did a fairly good job with unicode string handling starting in Cocoa and Objective-C, by providing methods to get the number of code points and/or bytes:
https://stackoverflow.com/questions/15582267/cfstring-count-of-charact…
I feel that this support of both character count and buffer size in bytes is probably the way to go. But Python 3 went wrong by trying to abstract it away with encodings that have unintuitive pitfalls that broke compatibility with Python 2:
https://blog.feabhas.com/2019/02/python-3-unicode-and-byte-strings/
There's also the normalization issue. Apple goofed (IMHO) when they used NFD in HFS+ filenames while everyone else went with NFC, but fixed that in APFS:
https://unicode.org/faq/normalization.html
https://medium.com/@sthadewald/the-utf-8-hell-of-mac-osx-feef5ea42407
sargstuff · 2022-04-06
Is't spagetti code a design pattern?
One can make use of design patterns, clean code and separation of concerns and still get working spaghetti code without all the hacky stuff.
Much less effort if use C.
Engineered C case studies as goto solutions!
https://blog.feabhas.com/2017/02/abusing-c-switch-statement-beauty-eye…
https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
Just have to impliment the program as if it was an OS. aka mix/match abstraction levels!
Mix/match assembler / language macros / foreign language calls to other language libraries
Use C20 ability to assign case statement(s) to a thread (mixed with remote procedure calling and/or function stacks across multiple threads)
Mix & match unicode/non-unicode, hex, ascii, etc. where text is code that can be run.
Mix and match C# language extensions in which same thing can be implimented different ways (e.g. strings, vectors, templating)