Reputation
615
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
4 20
Newest
 Yearling
Impact
~9k people reached

  • 0 posts edited
  • 1 helpful flag
  • 160 votes cast
May
13
awarded  Popular Question
Mar
7
awarded  Popular Question
Feb
21
comment Recursion without factorial, Fibonacci numbers etc
This is a good idea. I'll use it as well in the future.
Jan
28
accepted How can I indicate if an object operates with another one in an UML class diagram?
Nov
15
comment What's up with the Class::get(id) idiom in PHP
I am faced with these kind of objects in java at the moment and I can tell that they are horrible and nearly impossible to test properly.
Nov
13
comment Which is the most practical way to add functionality to this piece of code?
I am not the user so I can't tell what an user will use. This is just a library.
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
Oh I see. In java you can't be typesafe with a Map<DataType, AnyObject<?>> since even if you make a wrapper (AnyObject) for the value you have to supply a type parameter for it which is lost after compiling so a Map<DataType, Object> with typecasting makes more sense.
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
No, I can understand it now but I still don't see how that will help me. Every Hexagon can contain a different value for all of those facets. BTW that downvote is not by me.
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
If you want to use functionality tied to an id you have to get the code anyway (like the class which implements shortest path search) so using ids will just make code unreadable. In this sense an enum is almost the same but more readable and less error-prone. I don't see why an enum would prevent extension.
Nov
12
revised Which is the most practical way to add functionality to this piece of code?
edited tags
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
This approach looks good, +1! The proposed structure needs some polishing though since it is a work of an enum: enum DataType { TRANSPARENT, PASSABLE, PASSAGE_COST, SATELLITE_DATA} and the whole thing can be used in a map: Map<DataType, Object> data;
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
Sorry, but I don't understand how it works from the example. Where does the incrementCost method go? where does the constant TRANSPARENT go? what is a sealed class? Why should get/setData should be private?
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
I don't want the user to have to extend a class since he may have one which is already extending something.
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
You don't get the point.
Nov
12
comment Which is the most practical way to add functionality to this piece of code?
This is the Rule of the Three, right? I in fact already have a demo application but your answer looks like you think this is a Catch 22: I can't write an interface while there are no applications and I can't write applications while there is no interface. So there should be one interface for a start.
Nov
12
asked Which is the most practical way to add functionality to this piece of code?
Sep
18
asked How can I indicate if an object operates with another one in an UML class diagram?
Aug
31
comment Does macros support make Scala a Lisp dialect?
I think you still live in the last century.
Aug
30
comment Does macros support make Scala a Lisp dialect?
Says someone who is still using Delphi. Ok. I take your word for granted.
Aug
30
asked Does macros support make Scala a Lisp dialect?