Reputation
658
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 11
Newest
 Pundit
Impact
~22k people reached

Feb
7
comment Encrypted content in games
In your "absolute simplest case" your "game" is not solvable by a human. That's the whole point of the password to the encrypted files. And any clues or constraints to the password that are available in the game are also available by examining its source, which in turn become constraints to ripper.exe. I promise you a couple graphics cards will brute force the password before a human can solve the "game".
Feb
5
comment Better to have 2 methods with clear meaning, or just 1 dual use method?
I'm generously assuming this is example, illustrative code and that you aren't using floating point math to store monetary values. Otherwise I'd have to get all preachy. :-)
Jan
25
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
There was a question recently about developers reviewing code in a language they don't normally write. I think the wisdom there applies here: a good developer will spot many basic mistakes in just about any language, but each language has so many gotchyas that maximum benefit is achieved when in-language developers do the review. This is even true if your C++ is "Java features only".
Jan
21
comment Is it good practice to avoid warnings and notices?
I work in Java/eclipse, which is different than php obviously, but I usually find the warning is raised by either 1) something that compiles but I made an obvious mistake or 2) something that is fine now but will be bad down the road
Jan
8
comment Given a herd of horses, how do I find the average horn length of all unicorns?
If you have 10 horses, two of which are unicorns of length 4 and 6 is your average 5 or is it 1?
Dec
27
comment Doesn't “always initialize variables” lead to important bugs being hidden?
This is exactly what I was thinking when I read it. It's not sweeping things under the rug, it's sweeping them into the dustbin!
Dec
25
comment Is it a good idea to define one big private function in a class to maintain valid state, that is, to update the object's data members?
@site80443 Based on what I see, that's the wrong approach. Try to model your data such that only data that is validated against it self is included. For example the price of an item can't be negative only relies on itself. If an item is discounted, don't factor the discount into the price - decorate it with a discount later. Store the $4.99 for the item and the 20% discount as a separate entity, and the 5% tax as yet another entity. It actually looks like you should consider the Decorator pattern if the examples represent your real life code.
Dec
24
comment Is it a good idea to define one big private function in a class to maintain valid state, that is, to update the object's data members?
You point out the biggest disadvantage: relying on people remembering to do things is rarely a good solution. About the only thing you can rely on a human to do is that they will forget to do something.
Dec
23
comment At what point is it taboo to have loops within loops?
If you read the whole document, he takes the time to call some people heretics and some people prophets. Just because Linus Torvalds is the High Priest of his Church and gets to decide who sits in what pew doesn't mean you have to follow his hokey religions and use his ancient weapons.
Dec
23
comment Exceptions - “what happened” vs “what to do”
I like this answer, but it's missing what I consider a requirement of exceptions... if you knew how to recover, it wouldn't be an exception! An exception should only be when for when you can't do something about it: invalid input, invalid state, invalid security - you can't fix those programatically.
Dec
23
comment Exceptions - “what happened” vs “what to do”
@Pharap If your hackers have access to the exception itself instead of an error message, you're already lost.
Dec
10
comment How to encourage client to do some in house QA testing?
Who controls these users' budgets?
Nov
25
comment Does this code solve the square/rectangle Liskov Substution Principle example?
I would consider the name Quadrilateral instead of AFourSidedShape.
Nov
21
comment What is a good security practice for storing a critical database on developer's laptops?
@dan1111 Ironically, contrast this with your answer "please please please change your ways... but if you can't at the very least here's what you can do to protect yourself". There you list alternatives AND answer the question.
Nov
21
comment What is a good security practice for storing a critical database on developer's laptops?
"What's a good security practice for storing critical data on a laptop?" "Store it in a data center instead, or use non-production data on the laptop" You're right that it might solve the OP's problem, but it doesn't answer the question. The two are very different concepts. I'm not saying Brian isn't helpful. I 100% agree with his assessment of the situation. What OP is doing is dumb. But it's his dumb thing to do, and this doesn't answer his question.
Nov
21
comment What is a good security practice for storing a critical database on developer's laptops?
@dan1111 That's the problem. It's not an answer. It's an alternative. That makes it a comment, not an answer.
Nov
17
comment Is measuring the binary size of a c++ program a good indication of code complexity? Or something else?
I've had the size of the slug be a big problem for the deployment process, which can hinder testing by having longer testing cycles and I suppose in theory that could lead to lower code quality. But I suspect if that really did have an impact, there would undoubtedly be other failures in the process that would be far worthier of your attention.
Oct
28
comment Could an instance be equal to some other instance of a more specific type?
Nothing worse than tutorials that break common conventions... It takes years to break those kinds of habits out of programmers.
Oct
16
comment Illusory code duplication
Remember, you can only reuse code that does the same thing. If your app does different things on different screens, it will require different callbacks. No ifs, ands, or buts about it.
Oct
9
comment Why would you not use the 'using' directive in C#?
As a former Java programmer, java.awt.List was the bane of my existence in Eclipse...