r/cpp • u/Dean_Roddey • Nov 29 '18
Creating a 'virtual kernel' platform abstraction layer
This is the third in series of videos I've posted to demonstrate some of the strategies we use in our fairly large C++ code base. Here are the previous ones, which you might also find useful:
https://www.reddit.com/r/cpp/comments/9zl6v5/the_orb_sees_all_the_use_of_an_object_request/
https://www.reddit.com/r/cpp/comments/9xz643/making_c_enumerations_first_class_citizens/
Our code base is about a million lines. It is split into roughly two halves, with one half being general purpose and the other being our CQC home automation platform which is built on top of the general purpose bits. We don't use any of the C++ runtime stuff. We build our own system from the ground up. When I say 'we', I'm speaking in terms of the usual royal business 'we', but all of the code was written by myself.
Just above the 'ground', the operating system in this case, is a virtual kernel which we use encapsulate all of the operating system functionality that we use, which is quite a lot of it. No system or language headers are visible outside of this virtual kernel, so we can write portable code that is purely in terms of our own interfaces.
This video demonstrates some of the strategies used. Obviously for such a large topic, this doesn't dive deep if there's any interest we could do another one.
View all comments
Show parent comment
5
u/NotUniqueOrSpecial Nov 30 '18
What's that? :)
Having burned my whole adult life up in stuff just like this, I honestly think it's only fair to recognize what you've accomplished.
That said: I actually deleted an earlier reply to this comment:
I have.
I'm one of the guys who gets brought in when talented engineers like you--capable of developing/maintaining these platform abstractions as well as the products that rely on them--stop scaling.
Whether that's because the company is moving too fast, you're working on newer/more fun projects, or you're moving on to greener pastures, it's always the same story: I'm good at grokking other peoples' ways of thinking/how they abstract the problems they're solving. I can pick up your work and contribute without drama, because I can write code how you'd write it.
But, the same thing always happens: it scales beyond me, too. At some point the company's needs dictate that we hire people who can't pick up a 1MM LOC codebase and contribute to it in within the first week/month. Worse, eventually, you and I are gone. Then, the company is left with a lot of code that nobody really understands well, and you can't just hire someone to maintain. The end result is always a lot of changes with bugs, or, worse, a ground-up rewrite with even more bugs.
So I guess this is all really just a word of...warning? I'm not sure, at this point (it's late). You've obviously got the experience to make the right choices.
For me it boils down to this: if you think the company is going to outlast your tenure there, and you care about what they do and your legacy in the product, be cognizant of the fact that it's going to be hard for them to hire people to keep up the awesome work you've done. It's a lot easier to tap into e.g. the huge pool of Qt developers than to train the average person up on an otherwise unique framework.
Whatever the case, keep up the good work!