Click here to Skip to main content
15,877,103 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.

 
GeneralDigital film cartridge adds 20 MP micro 4/3 sensor to any 35 mm film camera Pin
RickZeeland10-Oct-23 0:08
mveRickZeeland10-Oct-23 0:08 
GeneralRe: Digital film cartridge adds 20 MP micro 4/3 sensor to any 35 mm film camera Pin
trønderen10-Oct-23 4:43
trønderen10-Oct-23 4:43 
GeneralRe: Digital film cartridge adds 20 MP micro 4/3 sensor to any 35 mm film camera Pin
RickZeeland10-Oct-23 5:59
mveRickZeeland10-Oct-23 5:59 
GeneralThe changing landscape of OOP (from class to struct) PinPopular
raddevus25-Sep-23 6:04
mvaraddevus25-Sep-23 6:04 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Greg Utas25-Sep-23 7:04
professionalGreg Utas25-Sep-23 7:04 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 8:11
mvaraddevus25-Sep-23 8:11 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Greg Utas25-Sep-23 13:24
professionalGreg Utas25-Sep-23 13:24 
GeneralRe: The changing landscape of OOP (from class to struct) PinPopular
Jeremy Falcon25-Sep-23 7:37
professionalJeremy Falcon25-Sep-23 7:37 
raddevus wrote:
Anyways, what do you think about this "Primitive Obsession code smell"?
It seems like the book author is someone trying to sound smarter than they are. Just because someone writes a book doesn't make them a genius. Now, I do agree that primitive obsession is bad, but so is struct obsession. A struct won't inherently prevent a coder from mistaking milliseconds for seconds (to borrow from this thread's example). But, what it does do is offer more complexity in an application that may otherwise not be needed.

A lot of these "new" ideas are just rehashed old ideas from JavaScript. I'm dead serious. It's just people looking for something to do rather than go outside. In JavaScript, some folks love to use an object as a parameter for everything. It's the loose and fast version of a struct in C#. It's just as ridiculous to expect an object as a single param in every last routine.

The problem is, the obsession or abuse of any one concept. Average coders take one little thing and run with it because it's the new shiny doodad. Abusing structs is no better. It's just change for change's sake while pretending to be smart. It's about balance.
raddevus wrote:
Step 4 Is Immutability
To the point of the book, to make each struct read only is a good idea. But, to the point of "prefer composition over inheritance", both Java and C# were literally designed with an OOP paradigm in mind. Move to a functional language if you want to start acting functional.

In regard to immutability, you can use a sealed class in Java and C# as well.

The irony is, all this struct talk is reminding me of C. People always said C sucked because it doesn't support classes. And yet, here we are. People just following the hype train because people looking to change something for no real gain and refuse to go outside. And I say this as a dude who loves functional programming, C# wasn't designed that way.
Jeremy Falcon


modified 25-Sep-23 14:06pm.

GeneralRe: The changing landscape of OOP (from class to struct) Pin
raddevus25-Sep-23 8:06
mvaraddevus25-Sep-23 8:06 
GeneralRe: The changing landscape of OOP (from class to struct) Pin
Jeremy Falcon25-Sep-23 8:13
professionalJeremy Falcon25-Sep-23 8:13 
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 
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 

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.