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
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 
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 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 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jon McKee26-Sep-23 9:51
professionalJon McKee26-Sep-23 9:51 
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
Jon McKee28-Sep-23 14:17
professionalJon McKee28-Sep-23 14:17 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Richard Deeming25-Sep-23 22:02
mveRichard Deeming25-Sep-23 22:02 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen26-Sep-23 9:31
trønderen26-Sep-23 9:31 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon27-Sep-23 3:17
professionalJeremy Falcon27-Sep-23 3:17 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
RainHat26-Sep-23 0:02
RainHat26-Sep-23 0:02 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
charlieg26-Sep-23 7:42
charlieg26-Sep-23 7:42 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
trønderen26-Sep-23 9:47
trønderen26-Sep-23 9:47 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Nelek27-Sep-23 9:12
protectorNelek27-Sep-23 9: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.