Click here to Skip to main content
15,892,005 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: One of the very few times I find myself liking Ruby/Rails syntax Pin
Marc Clifton26-Nov-19 12:07
mvaMarc Clifton26-Nov-19 12:07 
GeneralRe: One of the very few times I find myself liking Ruby/Rails syntax Pin
Dan Neely27-Nov-19 2:59
Dan Neely27-Nov-19 2:59 
GeneralRe: One of the very few times I find myself liking Ruby/Rails syntax Pin
Marc Clifton26-Nov-19 12:16
mvaMarc Clifton26-Nov-19 12:16 
JokeRe: One of the very few times I find myself liking Ruby/Rails syntax Pin
Rage26-Nov-19 22:44
professionalRage26-Nov-19 22:44 
GeneralRe: One of the very few times I find myself liking Ruby/Rails syntax Pin
ZurdoDev27-Nov-19 1:59
professionalZurdoDev27-Nov-19 1:59 
GeneralCodeDom users, what's your opinion? Pin
honey the codewitch26-Nov-19 8:45
mvahoney the codewitch26-Nov-19 8:45 
GeneralRe: CodeDom users, what's your opinion? Pin
TheGreatAndPowerfulOz26-Nov-19 9:09
TheGreatAndPowerfulOz26-Nov-19 9:09 
GeneralRe: CodeDom users, what's your opinion? Pin
Sander Rossel26-Nov-19 10:39
professionalSander Rossel26-Nov-19 10:39 
Excuse me while I'm going to spoon my eyes out with a blunt object Dead | X|

Can you maybe break it up into multiple lines?
Perhaps use multiple descriptive functions to build up the model?
Maybe even split it up in classes?
Something like:
C#
// This would change the inner state of CD.
// Although it would be sweet if it was immutable and just returned a new CD instead.
CD.AddStatement();

// First Create the if.
var ifStatement = CD.CreateIf(CD.NotEq(state, CD.Literal(_BeforeBegin)));
// Then create the else.
var elseStatement = CD.CreateElse(CD.Whatever);
// This is more readable because the if and else are not inline.
CD.AddIfElse(ifStatement, elseStatement);

// Maybe create an entire function just to add an if else?
AddSomeStatement(CD);

// Just to come back to the immutable idea.
// It would work with some decorator pattern, I guess, maybe.
CD = CD.AddStatement();
CD = CD.AddIfElse(ifStatement, elseStatement);
CD = AddSomeStatement(CD);
// CD.innerCD.innerCD...?
No idea if that would work, just spewing idea's here.
I did something like that once.
Maybe this will give you your "Eureka!" moment, maybe it won't.

GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch26-Nov-19 10:44
mvahoney the codewitch26-Nov-19 10:44 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek26-Nov-19 22:21
protectorNelek26-Nov-19 22:21 
GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch26-Nov-19 22:22
mvahoney the codewitch26-Nov-19 22:22 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek27-Nov-19 0:11
protectorNelek27-Nov-19 0:11 
GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch27-Nov-19 0:12
mvahoney the codewitch27-Nov-19 0:12 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek27-Nov-19 11:26
protectorNelek27-Nov-19 11:26 
GeneralRe: CodeDom users, what's your opinion? Pin
honey the codewitch27-Nov-19 11:28
mvahoney the codewitch27-Nov-19 11:28 
GeneralRe: CodeDom users, what's your opinion? Pin
Nelek27-Nov-19 19:03
protectorNelek27-Nov-19 19:03 
QuestionUnit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
MSBassSinger26-Nov-19 6:05
professionalMSBassSinger26-Nov-19 6:05 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Eddy Vluggen26-Nov-19 6:32
professionalEddy Vluggen26-Nov-19 6:32 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Maximilien26-Nov-19 6:35
Maximilien26-Nov-19 6:35 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Sander Rossel26-Nov-19 9:32
professionalSander Rossel26-Nov-19 9:32 
GeneralRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Rick York26-Nov-19 10:29
mveRick York26-Nov-19 10:29 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Marc Clifton26-Nov-19 12:11
mvaMarc Clifton26-Nov-19 12:11 
GeneralRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
Dan Neely27-Nov-19 3:22
Dan Neely27-Nov-19 3:22 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
GuyThiebaut26-Nov-19 20:47
professionalGuyThiebaut26-Nov-19 20:47 
AnswerRe: Unit testing discussion - Mock Data - Yes, No, or Yes & No? Pin
RichardS26-Nov-19 21:02
RichardS26-Nov-19 21:02 

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.