Click here to Skip to main content
15,113,131 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 3:51
MemberMatt Bond14-Jan-21 3:51 
GeneralRe: OO Software design epiphany - it might not matter Pin
davercadman14-Jan-21 4:00
Memberdavercadman14-Jan-21 4:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
obermd14-Jan-21 4:48
Memberobermd14-Jan-21 4:48 
GeneralRe: OO Software design epiphany - it might not matter Pin
Adam O'Neil (Travelers Rest, SC)14-Jan-21 4:49
MemberAdam O'Neil (Travelers Rest, SC)14-Jan-21 4:49 
GeneralRe: OO Software design epiphany - it might not matter Pin
davila a.k.a. Member 1490950114-Jan-21 4:58
Memberdavila a.k.a. Member 1490950114-Jan-21 4:58 
GeneralRe: OO Software design epiphany - it might not matter Pin
Rusty Bullet14-Jan-21 6:23
MemberRusty Bullet14-Jan-21 6:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Chris Boss14-Jan-21 7:08
professionalChris Boss14-Jan-21 7:08 
GeneralRe: OO Software design epiphany - it might not matter Pin
SeattleC++14-Jan-21 7:09
MemberSeattleC++14-Jan-21 7: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 7:18
MemberDale Barnard14-Jan-21 7:18 
GeneralRe: OO Software design epiphany - it might not matter Pin
sasadler14-Jan-21 8:00
Membersasadler14-Jan-21 8:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
Paul Gehrman14-Jan-21 18:23
MemberPaul Gehrman14-Jan-21 18:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Member 289602014-Jan-21 18:24
MemberMember 289602014-Jan-21 18:24 
GeneralRe: OO Software design epiphany - it might not matter Pin
KateAshman15-Jan-21 6:26
MemberKateAshman15-Jan-21 6:26 
GeneralRe: OO Software design epiphany - it might not matter Pin
BotReject18-Jan-21 5:30
MemberBotReject18-Jan-21 5:30 
GeneralRe: OO Software design epiphany - it might not matter Pin
charlieg22-Jan-21 12:56
Membercharlieg22-Jan-21 12:56 
GeneralRe: OO Software design epiphany - it might not matter Pin
Martin ISDN1-Feb-21 9:18
MemberMartin ISDN1-Feb-21 9:18 
GeneralHorror videos on youtube! Pin
CodeWraith13-Jan-21 5:05
MemberCodeWraith13-Jan-21 5:05 
GeneralRe: Horror videos on youtube! Pin
OriginalGriff13-Jan-21 5:13
mveOriginalGriff13-Jan-21 5:13 
GeneralRe: Horror videos on youtube! Pin
CodeWraith13-Jan-21 5:42
MemberCodeWraith13-Jan-21 5:42 
GeneralRe: Horror videos on youtube! Pin
dandy7213-Jan-21 5:50
Memberdandy7213-Jan-21 5:50 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 5:24
professionalden2k8813-Jan-21 5:24 
GeneralRe: Horror videos on youtube! Pin
CodeWraith13-Jan-21 6:10
MemberCodeWraith13-Jan-21 6:10 
GeneralRe: Horror videos on youtube! Pin
Daniel Pfeffer13-Jan-21 6:28
professionalDaniel Pfeffer13-Jan-21 6:28 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 6:38
professionalden2k8813-Jan-21 6:38 
GeneralRe: Horror videos on youtube! Pin
Kris Lantz13-Jan-21 6:39
professionalKris Lantz13-Jan-21 6: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.