Skip to main content
24 events
when toggle format what by license comment
Jun 9, 2017 at 5:44 history protected gnat
Jun 9, 2017 at 0:21 answer added NetMage timeline score: 5
Jun 5, 2017 at 5:27 history tweeted twitter.com/StackSoftEng/status/871599430297944064
Jun 1, 2017 at 18:06 answer added gnasher729 timeline score: 0
May 31, 2017 at 21:20 answer added Jules timeline score: 4
May 31, 2017 at 18:00 comment added Frank Hileman Your "ideal world scenario" is used all the time with streams, except the data type is not var. So this is a good question.
May 31, 2017 at 16:39 comment added GrandmasterB I don't know C# very well, but can't the 'ideal' option omit the null check, like while( var value = GetValue(i++))?
May 31, 2017 at 15:06 review Close votes
Jun 5, 2017 at 3:03
May 31, 2017 at 14:45 comment added gnat Possible duplicate of How to remove duplicate code (in general)?
May 31, 2017 at 14:10 history edited Roy T. CC BY-SA 3.0
added 1 character in body
May 31, 2017 at 14:02 vote accept Roy T.
May 31, 2017 at 13:51 comment added JimmyJames @Theraot So you have to declare a specific type? I woule feel too much like a phony to try to post a C# answer. I have written exactly one C# program. Feel free to add it to your answer.
May 31, 2017 at 13:46 comment added Theraot @JimmyJames yes, that works, except not with var. You should make that an answer.
May 31, 2017 at 13:46 answer added Krupip timeline score: 3
May 31, 2017 at 13:42 answer added Newtopian timeline score: 0
May 31, 2017 at 13:36 comment added JimmyJames Can't you do this in C#? for(var value; (value = GetValue(i++)) != null;)
May 31, 2017 at 13:28 answer added Theraot timeline score: 14
May 31, 2017 at 13:24 comment added Theraot You can get pretty darn close to the "ideal world scenario", all you need is to declare value outside the loop.
May 31, 2017 at 13:23 comment added candied_orange Exactly why is the ideal world scenario not valid c#? Consider
May 31, 2017 at 13:09 comment added Roy T. @Zalomon you're absolutely right, fixed the typo.
May 31, 2017 at 13:09 history edited Roy T. CC BY-SA 3.0
deleted 3 characters in body
May 31, 2017 at 12:52 comment added Zalomon BTW in the ideal world scenario I think that you meant to write "while((var value = GetValue(i++)) != null)", Isn't that right?
May 31, 2017 at 12:21 answer added Zalomon timeline score: 0
May 31, 2017 at 11:45 history asked Roy T. CC BY-SA 3.0