734 reputation
816
bio website github.com/thomaseding
location United States
age
visits member for 4 years, 3 months
seen 6 hours ago

May
19
awarded  Nice Answer
Apr
24
comment Is the behaviour of floating-point arithmetic defined by the c++ standard?
No, but you can query and static_assert on some models stackoverflow.com/questions/5777484/…
Apr
18
comment Why is it bad to have one mechanism for inheritance and subtyping?
I have no idea where you got such notions, but perhaps you are thinking about not following Liskov substitution principle? en.wikipedia.org/wiki/Liskov_substitution_principle
Mar
7
revised Complex Number help
added 66 characters in body
Mar
7
revised Complex Number help
added 2 characters in body
Mar
7
answered Complex Number help
Mar
3
comment Why use a bool over more domain specific abstractions
Did the function return True for failure or True for success? I have no idea. But when a function returns Success for success and Failure for failure, the meaning is crystal clear.
Mar
3
comment Why use a bool over more domain specific abstractions
Haskell typically goes with the domain-specific abstractions because it is so easy to do, both syntactically and semantically.
Feb
28
comment 2 methods that are 75% the same?
So 3 of the 4 lines are the same?
Feb
25
comment Is a makefile really needed
You can always use a general-purpose high-level language (Python, Haskell, etc) instead of using an archaic special-purpose language (Makefile). prog21.dadgum.com/49.html
Feb
24
comment Is it reasonable to assume that any physical quantity can be represented by a 64-bit integer without overflow or underflow?
Look at any physical phenomenon that has an associated irrational number. Circles and pi for example. Floating point numbers are inherently rational, thus you cannot perfectly represent it without error.
Feb
5
comment Do wildcards in Java generics restrict or increase flexibility?
They increase flexibility. They are useful to accept code you cannot accept with normal type parameters in java. Example would be List<List<T>> is not as permissive as List<List<?>>. en.wikipedia.org/wiki/…
Feb
3
awarded  Enthusiast
Feb
2
comment What is the difference between Optionals and Nullable type
From a language agnostic viewpoint, they are identical. That said, a language may differentiate the concepts (e.g. Whether or not pattern matching is enforced).
Feb
1
comment Check a boolean before setting it in a loop, or just set it
Branch prediction
Feb
1
comment Why would many duck-typed dynamic programming languages use a class-based approach instead of prototype-based OOP?
Many programmers don't want to be bothered learning something new. (It's too foreign and "difficult"). Hence all those class-based libraries and languages that compile to them.
Jan
28
comment Using “Return” over “Break” or a combination
@RobertHarvey: Interesting. I've never encountered that problem before (or so I believe).
Jan
28
comment Using “Return” over “Break” or a combination
I would typically use a break even if there is a guaranteed return in case (pun!) a refactor breaks (another pun! I'm on fire!) that assumption.
Jan
28
comment Is the 'finally' portion of a 'try … catch … finally' construct even necessary?
Perfect answer. Destructors are THE must-have feature in C++.
Jan
19
comment Is it a waste of time to free resources before I exit a process?
It depends on what the resources are. If it is just system memory, then yes, it is (technically) a waste of time. If you are cleaning up stuff like files or w/e, then the OS won't help you in all cases. In the file case, the OS will close your file handles, but it won't automatically ensure your files won't have corrupt data. Only your program's logic can do that.