Click here to Skip to main content
15,885,141 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: organizing everything visible on screen Pin
Greg Utas7-Aug-22 7:11
professionalGreg Utas7-Aug-22 7:11 
GeneralRe: organizing everything visible on screen Pin
Calin Negru7-Aug-22 18:18
Calin Negru7-Aug-22 18:18 
GeneralRe: organizing everything visible on screen Pin
Gerry Schmitz7-Aug-22 7:06
mveGerry Schmitz7-Aug-22 7:06 
GeneralRe: organizing everything visible on screen Pin
Calin Negru7-Aug-22 20:07
Calin Negru7-Aug-22 20:07 
GeneralRe: organizing everything visible on screen Pin
Greg Utas8-Aug-22 0:47
professionalGreg Utas8-Aug-22 0:47 
GeneralRe: organizing everything visible on screen Pin
Gerry Schmitz8-Aug-22 7:23
mveGerry Schmitz8-Aug-22 7:23 
GeneralRe: organizing everything visible on screen Pin
trønderen8-Aug-22 8:28
trønderen8-Aug-22 8:28 
GeneralRe: organizing everything visible on screen Pin
trønderen8-Aug-22 8:10
trønderen8-Aug-22 8:10 
Calin Cali wrote:
I`m curious to know, c++ hasn`t been around since forever, how was this problem dealt with in the C days?
Even the original 1970 Pascal provided a simple polymorphism, through "variant records".

In my first university level programming class, in 1977, the professor made some requirements not mandated by the language:
All data shall be put into Pascal RECORD variables - or class instances, if you like - representing a set of related property values.
All functions/procedures shall take a RECORD instance as its first parameter (although the formal parameter could be named anything descriptive, not just 'this').
Functions/procedures taking a RECORD type R as its first parameter shall be the only ones to modify an R record, and only the instance supplied as first parameter.
The RECORD type declaration shall be followed by all the functions/procedures taking this record type as first parameter.
If one object type is a special case of another one, embed the general RECORD type as the first field in the larger RECORD. For simpler subtype cases, we could use the variant record mechanism.

When C++ arrived 8 years later, we changed 'RECORD' to 'class', moved the closing brace down to after the function declarations, changed 'operation(object, ...' to 'object.operation(...' and changed uses 'object.field' to 'this.field' (or only 'field'). Where subclassing and inheritance was used, the first field type name was moved to a parent class reference in the class definition and the name of the parent class field deleted (e.g. from MyBus.Vehicle.Numberplate to MyBus.Numberplate.) There really wasn't that much change in the programming style, mostly rather minor syntax adjustments.

Obviously, our OO style of plain Pascal programming didn't provide all the mechanisms of today's C++ (nor did the first C++!). No abstract classes, no overloading, ... But we did have multiple inheritance! Smile | :)

(Another but not OO-related requirement this professor made: In any function / routine / method parameter list, the read only input parameters come first, out parameters and references that are modified comes last. To this day, when I see code breaking this rule, I find it terribly confusing and want to edit the order, regardless of who owns the code!)

We never called it 'object oriented' in those days. Nor did those programming the first OS I had source code access to, programmed in a near-assembler-level language in the early 1970s. I saw it after I had learnt C++, and recognized the sub/superclass structures, abstract classes, virtual functions ... except that it was laid out 'by hand' in memory word by word, and the function pointer tables was addressed 'by hand' as the C++ compiler would have done it. When I presented my academic view on it, the old developers shrugged: Well, but this isn't high level language.

In other words: C++ certainly did not invent OO - it just was the first successful attempt to give OO a widely accepted language syntax. (Simula 67 and Smalltalk 72 was less long-term successful in the marketplace.)
GeneralRe: organizing everything visible on screen Pin
Mohsin Ali Shah 202222-Aug-22 3:48
Mohsin Ali Shah 202222-Aug-22 3:48 
AnswerRe: organizing everything visible on screen Pin
Member 150787168-Aug-22 16:17
Member 150787168-Aug-22 16:17 
QuestionSecuring oAuth Client Id and Secret Pin
Kevin Marois27-Jun-22 7:29
professionalKevin Marois27-Jun-22 7:29 
AnswerRe: Securing oAuth Client Id and Secret Pin
jschell23-Oct-22 11:17
jschell23-Oct-22 11:17 
Questioncode organisation Pin
Calin Negru31-Jan-22 7:36
Calin Negru31-Jan-22 7:36 
AnswerRe: code organisation Pin
Bohdan Stupak4-Feb-22 4:05
professionalBohdan Stupak4-Feb-22 4:05 
AnswerRe: code organisation Pin
Richard MacCutchan4-Feb-22 4:56
mveRichard MacCutchan4-Feb-22 4:56 
GeneralRe: code organisation Pin
Calin Negru4-Feb-22 8:48
Calin Negru4-Feb-22 8:48 
GeneralRe: code organisation Pin
jschell17-Feb-22 11:12
jschell17-Feb-22 11:12 
GeneralRe: code organisation Pin
Calin Negru19-Feb-22 1:39
Calin Negru19-Feb-22 1:39 
GeneralRe: code organisation Pin
jeron119-Feb-22 7:03
jeron119-Feb-22 7:03 
GeneralRe: code organisation Pin
Calin Negru19-Feb-22 8:10
Calin Negru19-Feb-22 8:10 
GeneralRe: code organisation Pin
Richard MacCutchan19-Feb-22 21:44
mveRichard MacCutchan19-Feb-22 21:44 
GeneralRe: code organisation Pin
Calin Negru25-Feb-22 9:41
Calin Negru25-Feb-22 9:41 
GeneralRe: code organisation Pin
Richard MacCutchan25-Feb-22 22:17
mveRichard MacCutchan25-Feb-22 22:17 
GeneralRe: code organisation Pin
Calin Negru26-Feb-22 0:14
Calin Negru26-Feb-22 0:14 
GeneralRe: code organisation Pin
Richard MacCutchan26-Feb-22 1:03
mveRichard MacCutchan26-Feb-22 1:03 

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.