2,701 reputation
2819
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 4 months
seen 17 hours ago

Mar
23
comment Method extraction vs underlying assumptions
@gnat I think this question is closer to "Is it OK to split long functions and methods into smaller ones even though they don't preserve the class invariants?"
Mar
14
comment Working with static constructor in Java
As I read the question, it's about static initializers, not about normal static emthods.
Mar
14
comment Counting digits of a decimal number
When you talk about a "decimal number", do you mean an integer encoded in base 10, or are you talking about the string representation of binary floating point numbers like float or double?
Mar
13
comment What is better for scalability for this specific dataset, MongoDB or MySQL?
Do you have any evidence that performance matters at all? Do you have hundreds (or even more) requests per second? This sounds like premature optimization.
Mar
8
comment Program to look at the first say 5 characters of a word and return a string if that string is actually the first 5 characters of a word?
Just get a dictionary, truncate words to 5 letters and generate a hashset from that.
Feb
27
comment Does modular programming refer to modules or programs?
In programming it usually refers to parts of the same executable. But the unix concept of having command line tools that do one thing well which can be combined is pretty similar.
Feb
24
comment Is it legal to have by default a super user account in a product
Even disregarding legality and morality, do you even know how to implement a secure backdoor?
Feb
23
comment Complexity analysis: Finding common members of unsorted arrays
Even in computer science you can use average complexity.
Feb
23
comment Complexity analysis: Finding common members of unsorted arrays
Why would I care about worst case complexity if the worst case is sufficiently unlikely?
Feb
20
awarded  Enthusiast
Feb
20
comment Should changes to FNV-1A's input exhibit the avalanche effect?
Consider SipHash. It's simple, relatively fast and secure.
Feb
18
comment Is address 0000000C a special address?
@supercat The answer wasn't using K for 1024 here, it was (correctly) using k for 1000. I generally prefer decimal prefixes over binary prefixes, but since this size is exactly 64 KiB, using the approximation 65 kB isn't a good idea here.
Feb
18
comment Web API: avoiding name conflicts in URL query parameters
I'm not sure if the url is the best place for the version number. A http header seems more RESTful.
Feb
18
comment Most efficient way to calculate number of iterations to run
(n+k-1)/k where / is integer division.
Feb
12
comment Does this python program obey functional paradigm?
listOfSequence.append(n) doesn't look functional to me.
Feb
12
comment Would it be troublesome to learn C# and F# at the same time?
To me the difference between F# and python looks much bigger than the difference between C# and python. Switching from python to C# you mainly need to get familiar with static typing the standard library. With F# you'll need to learn functional programming, which is a much bigger endeavor.
Feb
9
comment Can commented-out code be valuable documentation?
In your last case I'd keep both code variants as compilable code.
Feb
4
comment Well defined mathematical operations for bearing (angle) class
Because "2 * east = south" makes no sense.
Feb
4
comment Well defined mathematical operations for bearing (angle) class
@DocBrown Are you sure modular arithmetic is still a ring if you use real numbers instead of integers as basis? Isn't it just an additive group?
Feb
4
comment Well defined mathematical operations for bearing (angle) class
@BartvanIngenSchenau Multiplication with an integer makes sense (for relative angles), but multiplication with real numbers/floats leads to the same unintuitive effects as division.