Click here to Skip to main content
15,884,628 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: OO Software design epiphany - it might not matter Pin
Matt Bond14-Jan-21 2:51
Matt Bond14-Jan-21 2:51 
GeneralRe: OO Software design epiphany - it might not matter Pin
davercadman14-Jan-21 3:00
davercadman14-Jan-21 3:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
obermd14-Jan-21 3:48
obermd14-Jan-21 3:48 
GeneralRe: OO Software design epiphany - it might not matter Pin
Adam O'Neil (Travelers Rest, SC)14-Jan-21 3:49
Adam O'Neil (Travelers Rest, SC)14-Jan-21 3:49 
GeneralRe: OO Software design epiphany - it might not matter Pin
davila a.k.a. Member 1490950114-Jan-21 3:58
davila a.k.a. Member 1490950114-Jan-21 3:58 
GeneralRe: OO Software design epiphany - it might not matter Pin
Rusty Bullet14-Jan-21 5:23
Rusty Bullet14-Jan-21 5:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Chris Boss14-Jan-21 6:08
professionalChris Boss14-Jan-21 6:08 
GeneralRe: OO Software design epiphany - it might not matter Pin
SeattleC++14-Jan-21 6:09
SeattleC++14-Jan-21 6:09 
I did a large embedded project in classic C++, a collection of a dozen devices communicating over IEEE-488 with a PC. Our project was very object-oriented. The project was code-named "brick" since we intended to stack devices together like bricks. Our use of OOP was very successful, though the product itself failed in the marketplace.

Code Reuse: Our previous similar project was coded in C, and it was a quarter-million lines of wet spaghetti that we were ordered to reuse. It, in turn, was the result of an order to reuse a previous C project. Attempts at reuse were an abject failure, and we wrote 100% new code for the brick. The old code was so undocumented and hard to read that we had to reverse-engineer the behavior of the hardware.

Inheritance: Code was successfully reused within the brick. Inheritance promotes factoring of common code into base classes rather than cut & pasting it.

We used a multiply-inherited polymorphic mixin to control communication between software subsystems. The mixin let us defer and change the decision about what code to execute on the PC and what code to execute on the brick. This was incredibly fortunate because the hardware part of the project went way behind schedule.

Polymorphism: One difference between the brick and the previous product was that in the brick, code could directly control hardware devices like A/D converters, where on the previous project, the hardware was accessed over a bit-parallel protocol using the PC's parallel printer port (uck). We were able to prototype and test a lot of hardware control code using the previous device's hardware. We had polymorphic classes with one derivation to communicate with the brick's hardware, and another to communicate with the old hardware. As I said before, this was very fortunate because the hardware was so late.

Issues: This project was long enough ago that a virtual function call was expensive. Performance was very important to us, so we worried about every virtual function.

Another issue was that the hardware of this project was mostly a big sequencer ASIC that ran its own programs written in a generic macro-assembler that we had repurposed. There was no getting around the fact that much of the code was one big-ass class with a zillion methods. Normally this would be bad style, but how do you factor hardware? The programs for this sequencer were things we absolutely had to reuse from previous projects, our "secret sauce" as it were.

We did not even understand the functioning of the sequencer. Nobody did. We had to reverse engineer it from reading the previous projects' spaghetti code and fragmentary documentation. So much for code reuse.

Our C++ compiler was far less than perfect. It mostly conformed to the ARM, but only the simplest templates worked at all. We learned to submit very detailed bug reports, with example code and citing chapter and verse of the ARM. I think we got to be their favorite customers, and got excellent turnaround on bug fixes as a result.

Summary: I think the whole team were satisfied with our use of C++, and with the performance of the software. I don't think that company ever went back to C after the brick.
GeneralRe: OO Software design epiphany - it might not matter Pin
Dale Barnard14-Jan-21 6:18
Dale Barnard14-Jan-21 6:18 
GeneralRe: OO Software design epiphany - it might not matter Pin
sasadler14-Jan-21 7:00
sasadler14-Jan-21 7:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
Paul Gehrman14-Jan-21 17:23
Paul Gehrman14-Jan-21 17:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Member 289602014-Jan-21 17:24
Member 289602014-Jan-21 17:24 
GeneralRe: OO Software design epiphany - it might not matter Pin
KateAshman15-Jan-21 5:26
KateAshman15-Jan-21 5:26 
GeneralRe: OO Software design epiphany - it might not matter Pin
BotReject18-Jan-21 4:30
BotReject18-Jan-21 4:30 
GeneralRe: OO Software design epiphany - it might not matter Pin
charlieg22-Jan-21 11:56
charlieg22-Jan-21 11:56 
GeneralRe: OO Software design epiphany - it might not matter Pin
Martin ISDN1-Feb-21 8:18
Martin ISDN1-Feb-21 8:18 
GeneralHorror videos on youtube! Pin
CodeWraith13-Jan-21 4:05
CodeWraith13-Jan-21 4:05 
GeneralRe: Horror videos on youtube! Pin
OriginalGriff13-Jan-21 4:13
mveOriginalGriff13-Jan-21 4:13 
GeneralRe: Horror videos on youtube! Pin
CodeWraith13-Jan-21 4:42
CodeWraith13-Jan-21 4:42 
GeneralRe: Horror videos on youtube! Pin
dandy7213-Jan-21 4:50
dandy7213-Jan-21 4:50 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 4:24
professionalden2k8813-Jan-21 4:24 
GeneralRe: Horror videos on youtube! Pin
CodeWraith13-Jan-21 5:10
CodeWraith13-Jan-21 5:10 
GeneralRe: Horror videos on youtube! Pin
Daniel Pfeffer13-Jan-21 5:28
professionalDaniel Pfeffer13-Jan-21 5:28 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 5:38
professionalden2k8813-Jan-21 5:38 
GeneralRe: Horror videos on youtube! Pin
Kris Lantz13-Jan-21 5:39
professionalKris Lantz13-Jan-21 5:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.