11,950 reputation
43354
bio website
location Minneapolis, MN
age
visits member for 4 years, 1 month
seen 6 hours ago

6h
comment Are all magic numbers created the same?
@JuanMendes: That's Kibibyte vs Kilobyte land, StevenBurnap made a joke about it in a comment to the question.
23h
comment How common are use SDLC methodologies in real life?
Your claims about coder vs engineer are at odds with reality, even under strictly defined procedures software has all kinds of issues, see programmers.stackexchange.com/questions/158640/… for some examples. No methodology can replace the good judgment of a skilled developer.
1d
comment Are all magic numbers created the same?
Ya'll need to learn YAGNI.
1d
awarded  Good Answer
1d
comment Are all magic numbers created the same?
@immibis: somewhere, someone is trying to.
1d
comment Are all magic numbers created the same?
@NathanCooper: I know it's an example, but when discussing nuanced topics that are context-sensitive judgment calls, your choice of example is important.
1d
awarded  Nice Answer
1d
comment Are all magic numbers created the same?
@NathanCooper: your preferred e^i*pi = -1 is better in that instance, because your alternative isn't correct. e is not 2.718. And while specs change a lot, they also have a habit of changing only in unexpected ways where you can't just change a single #define and run with it.
1d
comment Are all magic numbers created the same?
@user61852: named constants aren't always more readable. They often are, but not always.
1d
comment Are all magic numbers created the same?
@user61852: Like just about everything else in software, it boils down to judgement calls specific to your context. In some cases 9.8 would be appropriate in-line, in others it would not be. Using a constant for acceleration due to gravity can be dangerous because g is not constant everywhere, nor is standard g 9.80000. Using a constant defined elsewhere makes errors in your usage of the value less obvious.
1d
answered Are all magic numbers created the same?
1d
comment What is a good word for the current “state” of a state machine?
I've seen plenty of state machines over the years that just call the variable "State". Never been confused.
2d
comment Math model for a webpage layout?
Generating "bullet proof" html/css to do just about anything beyond hello world is serious undertaking. You underestimate how quirky browsers are.
2d
comment Running a QT application on Windows
How about telling us what program, and what is in the folder, or anything that would be useful?
Dec
10
comment Is there ever a reason to use an array when lists are available?
Rarely? Not everyone works on super-complicated ultra-configurable enterprise monstrosities.
Dec
8
comment Hardware accelerated text processing
Also reversal is not a basic string operation in the 21st century.
Dec
8
comment Hardware accelerated text processing
It already exists and it is already implemented in various forms in common desktop processors. String operations have been commonplace on computers since nearly day 1, and many architectures have had many different instructions catering to particular string handling schemes.
Dec
8
comment Adding non distinct elements to a dictionary
While I agree exceptions shouldn't be used for flow control, option 1, in multiple thread situations along with bad luck, can lead to a race condition resulting in an unhandled exception. There are scenarios where 2 is more appropriate.
Dec
6
comment Efficiency of C# dictionaries
Your quote says "Retrieving a value by using its key is very fast, close to O(1), because the Dictionary class is implemented as a hash table.", so the OP could confuse the two concepts. In otherwords, I wanted to make it clear that big O does not tell the whole story concerning "speed".
Dec
6
comment Efficiency of C# dictionaries
O(1) isn't necessarily "fast". Looping through a list could still be quicker than a hashtable for the collection sizes the application is dealing with.