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: TIL PinPopular
Jochen Arndt2-Feb-17 3:46
professionalJochen Arndt2-Feb-17 3:46 
GeneralRe: TIL Pin
Sander Rossel9-Feb-17 10:29
professionalSander Rossel9-Feb-17 10:29 
GeneralRe: TIL Pin
CDP180216-Feb-17 2:16
CDP180216-Feb-17 2:16 
GeneralRe: TIL Pin
Sander Rossel16-Feb-17 3:57
professionalSander Rossel16-Feb-17 3:57 
GeneralRe: TIL Pin
CDP180216-Feb-17 4:04
CDP180216-Feb-17 4:04 
GeneralMVVM Pin
Bernhard Hiller1-Feb-17 4:21
Bernhard Hiller1-Feb-17 4:21 
GeneralRe: MVVM Pin
Pete O'Hanlon1-Feb-17 5:57
mvePete O'Hanlon1-Feb-17 5:57 
GeneralRe: MVVM Pin
kdmote2-Feb-17 5:09
kdmote2-Feb-17 5:09 
OK, I'm going to dive in here and expose my ignorance. I'm quite new to MVVM -- been working with it for less than a month -- and I understand the objectives of "Separation of Concerns", but it is not obvious to me why this code is facepalm. Could you walk me through an example of how this particular design might cause problems down the line?

On a similar note, I was recently describing "pure MVVM" to a colleague and I found myself struggling to provide a compelling reason to avoid all code-behind. He asked, "what difference does it make if I bind to objects in the code-behind rather than to objects in a separate 'ViewModel' class?"

Troelsen's sixth edition of "Pro C# 5.0" (published in 2012) has 3 or 4 chapters on WPF, but doesn't even mention MVVM or ViewModels, and instead puts all code in the codebehind. Help me understand why this is so problematic.

GeneralRe: MVVM Pin
Gerry Schmitz2-Feb-17 6:12
mveGerry Schmitz2-Feb-17 6:12 
GeneralRe: MVVM Pin
Pete O'Hanlon2-Feb-17 6:25
mvePete O'Hanlon2-Feb-17 6:25 
GeneralRe: MVVM Pin
kdmote2-Feb-17 7:46
kdmote2-Feb-17 7:46 
GeneralRe: MVVM Pin
Dominic Burford14-Feb-17 2:58
professionalDominic Burford14-Feb-17 2:58 
GeneralRe: MVVM Pin
Pete O'Hanlon14-Feb-17 4:29
mvePete O'Hanlon14-Feb-17 4:29 
GeneralRe: MVVM Pin
Dominic Burford14-Feb-17 5:47
professionalDominic Burford14-Feb-17 5:47 
GeneralRe: MVVM PinPopular
Clifford Nelson1-Feb-17 6:59
Clifford Nelson1-Feb-17 6:59 
GeneralRe: MVVM Pin
Bernhard Hiller1-Feb-17 21:09
Bernhard Hiller1-Feb-17 21:09 
GeneralRe: MVVM Pin
Sander Rossel1-Feb-17 12:53
professionalSander Rossel1-Feb-17 12:53 
GeneralRe: MVVM Pin
johannesnestler1-Feb-17 22:11
johannesnestler1-Feb-17 22:11 
GeneralRe: MVVM PinPopular
mbb011-Feb-17 23:18
mbb011-Feb-17 23:18 
GeneralRe: MVVM Pin
Member 113540342-Feb-17 12:06
Member 113540342-Feb-17 12:06 
GeneralRe: MVVM Pin
Brady Kelly2-Feb-17 2:55
Brady Kelly2-Feb-17 2:55 
GeneralRe: MVVM Pin
Gerry Schmitz2-Feb-17 5:57
mveGerry Schmitz2-Feb-17 5:57 
GeneralRe: MVVM Pin
Arlo Weston3-Feb-17 0:49
Arlo Weston3-Feb-17 0:49 
GeneralRe: MVVM Pin
Dennis_E13-Feb-17 22:37
professionalDennis_E13-Feb-17 22:37 
GeneralRe: MVVM Pin
Nelek14-Feb-17 7:23
protectorNelek14-Feb-17 7:23 

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.