Forums

OOP and OOD for senior C-style embedded software engineers

Started by like2learn October 4, 2010
We have a few embedded software engineers who had worked on embedded
application for many years with C. Now we decide to switch to C++ and
adopt OOP and OOD in our next generation firmware. Although most of us
have some kind of knowledge toward C++/OOP/OOD, none of us was
formally trained before. Are there any good books or online tutorials
that you can introduce to us? Free downloadable materials are highly
appreciated, however, we are OK to buy some books as well.

Thank you!
On Oct 4, 11:49=A0am, like2learn <gpsabo...@yahoo.com> wrote:

> adopt OOP and OOD in our next generation firmware. Although most of us > have some kind of knowledge toward C++/OOP/OOD, none of us was > formally trained before. Are there any good books or online tutorials
The difficulty with self-training here is that you are all reading the same materials and likely will make the same mistakes. There is some distance between "read about OOP" and "experienced OO developer". The usual approach is to send one or two people for formal training where they can get feedback on their efforts from actual knowledgeable people. Then they come back to the office and spread their knowledge. Otherwise it is the blind leading the blind...
On 04.10.2010 17:49, like2learn wrote:
> We have a few embedded software engineers who had worked on embedded > application for many years with C. Now we decide to switch to C++ and > adopt OOP and OOD in our next generation firmware.
That feels rather a lot like you're about to bite off more than you can chew. Introducing a switch of language _and_ of design paradigm in a single, large step is a whole lot of change at once. You may be better off splitting this in two independent moves. E.g. you could replace the language now, but stick with conventional design paradigm, for the time being. Introduce OOD later, slowly. Among other things, that'll give you time to, like Lewin outlined, build up knowledge by formally training some key players.
On 10/04/2010 02:44 PM, Hans-Bernhard Br&#2013266166;ker wrote:
> On 04.10.2010 17:49, like2learn wrote: >> We have a few embedded software engineers who had worked on embedded >> application for many years with C. Now we decide to switch to C++ and >> adopt OOP and OOD in our next generation firmware. > > That feels rather a lot like you're about to bite off more than you can > chew. Introducing a switch of language _and_ of design paradigm in a > single, large step is a whole lot of change at once. > > You may be better off splitting this in two independent moves. E.g. you > could replace the language now, but stick with conventional design > paradigm, for the time being. Introduce OOD later, slowly. Among other > things, that'll give you time to, like Lewin outlined, build up > knowledge by formally training some key players.
Normally I'd disagree with you, but C++ is practically C with extensions to ease OO programming. So if you try to do OO development with C instead of C++ you'll get frustrated at bending over backwards to use a procedural language to do OO when there's C++ just waiting to be used. Conversely, using C++ without using those OO extensions isn't going to be much different than changing your .c files to .cpp and cleaning up any compiler incompatibilities. I can only agree with introducing OOD slowly. I was at a company that transitioned from traditional C methods to C++, and it was done in a more or less slow and controlled manner*. So we started with a board that had a whole bunch of C code that had a well-defined and isolated set of functionality done in C++, then one board in a system that was done using C++, then finally we started using C++ throughout the system. One hiccup that we discovered was that after I and the other engineer had done the "all C++" board and done well with it, a new project manager let a new engineering team jump on the C++ bandwagon. The team went on to demonstrate conclusively that C++ code that's written in too much of a hurry could be just as much of a millstone around a company's neck as C code written under the same circumstances. * Excepting the fact that I was the one that did the first "all C++" program in the joint, and it didn't occur to me to tell my manager that's what I was doing -- ah, youth. Given that most of it was just an existing set of C files with their extensions renamed, and only the functionality that I was adding was what was actually changed, I got away with it. After that, I made sure that management had been informed and signed on -- however reluctantly -- before I proceeded. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
"like2learn" <gpsabove2@yahoo.com> wrote in message 
news:6050617d-872a-41af-bdc6-5fc16ee20a03@t20g2000yqa.googlegroups.com...
> We have a few embedded software engineers who had worked on embedded > application for many years with C. Now we decide to switch to C++ and > adopt OOP and OOD in our next generation firmware. Although most of us > have some kind of knowledge toward C++/OOP/OOD, none of us was > formally trained before. Are there any good books or online tutorials > that you can introduce to us? Free downloadable materials are highly > appreciated, however, we are OK to buy some books as well.
Book: "Accelerated C++: Practical Programming by Example" by Andrew Koenig and Barbara E. Moo. Leo Havm&#2013266168;ller.
On 04/10/2010 17:49, like2learn wrote:
> We have a few embedded software engineers who had worked on embedded > application for many years with C. Now we decide to switch to C++ and > adopt OOP and OOD in our next generation firmware. Although most of us > have some kind of knowledge toward C++/OOP/OOD, none of us was > formally trained before. Are there any good books or online tutorials > that you can introduce to us? Free downloadable materials are highly > appreciated, however, we are OK to buy some books as well. > > Thank you!
Other suggestions you've had here about courses and more formal training are good ideas - this is just an extra comment. A lot of "C++" books talk about "C/C++" as though they were basically the same language, and teach on the basis of C first, then adding classes and OOP as a sort of C++ extra. This is, IMHO, completely the wrong way to go about it. Bjarne Stroustrup's own "The C++ Programming Language" is an example of the correct way to handle it - it teaches C++ and OOP from the start, with C-level coding as just an implementation detail. So if you are looking at books, I'd throw out anything that uses the phrase C/C++ at the start, and then throw out anything that doesn't deal with classes in the first chapter.
like2learn wrote:
> We have a few embedded software engineers who had worked on embedded > application for many years with C. Now we decide to switch to C++ and > adopt OOP and OOD in our next generation firmware. Although most of us
(sigh) This is probably a (big?) mistake. It would be like setting out to write your first *novel* and opting to do it in a language that you don't yet know. :-/ Learn the object paradigm, first. Even if it is with some *other* language. Note that you need not master things like inheritance, etc. but thinking about something in an object-oriented manner instead of procedurally is an essential first step (IMO). Once you have a feel for what it is like to think about objects (and, how to *design* objects), you'll be better equipped to tackle C++'s approach to objects. Note that the reverse approach is, IMO, useless (i.e., learning C++ and *then* learning OO) -- unless you don't already know C. It's too small of a "step" to be worth the effort. And, having the OO background behind you will give you a better appreciation for some of the syntax issues, etc. *After* all of that, _The Design and Evolution of C++_ (Stroustrup) is a wood read -- but, only *afterwards* so you can fully appreciate the issues discussed (and, so you can recognize the errors/typos in the text :-/ ).
> have some kind of knowledge toward C++/OOP/OOD, none of us was > formally trained before. Are there any good books or online tutorials > that you can introduce to us? Free downloadable materials are highly > appreciated, however, we are OK to buy some books as well.
If you are intent on your original plan of action, be prepared for some big-time consequences (huge project delays, lots of bugs, etc.) -- of a severity that *someone* will lose their job (or "standing")!
D Yuniskis wrote:

