Click here to Skip to main content
14,575,520 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: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 10:19
mveRichard Deeming31-May-18 10:19 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Jon McKee31-May-18 10:22
professionalJon McKee31-May-18 10:22 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 10:42
mveRichard Deeming31-May-18 10:42 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Marc Clifton31-May-18 10:48
mvaMarc Clifton31-May-18 10:48 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Richard Deeming31-May-18 11:01
mveRichard Deeming31-May-18 11:01 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Marc Clifton1-Jun-18 1:54
mvaMarc Clifton1-Jun-18 1:54 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
soulesurfer3-Jun-18 21:34
Membersoulesurfer3-Jun-18 21:34 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
englebart4-Jun-18 2:57
professionalenglebart4-Jun-18 2:57 
It took about a minute to solve.

Assigning over the static for each constructor call is a WTF (as others have called out).

Way too many statics in this Program, if it was rewritten to eliminate all of the statics, then the Program instance would hold a single context and the Main would look like this:
Main(...)
{
    new Program().Run();
}

If new instances of the "context" are really needed, then create a Copy constructor to reuse the default context settings on a new instance.

Or use your favorite IOC container.
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
jfren4844-Jun-18 8:10
Memberjfren4844-Jun-18 8:10 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
Q The First Timelord4-Jun-18 8:27
MemberQ The First Timelord4-Jun-18 8:27 
GeneralRe: Code Puzzler: How quickly can you figure out why this acting "weird"? Pin
AnotherKen7-Jun-18 20:57
professionalAnotherKen7-Jun-18 20:57 
GeneralMmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 6:10
mveOriginalGriff31-May-18 6:10 
PraiseRe: Mmmm - it' s nice to know that they care about me... Pin
lopatir31-May-18 6:27
Memberlopatir31-May-18 6:27 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Eddy Vluggen31-May-18 7:54
professionalEddy Vluggen31-May-18 7:54 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 8:00
mveOriginalGriff31-May-18 8:00 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Eddy Vluggen31-May-18 8:16
professionalEddy Vluggen31-May-18 8:16 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 8:22
mveOriginalGriff31-May-18 8:22 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Eddy Vluggen31-May-18 8:38
professionalEddy Vluggen31-May-18 8:38 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Daniel Pfeffer31-May-18 9:30
professionalDaniel Pfeffer31-May-18 9:30 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
OriginalGriff31-May-18 9:51
mveOriginalGriff31-May-18 9:51 
GeneralRe: Mmmm - it' s nice to know that they care about me... Pin
Michael Martin31-May-18 11:20
professionalMichael Martin31-May-18 11:20 
GeneralDo you Program in Paragraphs or Sentences? Pin
RandyBuchholz31-May-18 5:57
MemberRandyBuchholz31-May-18 5:57 
GeneralRe: Do you Program in Paragraphs or Sentances? Pin
lopatir31-May-18 6:14
Memberlopatir31-May-18 6:14 
GeneralRe: Do you Program in Paragraphs or Sentances? Pin
S Houghtelin1-Jun-18 1:13
professionalS Houghtelin1-Jun-18 1:13 
GeneralRe: Do you Program in Paragraphs or Sentances? Pin
Maximilien31-May-18 6:33
MemberMaximilien31-May-18 6:33 

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.