Weekly breakdown – 22w49d1

Programming

https://faultlore.com/blah/c-isnt-a-language/

Have you ever had luck/cry/luck to maintain C++ ABI compatibility between different linkable codebases, and found it fun? 🙂

The more I worked with C, the more quirks popped up. Some fun, some not-so-much.

This text is a must read to anyone trying to maintain compatibility between platforms with useful insights from the wild.

And very rare praise to Microsoft as de-facto kings in platform backward compatibility.

https://stackoverflow.com/questions/7825055/what-does-the-operator-do-in-c

While we are still on C language and its quirks, what ??!??! operator does in C? 🙂

I would not be surprised if this popped up as a question on ‘good’ interviews, which I would like to steer clear.

Recommended Tools

https://github.com/include-what-you-use/include-what-you-use

I came across this tool long time ago and found it quite handy, especially when working in C++ codebase.

Why? It has potential to one-time reduce your compile time insanely, by just removing include lines that have zero references from current code.
This is quite handy in C++ to limit number of translation units to be compiled, especially when small change in one header triggers big-but-unnecessary re-compilation chain.
And there is insane amount of header-only libraries or code-heavy headers that will exponentially fast increase compile time if not being careful what you include.

News

https://www.theregister.com/2022/10/31/opinion_column_relevance_in_business/

Interesting opinion about staying relevant with FOSS.

Weekly breakdown – 22w36d2

Programming

https://utcc.utoronto.ca/~cks/space/blog/programming/CAPIsEffectsOfMalloc

Important reminder to anyone writing C APIs and for the ones learning to use it.
It is also major source of security and stability issues when not handled correctly.
As a helpful guide when writing complex C APIs:

  • Explicitly define ownership of handled memory AND memory lifetime in API documentation
  • Always sanitize and check for correctness input parameters to API
  • Provide both at least one happy-case and multiple negative examples for using the API before any release
    When writing them, try to ask yourself what you would ask Stackoverflow 🙂
    This will help you understand usage patterns

    Note: The easiest part is to create an API, the hardest is to change it in production.

https://thephd.dev/c23-is-coming-here-is-what-is-on-the-menu

Finally the C language it getting proper modern ‘face-lift’ that will potentially help and alleviate bunch of manual work and increase quality of written code.
Lets see if it will fizzle-out, or it will gain traction (looking at you, compiler vendors 😉 ).

https://docs.google.com/document/d/16B36r0HksR0LqQAGLA1syYCtZvYaVC0hEF2D00ZAd0o/view#

Highly informative document for anyone switching between C and C++ and pitfalls of using same or similar approaches from one language into another.

https://luckyresistor.me/knowledge/learn-cpp/

To anyone interested in learning C++, with focus on usage in embedded environment.
Good comments especially valid to all related constraints and best practices for embedded implementation.

Fun

https://matthewbilyeu.com/blog/2022-09-01/responding-to-recruiter-emails-with-gpt-3

Fun use of GPT-3 to automate ‘handling’ of recruiter messaging 🙂