> *After* all of that, _The Design and Evolution of C++_ > (Stroustrup) is a wood read -- but, only *afterwards* so
s/wo/go/
> you can fully appreciate the issues discussed (and, so you > can recognize the errors/typos in the text :-/ ).
<SEG> as above. Hey, it's too early in the morning for proper spelling! :-/

like2learn wrote:

> We have a few embedded software engineers who had worked on embedded > application for many years with C. Now we decide to switch to C++ and > adopt OOP and OOD in our next generation firmware. Although most of us > have some kind of knowledge toward C++/OOP/OOD, none of us was > formally trained before. Are there any good books or online tutorials > that you can introduce to us? Free downloadable materials are highly > appreciated, however, we are OK to buy some books as well.
It is strange to hear that kind of thing from someone who calls himself a 'senior' programmer. You got it from entirely wrong prospective. Using a different programming language is no more then writing using a pen of a different color. It doesn't matter at all as long as you know how to write and what has to be written. C++/OOP is just a small matter of convenience, and it is in no way replacement for brains and common sense. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky wrote:

> It is strange to hear that kind of thing from someone who calls himself > a 'senior' programmer. You got it from entirely wrong prospective. Using > a different programming language is no more then writing using a pen of > a different color. It doesn't matter at all as long as you know how to > write and what has to be written. C++/OOP is just a small matter of > convenience, and it is in no way replacement for brains and common sense.
A different programming language is a lot more than just a pen of a different color, because each language has its programming style idioms: E.g. a Lisp programmer, who wants to program in C++ like writing Lisp programs are written, and vice versa, won't be happy. And C++ is a huge language. Even experiences programmers need some time to learn all the syntax quirks and pitfalls :-) -- Frank Buss, http://www.frank-buss.de piano and more: http://www.youtube.com/user/frankbuss