Reputation
25,622
Next tag badge:
90/100 score
33/20 answers
Badges
2 45 107
Impact
~1.2m people reached

Dec
31
answered Is it acceptable for child classes to “break” parent class functionality?
Dec
23
comment Is equating a variable to a function that takes the same variable bad programming?
They don't mean the same thing. One is "a before alteration", and the other is "a after alteration".
Dec
23
comment Is equating a variable to a function that takes the same variable bad programming?
+1: Variables should be assigned once unless they are accumulators of some sort.
Dec
23
comment How to safely and cheaply delete a directory's contents that are constantly being deleted/overwritten
You probably already know this, but using the file system for queuing is not the best practice. There are public-domain implementations of highly reliable distributed queues.
Dec
23
comment Change database based on request origin
The shared secret is usually a key pair generated by the client organization. They send you the public key, and add an encrypted hash to each request. Then your only responsibility is to verify the hash. The security of the private key is the client's problem.
Dec
23
comment At what point is it taboo to have loops within loops?
Iterating over nested data structures with multiple levels of looping is a pretty bad code smell if it happens more than about twice. You now have complex code tightly coupled to the data structure. What if that data structure changes and you need yet another layer? All those loops should be extracted into an iterating class.
Dec
21
comment Most Efficient way to Compute the sum of divisors of N (1 ≤ N ≤ 1 000 000 000)
@JohnMerih are you familiar with Wolfram Alpha etc. ?
Dec
21
revised Most Efficient way to Compute the sum of divisors of N (1 ≤ N ≤ 1 000 000 000)
added 13 characters in body
Dec
4
awarded  Good Answer
Nov
22
comment How to avoid violating the SRP in a class to manage caching?
@DocBrown: The problem is that as written it is untestable. The timing logic (testable) is coupled with the database logic, which much then be mocked. Once a seam is created to mock the database call, you are 95% of the way to the generic solution. I have found that building these little classes usually pays off because they end up being reused more than expected.
Nov
22
comment How to avoid violating the SRP in a class to manage caching?
@raven You can test TimedRefreshCache by using a short interval (like 100ms) and a very simple producer (like DateTime.Now). Every 100 ms the cache will produce a new value, in between it will return the previous value.
Nov
22
revised How to avoid violating the SRP in a class to manage caching?
deleted 2 characters in body
Nov
21
answered How to avoid violating the SRP in a class to manage caching?
Nov
21
comment Is a makefile really needed
At the learning stage I would not recommend an IDE to automate build and deployment. Their are fine for editing, but new developers need to understand how their code is converted to something executable, and how it runs. For C/C++, that means understanding src => object => executable.
Nov
18
awarded  Guru
Nov
12
revised The granularity level to repeat code: should downloading, unzipping etc. be handled by separate classes?
edited body
Nov
4
comment Sudoku hidden sets algorithm
Brute force backtracking solves Sudoku very quickly. Just a few seconds in a slow language like Perl. It was faster for me to write the program than it would have been to manually solve the puzzle.
Oct
27
comment Why doesn't Java implement a better way of handling getters and setters?
Have you looked at Lombok?
Oct
27
comment How to use Guice for an effective API Design?
Why are you doing this? What do you require that is not already provided by existing Java libraries and frameworks?
Oct
17
revised Fully Specifying #includes
deleted 1 character in body