158 reputation
5
bio website
location
age
visits member for 3 years, 5 months
seen Dec 17 at 22:23

Nov
18
awarded  Citizen Patrol
Sep
30
comment Is it better to have separate functions or add more arguments to a function?
You can still stick to DRY by adding a private function setVoltage(channel,voltage) that's called by the 4 other functions. That even allows you to add some special cases to all separate functions,for example not all of them might have the same max voltage.
Sep
30
comment Is it better to have separate functions or add more arguments to a function?
Tbh setVoltageFluxCapaciator(4) is the same as setVoltage(FLUX_CAPACIATOR_CHANNEL, 4), also, the first variant makes it a lot easier to find all calls to that channel. Internally these functions will be simpler also as you do not need to special case channel 2 and channel 4 in a if then else if then else structure. I would prefer less arguments in most situations, but that doesn't make 2 arguments wrong, it's still perfectly valid and usable code.
Sep
22
awarded  Critic
Feb
21
comment Should I write a test to prove that deleting code fixes a bug?
Clearly the removed functionality handled some input/output wrong. Clearly somebody in the further might misunderstand the problem in the same way. If you fear test suite bloat, i don't think TDD is for you. What is test suit bloat anyway?
Feb
9
comment Why are shortcuts like x += y considered good practice?
Once you are 3 levels deep into the object chain, you can stop caring about small optimizations like 1, and noisy code like 2. Instead, think over your design one more time.
Sep
7
answered Being stupid to get better productivity?
Jul
7
comment Why don't relational databases support returning information in a nested format?
I know, but there is no suck thing as a optimal solution. The only thing I can argue is where the overhead would be minimal and where it depend on. If you want the optimal solution, benchmark and try different approaches. Even the XML solution might be slower depending on the specific situation, and I'm unfamiliar with NoSQL datastores so i can't say if it has something similar as for xml.
Jul
7
revised Why don't relational databases support returning information in a nested format?
Added perofmance explanation.
Jul
7
revised Why don't relational databases support returning information in a nested format?
Added join
Jul
7
awarded  Editor
Jul
7
revised Are there drawbacks to taking a job where I will be using a unique programming language?
added 199 characters in body
Jul
7
answered Why don't relational databases support returning information in a nested format?
Jul
7
answered Are there drawbacks to taking a job where I will be using a unique programming language?
Jul
5
comment Design pattern for a multi-threaded URL fetcher in java
And before you start to reinvent the wheel, make sure you read into java.util.concurrent.ScheduledThreadPoolExecutor and related classes. They can handle most of the work you need to create a threadpool.
Jul
5
awarded  Teacher
Jul
5
answered Design pattern for a multi-threaded URL fetcher in java
Jun
28
awarded  Supporter