206 reputation
18
bio website
location
age
visits member for 1 year, 11 months
seen Jun 24 at 13:35

Feb
23
comment Return compound structure from getter method in DTO
@Aaronaught Good point. You may write that as an answer with a little more examples. It is possible for the consumer to pick up the raw pointer from an returned Array reference anyway.
Feb
23
comment Return compound structure from getter method in DTO
@gnat This is DTO. In this case, there is no way around so I asked what sucks least.
Feb
9
comment Outline for technical software documentation
@DocBrown: I thought mention "API Reference" implied the audience
Feb
9
comment Outline for technical software documentation
@DocBrown: "end users" are other developers.
Jan
10
comment Using partially implemented interfaces
@neontapir Exactly: There might be other implementations of A that do not share the implementation of doStuff.
Jan
10
comment Using partially implemented interfaces
@JeroenVannel But does it make sense to say that B objects is substitutable for D objects? The latter avoids the more or less artificial construct D (no such thing exists in the underlaying model).
Jan
7
comment Use null object as argument to method
Also this gives a gain in performance, since, in some cases i would know that I do not have a null pointer, and then the check is unnecessary. Using a helper method, gives the programmer the choice of guarded/unguarded behaviour.
Jan
7
comment Use null object as argument to method
@Phoshi In my situation, a missing key does not necessary imply a failure. Therefore, findObject should not throw.
Jan
7
comment Use null object as argument to method
@ratchetfreak It works in g++ (Ubuntu/Linaro 4.7.2-2ubuntu1~ubuntu12.04.1~ppa1) 4.7.2 with -O3 so gcc does not skip the if statement. It would be undefined behavior to try to access values and n_values, which it does not.
Jul
13
comment Should UTF-16 be considered harmful?
@rmeador I would like to kill a widespread myth: UTF-8 is actually NOT compatible with any 8-bit based encoding. This is a fact that everyone in Europe should know. UTF-8 is backward compatible with US-ASCII, nothing more.
Apr
20
comment Nested classes vs namespaces
@EmilioGaravaglia This template requires the inner classes (or typedefs does not matter) In and Out in class TypeOfData.
Dec
13
comment Interface extension
@gnat letting the method return false if seeking is not supported can work very well. I can just probe for seek support using foo.seek(0,SEEK_CURRENT) ie seek 0 bytes from current position.
Dec
13
comment Interface extension
It seems somewhat overkill
Sep
13
comment Is there an optimal number of lines of code per function?
Please define elementary job
Aug
31
comment Reading data from file and const
Yes, but definitely useful if a file header has to be read to see if a specific decoder can be used. Note that different files types have magic numbers of different length.
Aug
29
comment Reading data from file and const
So a const declared read method have to make sure that the returend buffer is the same for the next call, either by saving the data read internally (nessecary for a general stream) or saving the file pointer, which has to be restored before the method returns.
Aug
28
comment Reading data from file and const
Yes, since then I can use a temporary file object to load data into memory: Foo bar(File("myfile.txt")); or would it be better to say Foo bar("myfile.txt"); and let the ctor of Foo create the file object?