Reputation
1,549
Next privilege 2,000 Rep.
Edit questions and answers
Badges
4 10
Newest
 Yearling
Impact
~169k people reached

  • 0 posts edited
  • 0 helpful flags
  • 13 votes cast
1d
revised What do you call a function that's pure, meaning the same input will always return the same output, but also has side effects?
deleted 1 character in body
1d
answered What do you call a function that's pure, meaning the same input will always return the same output, but also has side effects?
Mar
31
comment Should I add redundant code now just in case it may be needed in the future?
Throwing exceptions for inappropriate input is covering every eventuality, but its covering some of those eventualities with "bad caller, no biscuit!".
Mar
21
comment Why do you have to specify the data type when declaring variables?
If you needed to have the full international form of the phone number starting with +, you would probably say so. As such, you would have declared the type required, as the implicit typing wouldn't suffice.
Mar
12
comment Is it ok if I can't solve a problem when sitting in front of a computer?
There's one down-side in my switching from smoking to vaping as someone whose work environment allows vaping and not smoking, and that's that I no longer solve problems when I've popped out for a smoke. Often just as the flame hit the cigarette.
Dec
7
awarded  Yearling
Nov
30
answered Putting a password in a REST API call
Nov
25
revised Is there anything that can be done with recursion that can't be done with loops?
added 2 characters in body
Nov
24
awarded  Nice Answer
Nov
24
comment Is there anything that can be done with recursion that can't be done with loops?
@gerrit and with a narrower, it does avoid it. Ultimately it comes down to the edges of just what we do or do not apply this useful label we use for certain code to.
Nov
23
revised Is there anything that can be done with recursion that can't be done with loops?
added 181 characters in body
Nov
23
comment Is there anything that can be done with recursion that can't be done with loops?
@Yakk why I say "Most of the time". The example in my answer does similarly go from something that will quickly blow a stack to something that will work correctly. The "most of the time" of course depends on just how often one writes recursively at all, but considering that the question is between the choice of iterative and recursive I'm assuming a language were both are commonly done, rather than a functional language where one makes very heavy use of recursion and then depend upon tail-call elimination to make it work. In languages where one can iterate, one generally will for large loops.
Nov
23
revised Is there anything that can be done with recursion that can't be done with loops?
added 1 character in body
Nov
23
revised Is there anything that can be done with recursion that can't be done with loops?
added 3 characters in body
Nov
23
comment Is there anything that can be done with recursion that can't be done with loops?
Most of the time if you do get a stack overflow on recursion, you would have had a hang on the iterative version. At least the former throws with a stack trace.
Nov
23
answered Is there anything that can be done with recursion that can't be done with loops?
Oct
8
answered Iterator pattern - why is it important to not expose the internal representation?
Oct
8
comment Does C# 6.0's new null-conditional operator go against the Law of Demeter?
It's easier to notice something isn't right in A?.B?.C?.D?.E?.F because there's less that can be wrong; either we should be trying to get F via that path, or we shouldn't, while the longer form could have errors within it as well as the error of it not being the correct thing to do.
Oct
8
revised Does C# 6.0's new null-conditional operator go against the Law of Demeter?
edited body
Oct
8
answered Does C# 6.0's new null-conditional operator go against the Law of Demeter?