12,981 reputation
11948
bio website
location
age
visits member for 3 years, 1 month
seen yesterday

1d
comment How to break these long C++ lines in a neat way?
@Panzercrisis: Given modern monitors and IDEs 80 columns still makes a lot of sense because 1) the IDEs usually have a lot of junk to the sides and 2) because you often need to compare two bits of code side-by-side. In those cases people with good sight and thus small font will fit perhaps 100 characters, but people with worse sight who need bigger font will struggle to fit even 80.
Nov
20
comment Writing generic code when your target is a C compiler
@DavidCary: Sure I did. But the point is it is (runtime) polymorphic, not generic.
Nov
13
revised Should we add constructors to structs
added 10 characters in body
Nov
12
awarded  Enlightened
Nov
12
awarded  Nice Answer
Nov
11
answered Should we add constructors to structs
Nov
11
comment Should we add constructors to structs
@StevenBurnap: If the constructor does anything more than just setting field values in basic ways it is only more appropriate to have it. Even on a struct.
Nov
7
comment Must I provide my project source code if I use a library licensed under Apache 2.0?
Note that Android, except the kernel, is under Apache 2.0 license and most vendors do not provide sources of their customizations.
Nov
3
answered Alternative to printing debug information to stdout\stderr
Oct
29
answered Pair programming via mailing list
Oct
29
comment Shortest Path Between Two Nodes in a +10 Million Nodes Graph
Is it likely that the long paths usually use a limited subset of vertices ("key ideas")? If yes, then you could probably adapt some of the techniques used for road networks. This research group in Karlsruhe provides papers describing some methods and you can find more via their references. You don't have to identify the key vertices; the contraction hierarchy or highway hierarchy algorithms will do it themselves if the graph is sufficiently non-homogenous.
Oct
29
comment Should I store images in my database or file system in this application?
Advantage of having images in filesystem is that you can serve them from separate box with some lighter-weight (and consequently faster) server like nginx or lighttpd. But of course it opens room for consistency problems.
Oct
21
comment Robustness and pointer safety in C++
@Muton: As I said, you can catch null (invalid) pointer access in C++. With structural exceptions on Windows and signals on Unix. Use-after-free and buffer overruns are worse as they usually just return garbage; most can be eliminated by using proper containers instead of raw pointers.
Oct
21
comment Robustness and pointer safety in C++
@msw: I haven't had a pointer error in my code in years and in the codebase as a whole we had a couple and they came up in the first test and were quickly fixed. With proper use of constructors, destructors and smart pointers, they are not likely any more. And we don't even have C++11, only boost. What we do have problems with is thread synchronization, but that's a problem in Java and C# too.
Oct
21
comment Robustness and pointer safety in C++
Oh, and of course you can handle null pointer exceptions in C++, though it is operating system dependent.
Oct
21
comment Robustness and pointer safety in C++
I can't really imagine a situation where I'd have null pointer exception, handled it and the software sensibly worked. When it gets NPE, there is a bug and it has to be fixed anyway.
Oct
13
comment When, if ever, can code standards be ignored?
@corsiKa: I fully agree, but there is a problem. From the first few encounters it's difficult to see how often it is going to come up later.
Oct
7
comment Why should your code not use 100% CPU?
@NtscCobalt: Yes. What does apparently not is Windows CE. And Windows have serious problems whenever a process is heavy on disk, but that's obviously something different (disk handling is rather poor in Windows in general).
Oct
7
comment Why should your code not use 100% CPU?
Of course programs doing long-term computations should probably not be winforms/wpf applications but instead batch jobs with no UI. That makes them simpler as they don't need to care about having responsive UI thread and allows launching them via task scheduler and such. If UI is needed, I would still recommend launcher application in completely separate process (that can remain responsive quite easily; it's enough to avoid blocking wait for status message from the batch job).
Oct
7
comment Why should your code not use 100% CPU?
Windows work this way. In Linux and many other systems threads that waited on something (user input) automatically get priority over threads using up their allocated time, so the interactive programs remain responsive even when you don't play with priorities.