Click here to Skip to main content
15,794,795 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
Nelek27-Sep-23 10:08
protectorNelek27-Sep-23 10:08 
PraiseRe: The changing landscape of OOP (from class to struct) Pin
Gary Wheeler27-Sep-23 2:36
Gary Wheeler27-Sep-23 2:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 3:36
professionalJeremy Falcon27-Sep-23 3:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Chris Baker 202127-Sep-23 9:36
Chris Baker 202127-Sep-23 9:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 12:58
professionalJeremy Falcon27-Sep-23 12:58 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
k505427-Sep-23 13:20
mvek505427-Sep-23 13:20 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 16:14
professionalJeremy Falcon27-Sep-23 16:14 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen25-Sep-23 9:13
trønderen25-Sep-23 9:13 
There were languages (in this case, CHILL might be an example) that allowed you do define incompatible types ('modes' in CHILL lore):

NEWMODE Weight = FLOAT, Distance = FLOAT;
DCL amountOfApples Weight, LondonToNewcastle Distance;

amountOfApples and LondonToNewcastle both have all the properties of a floating point value, but they cannot be added, multiplied, compared, ...

This is a much simpler and more obvious way to get that protection the book writer is aiming at. Implementing it in the compiler should be a trivial matter, and the runtime cost 0.0. Checking type compatibility between primitive types is pure compile time matter. (And I assure you: This one will not make any impact on compile time.)

General lament: There are so many grains of gold in old, phased-out technology. We should spend much more time checking if a problem already has an old, forgotten, but totally satisfactory solution, before we design a new one.
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 9:29
mvaraddevus25-Sep-23 9:29 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
haughtonomous26-Sep-23 22:53
haughtonomous26-Sep-23 22:53 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee25-Sep-23 11:26
professionalJon McKee25-Sep-23 11:26 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 11:36
mvaraddevus25-Sep-23 11:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon25-Sep-23 13:33
professionalJeremy Falcon25-Sep-23 13:33 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee26-Sep-23 10:53
professionalJon McKee26-Sep-23 10:53 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon25-Sep-23 13:33
professionalJeremy Falcon25-Sep-23 13:33 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee26-Sep-23 10:51
professionalJon McKee26-Sep-23 10:51 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 3:36
professionalJeremy Falcon27-Sep-23 3:36 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee28-Sep-23 15:17
professionalJon McKee28-Sep-23 15:17 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Richard Deeming25-Sep-23 23:02
mveRichard Deeming25-Sep-23 23:02 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen26-Sep-23 10:31
trønderen26-Sep-23 10:31 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 4:17
professionalJeremy Falcon27-Sep-23 4:17 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
RainHat26-Sep-23 1:02
RainHat26-Sep-23 1:02 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
charlieg26-Sep-23 8:42
charlieg26-Sep-23 8:42 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen26-Sep-23 10:47
trønderen26-Sep-23 10:47 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Nelek27-Sep-23 10:12
protectorNelek27-Sep-23 10:12 

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.