986 reputation
711
bio website tincancamera.com
location United Kingdom
age 44
visits member for 4 years, 8 months
seen 12 hours ago
It might look like a spider, but it's a 7000 year old petroglyph from an Irish barrow tomb.

1d
answered Design pattern for mapping data fields
2d
comment When is an object of real world a (computational) object of your program?
@overexchange that assumes a 1:1 mapping between real world state and object state. It is quite common for a real world objects to be represented as something higher dimensional - for example, an object representing a ball might have an associated sequence of seven dimensional vectors representing it position and rotation in space and time. The state of the real world ball at an instant corresponds to a value in the sequence, and the state evolves over time, but the sequence does not have to be mutable to implement that.
May
25
comment A new name for unit tests
You must write very simple code then. The amount of reachable states in most modern systems mean that to do end-to-end testing would take the lifetime of the universe - testing two pieces each with 4bits of state takes 16 cases to test each, or 32 test cases in total; made into an end-to-end system gives 8bits of state or 256 test cases to cover all states. Personally, I'd rather do 1/8 the work.
May
20
comment Why are shortcuts like x += y considered good practice?
Most functional programmers will consider this bad practice.
May
20
comment What are the right terminologies for website UI elements?
duplicate of ux.stackexchange.com/questions/67311/… see also ui-patterns.com/patterns and designinginterfaces.com/firstedition/… or ux.stackexchange.com/questions/6030/…
May
20
comment Problems with OO design for application with pluggable components
You also might find dl.acm.org/citation.cfm?id=1134016 interesting as a different approach
May
19
comment Python: Are all dictionary comprehensions just more expressive and compact for loops?
'Expressive power' has a specific meaning when discussing computer languages, if you use 'expressive' by itself then half your audience will think you mean the non-technical 'effective at conveying meaning' and half will think you mean 'having a greater expressive power'
May
13
answered “Sweep” a vector of pointers
May
13
comment Teaching myself, as a physicist, to become a better programmer
Although physics is potentially a rich source of metaphors, the intent in XP is finding a metaphor which facilitates communication with the on-site customer and other team members, so would generally tend to choose metaphors which are more commonly understood.
May
13
answered Why I need to make method of my class private, If I need to access it throughout my application?
May
8
comment Can a UML class diagram show two different relationships between two classes?
An inner class is not an aggregate of the outer class, so your reasoning is formless.
May
1
comment Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?
@QuestionC yes, I read the assertion that can't be solved polymorphically to exclude the visitor option operating on the list of Bases themselves
Apr
29
revised Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?
attempt to clarify what's odd about example
Apr
29
comment Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?
@codebreaker you really need to clarify your question then - in most systems there would be a valid reason for calling a bunch of functions agnostic of what they do; for example to process rules on an event or perform a step in a simulation. Usually such systems have a context in which the actions occur. If the 'getRandomIngredients' and 'getFrequency' are not related, then then shouldn't be in the same object, and you need yet a different approach, such as having the actions capture the source of ingredients or frequency.
Apr
29
answered Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?
Apr
27
comment Mermaid problem (OOP)
@ar27111994 If the only difference between 'mermaid class' and 'human class' is that a mermaid has different values for some of its properties, you're defining classes to change configuration not behaviour.
Apr
26
answered Mermaid problem (OOP)
Apr
24
answered Writing a parser on top of an XML-based AST: am i doing it right?
Apr
8
comment Secure Rest api from authenticated user
@royB You can't stop users making calls. You check the token and get the user, and check whether that user has the access rights to make perform the action, then the response to the request is a non-authorized error. Also, design the API so the actions the user takes are at least power - there's no 'increase points' API, there's a 'charge my account $5 and increase points' API or 'perform this move in the game' API.
Apr
8
answered Secure Rest api from authenticated user