Reputation
10,396
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
19 39
Newest
 Civic Duty
Impact
~260k people reached

Jan
20
comment Configuration data structure for initialization
I've never seen Visitor Pattern used for loading a configuration. If you had a Visitor with visit from each component, you could call each component with the configuration to initialize itself, but that defeats the purpose of using the Visitor Pattern in the first place since you could have simply told the parent instance to configure itself with a configuration and the parent would do the same for its children with the same configuration. In my humble opinion, this is an instance of forcing a pattern where none is needed.
Jan
20
comment Should a client ever test server response at runtime?
Excellent point. If validating data is to protect against future changes to the server, then it should be handled by passing a version indicator of the server. Otherwise, ensure that only what you require is with the limits of expected server responses and nothing more.
Jan
19
answered Best way to get push notifications to server from ms sql database
Jan
19
comment Why use XML in android?
In a sense, XML used in this way is like an interpretted language and Java is a functional language. In one case, you're writing code that does the task and in the other, you provide all information necessary to do it without the how. In Java, you can only run the code while with XML, you can decide later to optimize rendering without changing the overall appearance. It is a tremendous advantage that shouldn't be overlooked.
Jan
13
comment Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3
Correction to the above comment. Apparently everything on the planet is randomly generated as well, meaning the server only has to keep track of resources, currency, and player stats. I assume landing on the same planet won't retain the changes made by other players.
Jan
13
comment Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3
@J.F. See No Man's Sky. The guy literally generates a universe. He saves only planets that have been visited by players, and yet the existing planets remain in their same respective spots. It is all based on using the proper seed used to generate random numbers.
Jan
12
comment Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3
No. If you can generate stars in a predictable way, then it will be as if they had always been there if you leave and then return. It is only the algorithm and the seed which don't change.
Jan
12
comment Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3
Also another thought, the placement of the stars needs not be remembered. If you use a reproduceable generation of stars, then you could generate the stars that the user could see in such a way that those stars will be generated in the same way in the future. Meaning, your database only needs to save info on stars. Its position is its identity.
Jan
12
comment Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3
A traveler of this universe would likely move in one direction, meaning if you run out of stars, you'd have to generate stars in all directions from origin. One bored user could break your database, in other words. Have you considered this possibility (assuming it may be an issue)?
Jan
12
comment Understanding Generic Repository Pattern
AgeRepository could recycle instances, but you're right, that would be improper usage of that pattern in that case.
Dec
23
answered How to refine the architecture, look for better solutions and not to spoil relationship with the team?
Dec
22
comment Exceptions - “what happened” vs “what to do”
I agree. The server should only convey the information properly. The documentation on the other hand should clearly outline the proper course of action in such cases.
Dec
22
revised Exceptions - “what happened” vs “what to do”
Exception name correction
Dec
22
comment Is it bad to refer to access array elements via pointer arithmetic instead of the [] operator?
@NikoGambt Yes, absolutely. The types of things in your program that you should be optimizing are algorithms, not micro-optimizations. That said, if something is equally readable either way, prefer the way that is more performant.
Dec
22
comment Is it bad to refer to access array elements via pointer arithmetic instead of the [] operator?
@NikoGambt It's fine to do things that are bad practice if the scope is to learn. The point of bad practice is to avoid doing such things when you write programs to work well. ;)
Dec
22
comment Is it bad to refer to access array elements via pointer arithmetic instead of the [] operator?
@NikoGambt Writing something that is less readable for performance purposes is almost always bad practice, but writing something that is less readable for no gain is unequivocally bad practice.
Dec
22
awarded  Civic Duty
Dec
22
comment Java Game. Preload objects and reuse vs create objects at runtime
As usual, we're talking about performance vs memory usage. You can usually optimize performance but at the cost of higher memory usage. Unless we're talking about very expensive objects (with nothing shareable between these instances), you'll almost never have to worry about consuming too much memory. Examples of expensive objects would be images or large data structures.
Dec
21
comment How to best encapsulate features in software design?
I mean, this answer seems a little vague in the context of the question. Could you clarify with a tiny example perhaps?
Dec
21
comment How to best encapsulate features in software design?
I may be mistaken, but I think OP is referring to having features that apply to the project if present and don't apply to the project if not present, without creating problems in compilation. Please correct me if I'm wrong, OP.