LWN.net Logo

Object-oriented design patterns in the kernel, part 1

Object-oriented design patterns in the kernel, part 1

Posted Jun 1, 2011 22:43 UTC (Wed) by oak (guest, #2786)
In reply to: Object-oriented design patterns in the kernel, part 1 by pr1268
Parent article: Object-oriented design patterns in the kernel, part 1

C is IMHO also typically easier to debug as function names are typed in full (= easier to grep/find from large code base) and their meaning doesn't mutate with inheritance / overloading.

From reading the C++ code you cannot guess what innocent looking lines do, I've seen (bad) C++ programs that malloc() all together nearly 1MB of RAM before they even enter main(), due to there being static objects and their constructors creating innocent looking other object(s) that turn out not to be integers... (And btw. C++ ABI actually defines classes to have several constructors for different purposes, although source code has only one)

Debugging problems at HW level is already hard, making it harder by selecting too complex language doesn't help.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds