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

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Nondestructive mutation: tell me about a time Pin
raddevus18-Aug-23 2:38
mvaraddevus18-Aug-23 2:38 
GeneralRe: Nondestructive mutation: tell me about a time Pin
Graeme_Grant18-Aug-23 2:53
mvaGraeme_Grant18-Aug-23 2:53 
GeneralRe: Nondestructive mutation: tell me about a time Pin
Davyd McColl17-Aug-23 22:29
Davyd McColl17-Aug-23 22:29 
GeneralRe: Nondestructive mutation: tell me about a time Pin
raddevus18-Aug-23 2:50
mvaraddevus18-Aug-23 2:50 
GeneralRe: Nondestructive mutation: tell me about a time Pin
obermd18-Aug-23 3:40
obermd18-Aug-23 3:40 
GeneralRe: Nondestructive mutation: tell me about a time Pin
jochance18-Aug-23 5:53
jochance18-Aug-23 5:53 
GeneralRe: Nondestructive mutation: tell me about a time Pin
Member 1194113118-Aug-23 13:05
Member 1194113118-Aug-23 13:05 
GeneralRe: Nondestructive mutation: tell me about a time Pin
Andrei Bozantan19-Aug-23 1:57
Andrei Bozantan19-Aug-23 1:57 
This feature is useful to avoid all kind of bugs related to the usage of mutable values with multiple ownership shared through references.

Think about scenarios when a method 'foo' receives an object as an input parameter. The initial contract is that the object's fields are not changed inside 'foo' . In a big codebase there would be many places where 'foo' becomes used over time, with the semantics of not changing the fields of the input object. If at some point someone makes a change in 'foo' to mutate one of the fields, this could cause many non obvious problems. In practice, in complex codebases these problems might be difficult to detect in a code review.

Immutable types and non destructive mutation provide a solution to better express this kind of semantic.
If you can't explain something to a six year old, you really don't understand it yourself. (Albert Einstein)

GeneralWSO CCC OTD 2023-08-17 Pin
OriginalGriff16-Aug-23 21:30
mveOriginalGriff16-Aug-23 21:30 
GeneralRe: WSO CCC OTD 2023-08-17 Pin
pkfox16-Aug-23 21:55
professionalpkfox16-Aug-23 21:55 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
OriginalGriff16-Aug-23 22:10
mveOriginalGriff16-Aug-23 22:10 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
pkfox16-Aug-23 22:13
professionalpkfox16-Aug-23 22:13 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
OriginalGriff16-Aug-23 22:22
mveOriginalGriff16-Aug-23 22:22 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
Rich Leyshon16-Aug-23 22:14
Rich Leyshon16-Aug-23 22:14 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
OriginalGriff16-Aug-23 22:19
mveOriginalGriff16-Aug-23 22:19 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
pkfox16-Aug-23 22:34
professionalpkfox16-Aug-23 22:34 
GeneralRe: WSO CCC OTD 2023-08-17 - we have a winner! Pin
Rich Leyshon16-Aug-23 22:39
Rich Leyshon16-Aug-23 22:39 
GeneralAmazing music video graphics Pin
David O'Neil16-Aug-23 20:57
professionalDavid O'Neil16-Aug-23 20:57 
GeneralRe: Amazing music video graphics Pin
Slacker00717-Aug-23 0:03
professionalSlacker00717-Aug-23 0:03 
GeneralRe: Amazing music video graphics Pin
jmaida17-Aug-23 11:30
jmaida17-Aug-23 11:30 
GeneralRe: Amazing music video graphics Pin
David O'Neil17-Aug-23 17:26
professionalDavid O'Neil17-Aug-23 17:26 
GeneralRe: Amazing music video graphics Pin
jmaida17-Aug-23 17:32
jmaida17-Aug-23 17:32 
GeneralRe: Amazing music video graphics Pin
jmaida20-Aug-23 17:58
jmaida20-Aug-23 17:58 
GeneralRe: Amazing music video graphics Pin
jmaida18-Aug-23 15:18
jmaida18-Aug-23 15:18 
GeneralRe: Amazing music video graphics Pin
David O'Neil18-Aug-23 19:18
professionalDavid O'Neil18-Aug-23 19:18 

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.