Reputation
271
Next privilege 300 Rep.
Create new tags
Badges
1 6
Newest
 Commentator
Impact
~12k people reached

  • 0 posts edited
  • 1 helpful flag
  • 90 votes cast
Jun
23
awarded  Commentator
Jun
23
comment How safe is it to compile a piece of source code from a random stranger?
This answer is total gibberish. There is no reason at all why a compiler would be inherently safe, or at least safer than something that does a simple task like setting up a SSL connection, yet recently a popular library contained a vulnerability. I would even argue that, because compilers are generally not used in a hostile environment (like the internet), they are less checked for vulnerabilities, and therefore more likely to have them.
Jun
13
awarded  Yearling
Jun
12
answered Is my mentor's concern for code quality excessive?
May
5
comment Is my usage of explicit casting operator reasonable or a bad hack?
@Telastyn true, might actually be a good idea to implement this properly and encapsulate a SmallObject as well.
May
5
comment Is my usage of explicit casting operator reasonable or a bad hack?
I still find it lightly confusing that .ToSmallObject() would be a data-losing operation. Why not .GetSmallObject(), populated with the data from BigObject?
Jan
23
comment Throw exception or let code fail
Personally I would use a assertion here, that still gives a exception when you try to debug this, but wont take up any resources when you build a release. Unless you load materials from a arbitrary source at runtime, then better keep the exception.
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?