Click here to Skip to main content
15,887,027 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 8:35
mvaraddevus25-Sep-23 8:35 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon25-Sep-23 12:26
professionalJeremy Falcon25-Sep-23 12:26 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Nelek27-Sep-23 9:06
protectorNelek27-Sep-23 9:06 
QuestionRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 11:59
professionalJeremy Falcon27-Sep-23 11:59 
AnswerRe: The changing landscape of OOP (from class to struct) Pin
Nelek28-Sep-23 10:06
protectorNelek28-Sep-23 10:06 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Matt Bond27-Sep-23 4:37
Matt Bond27-Sep-23 4:37 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen25-Sep-23 9:59
trønderen25-Sep-23 9:59 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen25-Sep-23 8:41
trønderen25-Sep-23 8:41 
Jeremy Falcon wrote:
The irony is, all this struct talk is reminding me of C.
In my first University level programming class, Pascal was the programming language. We were taught a programming discipline where all attributes relating to a phenomenon (such as a physical object) where put together in a struct. All manipulation of variables of a given struct type were done by a set of functions and procedures (those are the Pascal terms) declared together with the struct type definition. All functions / procedures should take a pointer to a struct as its first argument.

The course included creating general struct types, and including these in more specialized substruct types adding more attributes. It also included handling polymorphic types, using the variant structure facility of Pascal.

I took this first course in object oriented use of Pascal structs (no, we didn't label it as such!) in the fall of 1977.

When OO arrived (C++ in 1985), we moved the first argument - the struct pointer - to make a prefix to the function / procedure name, with a separating dot. The biggest change was the OO term, and starting to say 'method' rather than function / procedure. Sub/superclasses, polymorphism and a general OO mindset had been in place for several years; we just didn't know it by that name.

So quite fancy use of structs for creating objects / blackboxed types has at least 45 years on its back. Back then, some of it relied on programming discipline, not compiler support - but use of structs to create distinct types, as the book author suggests, doesn't really have any compiler support at the concept level, either.
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 10:15
mvaraddevus25-Sep-23 10:15 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Rick York25-Sep-23 10:25
mveRick York25-Sep-23 10:25 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Nelek27-Sep-23 9:08
protectorNelek27-Sep-23 9:08 
PraiseRe: The changing landscape of OOP (from class to struct) Pin
Gary Wheeler27-Sep-23 1:36
Gary Wheeler27-Sep-23 1:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 2:36
professionalJeremy Falcon27-Sep-23 2:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Chris Baker 202127-Sep-23 8:36
Chris Baker 202127-Sep-23 8:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 11:58
professionalJeremy Falcon27-Sep-23 11:58 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
k505427-Sep-23 12:20
mvek505427-Sep-23 12:20 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 15:14
professionalJeremy Falcon27-Sep-23 15:14 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen25-Sep-23 8:13
trønderen25-Sep-23 8:13 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 8:29
mvaraddevus25-Sep-23 8:29 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
haughtonomous26-Sep-23 21:53
haughtonomous26-Sep-23 21:53 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee25-Sep-23 10:26
professionalJon McKee25-Sep-23 10:26 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 10:36
mvaraddevus25-Sep-23 10:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon25-Sep-23 12:33
professionalJeremy Falcon25-Sep-23 12:33 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee26-Sep-23 9:53
professionalJon McKee26-Sep-23 9:53 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon25-Sep-23 12:33
professionalJeremy Falcon25-Sep-23 12:33 

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.