You beat me to posting a summary thread. On Fri, 2009-05-01 at 09:17 +0200, Øyvind Harboe wrote: > We don't have a way to measure consensus but I belive the current > consensus can be summarized as: > > - OpenOCD stays C for now. There has to be a good plan and > major upside to budge the status quo.
I think the community also decided the C vs C99 debate in favor of C99. There seems to be genuine interest in using C++, but this debate will continue to rage on. While I see your claim, I raise you by claiming that "this trunk branch of OpenOCD will continue using C indefinitely; any future C++ efforts will emerge from a new trunk branch." Anything less fails to deliver a tangible social contract bullet point that users can bank on. We should not be wishy-washy with this issue; the words "for now" give false hope to those wanting to use C++ and fail to reassure those that want OpenOCD to remain C only. > - OpenOCD has a number of quaint constructs that mimick features in > other languages(virtual function tables, exception handling, resource > trackinig, etc.). This is implemented through very loose conventions, > macros and such. A sensible use of e.g. C++ could get rid of those > "strange" constructs. On the subject of OOP, I did somewhat oversimplify when I said that C is imperative and C++ is object-oriented. The Linux kernel provides an excellent model for implementing object-oriented systems in C, but one must admit that C++ simply incorporates these tricks into the language. Those enhancements allow an expert to reduce development effort, but the important word here is "expert". One point that I failed to make is the learning curve of the two languages. The initial learning curve is much steeper for C++ than C, but mastery takes longer as well. I would say that learning how to write correct C++ systems as complex and efficient as equivalent C systems takes at least twice as long. Once one begins to master it, it can be faster and better for some tasks, but C++ is not a panacea. Ultimately, great C++ also requires mastery of C. Consider the number of patches that I have submitted to correct simple warnings and use standard language features in OpenOCD; what does that speak of this community's potential for working with a more complex language? I would be terrified to see OpenOCD switch gradually from C to C++, as I think it would become a incomprehensible soup of idioms from both languages. That said, I will be pushing for object-oriented C coding. Even my recent patches to add static keywords could be said to be a small move in that direction. The flash, JTAG, and ETM driver symbols have been encapsulated in their respective source files, exposing only their respective driver callback structures. There is room for more work to be done in this vein, and that work will be difficult in any language. Cheers, Zach P.S. My imperfect comparison of what I meant by C = imp and C++ == OOP: C C++ ------------ -------------- struct class void (*f)(void) inheritance/polymorphism T f(struct *) public/protected member functions static T f(struct *) private member functions Sure, you can use OO design in C; at the end of the day, the language is still imperative. C does not have inheritance, but you can fake it. C does not have classes, but you can fake them. And so on. _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development