445 reputation
49
bio website tincancamera.com
location United Kingdom
age 43
visits member for 3 years, 7 months
seen Apr 2 at 11:45
It might look like a spider, but it's a 7000 year old petroglyph from an Irish barrow tomb.

Mar
20
comment What's the next level of abstraction?
@KeithS that is not what the word means in any context I've seen it - from CLOS to UML to C#. A metaclass is a a class whose instances are classes - a weak implementation is C#'s Type which gives reflective capabilities but not mutation ( you can't add a new method to MyType by saying typeof(MyType).Methods += new Method ( "Foo", (int x)=>x*x ) as you can in CLOS )
Mar
20
comment Derived Class Method Naming
@RobertHarvey the difference between 'not that hard to remember' and 'impossible to forget' is a big one - IME code using this pattern in a team with many developers does result in the base not getting called where it should.
Mar
19
comment C++ library API: new or getters?
@l46kok you do understand that many C++ libraries behave that way? std::string is a smart pointer to a char array. QGLContext is a smart pointer to an open GL context. CDC is a (somewhat) smart pointer to a Win32 device context. So you don't use the standard library, boost, QT, MFC, etc.?
Mar
16
comment C++ library API: new or getters?
@MrFox using std::string is the same case - the library can choose to manage the array the string wraps in whatever way it sees best - e.g copy on write rather than always copying. The problem with returning a raw pointer to the data is that the client of the library does not know how to release that pointer - if it's a copy on write object then deleting it will result in undefined behaviour, as will deleting it if the library was compiled with a different runtime. I'm not familiar with QT, but examples showing use of QPointer show the client code using new as well, so don't hit the issue.
Mar
15
comment C++ library API: new or getters?
@MrFox so you're suggesting that Result would look like struct Result { char* data; }; and it's up to the client to either delete or free or delete[] data, rather than my suggestion of returning a result with a shared pointer, such as struct Result { boost::scoped_array<char> data; }; ? Do you also not use std::string in case that isn't supported?
Mar
15
awarded  Yearling
Mar
15
revised C++ library API: new or getters?
throw exception for exceptional errors, return a maybe for expected results
Mar
15
answered C++ library API: new or getters?
Mar
6
comment Implementing the Visitor Pattern for an Abstract Syntax Tree
@marco-fiset Yes, you get stack overflow exception if you say, try to parse a large, deep XML file with a visitor. You'll get away with it for most programming languages.
Mar
6
comment Implementing the Visitor Pattern for an Abstract Syntax Tree
This can fail for parsers if the language has deeply nested constructs - it can be necessary to maintain a stack independently of the language's call stack.
Mar
6
comment How can robots beat CAPTCHAs?
If you want us to answer your question, first prove you are not a robot.
Mar
6
comment How to make creating viewmodels at runtime less painful
If my FirstName is "Peter" and my Titles are {"Rev", "Dr"} *, why do you consider FirstName data and Title state? Or can you clarify your example? * not really
Mar
6
comment Is there a way to support different coding styles in a development team
"no changing differently styled code to match your preferences, it costs time and introduces bugs" - quite the opposite - matching a non automated standard by hand is very wasteful of time, running a code formatter, commiting the change as 'formatted with options -whatever " then making functional changes is much faster.
Mar
6
comment Is NoSQL a good fit for a graphing app, and how can I compare different NoSql Servers?
Thanks for the clarification.
Mar
5
comment Is NoSQL a good fit for a graphing app, and how can I compare different NoSql Servers?
What does "(SQL system are betten then NoSQL systems tells about them)" mean?
Mar
5
comment Computing integration with the Trapezoidal Rule
What is the trouble you are having with the function? Do you have a function which you are having trouble passing into the integrator, in which case you need to say what language you're using, or are you having trouble with the user inputting the function in some form?
Mar
4
comment Why do most issue tracking systems have only single status field?
If you look at something like VersionOne, which is a task tracker, you can define statuses for a defect has a status which goes from (none)->Assigned->InProgress->ReadyToTest->Tested->Accepted . However, it's not normally the job of a bug tracking system to track the work to fix the bug - like you say, that would only become fixed when the user accepts it.
Mar
1
comment Preventing Liskov Substitution violation
... So you have to consider whether LSP is violated with respect to the client's hierarchy; in which case you have to say whether or not the expected behaviour on receipt of an unexpected type is to throw an exception or not. If the contract of DataValueHandler.getInsertValues says it must not throw, then LSP is violated; if it says that the behaviour is to throw for invalid data, then LSP is not violated by throwing an exception for invalid data.
Mar
1
comment Preventing Liskov Substitution violation
Say you have two implementations TypeA and TypeB of interface I. For every call in the interface I, TypeA and TypeB behave in accordance to LSP. Someone then creates a free function which takes an I, tests whether its type is TypeA, and if it is throws an exception. That doesn't effect LSP with respect to TypeA or TypeB - LSP applies to the types which vary, not the behaviour of other code. If instead of a free function, it is a method of another object which throws the exception, this does not alter the LSP status of TypeA or TypeB...
Mar
1
comment How to make my web app restful
From user stories. The state machine represents the user's interactions with the application; you're talking about formatting urls to the results of those interactions which is a later stage.