What goes around, comes around...
-
for (Int16 i = 1; i <= 2; i++)
I suppose this is the DRY principle taken to its logical conclusion
-
for (Int16 i = 1; i <= 2; i++)
I suppose this is the DRY principle taken to its logical conclusion
My first thought was "that will execute three times" and then I noticed it starts at 1 :doh: VS2015 would also give the advice to "simplify" Int16 to short (as Int16 is waaaay to esoteric for us simpletons) :D
Read my (free) ebook Object-Oriented Programming in C# Succinctly. Visit my blog at Sander's bits - Writing the code you need. Or read my articles here on CodeProject.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
for (Int16 i = 1; i <= 2; i++)
I suppose this is the DRY principle taken to its logical conclusion
I could just imagine the next few lines being
if (i == 1) {
}
else {
}(Maybe too much time looking in QA)
Cheers, Mick ------------------------------------------------ It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
-
I could just imagine the next few lines being
if (i == 1) {
}
else {
}(Maybe too much time looking in QA)
Cheers, Mick ------------------------------------------------ It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
Fortunately not - though it does have an inner loop that is a foreach and I think it could be refactored away. Got to put some tight unit tests down around it first as there is little or no intent in evidence from code or comment.
-
for (Int16 i = 1; i <= 2; i++)
I suppose this is the DRY principle taken to its logical conclusion
Looks like that'll run fast and stable.
Kitty at my foot and I waAAAant to touch it...
-
for (Int16 i = 1; i <= 2; i++)
I suppose this is the DRY principle taken to its logical conclusion
Never heard of IF-less programming?