12,717 reputation
11847
bio website
location
age
visits member for 3 years
seen 8 hours ago

13h
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.
13h
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.
13h
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.
13h
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.
Oct
7
awarded  Yearling
Oct
7
answered Should private key files be checked-in in git?
Oct
7
comment Should private key files be checked-in in git?
Is the key needed to build the software at all, a key needed to build the software and the key blesses it as official or is the key needed to get a particular installation do what it should?
Oct
7
comment Should private key files be checked-in in git?
@kostix: There are keys that are part of the source, not configuration. It depends how the key is used (and the question only gives limited details).
Oct
7
comment Should private key files be checked-in in git?
And how do you authenticate the public key if the client gets it from the internet? Sorry, that advice sounds extremely off. -1 for that part.
Oct
6
comment Why is object-level privacy difficult to use as a paradigm, and why is it desirable?
What about ruby. It has object-level privacy (and does not seem to have class-level one).
Oct
6
comment What should I do in C++ when implementing a container class: storing objects by value or by reference?
C++ does have a stack in standard library. It's creatively named std::stack so it shouldn't be hard to find. And this one is there since the initial SGI STL. You don't need to implement it.
Oct
2
answered FizzBuzz on Large Scale
Sep
29
comment How do I compile my software for all platforms from Ubuntu Linux 64 bit?
So what is your problem? Maintaining the build system or actually running the builds somewhere or what? And what build system and what language?
Sep
28
comment Why do most programming languages have special keyword or syntax for declaring functions?
Methods are fundamentally just a special kind of functions. -1. Note that Java (and by extension Scala) doesn't have any other kind of functions. It's "functions" are objects with one method (in general functions may not be objects or even first class values; whether they are depends on the language).
Sep
15
comment Is it bad practice to use Inheritance to associate methods with a basic container?
Collections don't have any virtual methods, so you don't get anything and you risk breaking the subclass invariants by direct calls to the base class methods. It's better to delegate.
Sep
12
comment Is it bad practice to use Inheritance to associate methods with a basic container?
You missed the point of the question. It is fine to create inner class but it is not fine to derive it from std::map.