2,416 reputation
2617
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 3 years, 7 months
seen Jul 9 at 9:01

Mar
29
comment Why can't a compiler avoid importing a header file twice by its own?
On the MS compiler there is #pragma once which tells the compiler to only include that file once.
Mar
28
comment How to find siblings of a tree?
@CoffeeAddict I did not say it is trivial. I explicitly said it is not, and I allowed for minor mistakes. But I think finding the main algorithm isn't very hard. Testing the code and ensuring that all corner cases work takes more than 5 mins, but writing the basic code down should be quite quick.
Mar
24
comment Test case design - do for all positive tests exist also negative ones?
There are two cases here 1) When you enter a number, no message is displayed 2) If you enter a non-number it displays an error. You should write a test case for both of these. It doesn't matter which of these you label "positive" or "negative", just that you test both of them.
Mar
23
comment Why does Cem Kaner consider a test not revealing a bug a waste of time?
IMO a caught regression counts as a caught bug. It's just not a bug that was present at the time the test was written.
Mar
22
comment Bridging the Gap from Amateur to Hirable
Write some small projects. It doesn't matter if they're noteworthy. I have produces a huge pile of small programs nobody is or will ever be interested in. Most of them even abandoned before completion.
Mar
22
comment Configuration file that can be modified by user in C#
One important question is where you want to store this file. Since you're talking about a service, you probably don't want unprivileged users to be able to change the file, else you get the risk of a privilege escalation vulnerability.
Mar
22
comment Is “White-Board-Coding” inappropriate during interviews?
Even if it's just notepad.exe it's so much easier to work with than paper or a whiteboard. You can insert or delete lines, which is a huge pain on physical media.
Mar
22
comment Is “White-Board-Coding” inappropriate during interviews?
"simple" and "reverse a string" in one sentence? IMO that's quite a difficult task, and I'd need extensive documentation checking(and probably googling) to do that. So many subtle corner cases...
Mar
21
comment Why have hardware-accelerated vector graphics not taken off?
Not entirely sure what you want, but what about Cairo, Mozilla Azure, and Direct2D?
Mar
21
comment Are generic programming and OOP mutually exclusive?
@RobertHarvey The main difference between a generic in the C# sense and a template in the C++ sense is that a C# generic binds to interfaces and does overload resolution using the abstract type parameter whereas C++ binds to names and does overload resolution with the concrete type at instantiation time.
Mar
21
comment What is a good design for a container, assignment and items
I'd give Flight a property Bookings and a property Users, where Users is a convenience feature. I'd mostly abandon the notion of Container and Assignment, but if you really want you can use interfaces(IContainer with property IEnumerable<IAssignment> Assignments to represent them.
Mar
21
comment Do unit tests sometimes break encapsulation?
@MattFenwick It might be a sign that they should be moved to a different class, but that class should probably be internal, so you still end up testing internals.
Mar
21
comment What's your favorite bit-wise technique?
I've seen MS C++ output similar code for a division by a constant. Division is slow on some CPUs (even x86) compared to a multiplication and some bit operations. Essentially it multiplied by 2^32/c, took the high 32 bits, and then applied some extra operations to handle the corner cases.
Mar
18
comment Writing an API that is syntactically valid in multiple programming languages
IMO it's more important to follow platform conventions than having an identical API. Having a similar API is probably a good idea, an identical API probably not.
Mar
17
awarded  Populist
Mar
17
comment strategies for dealing with machine epsilon
Use a different type that represents numbers as fractions. Then you can represent all rational numbers exactly.
Mar
16
comment Is using `continue`, `break` in non-`switch` loops and `?:` bad practice?
break and continue are fine when used in moderation. ?: is a matter of style. I dislike it, but it's not necessarily bad.
Mar
14
comment Do You Still Need Indexing After Database Normalization
The index on the primary key doesn't count?
Mar
14
comment UTF-16 Pitfalls, Chinese
Only use UTF-8 when working with string and char. Use UTF-8 for output. The only unusual problem is that UCS-2 != UTF-16, since Chinese has some codepoints that require two code-units (i.e. one codepoint that consists of two chars)
Mar
14
revised How to make .exe file from html5 css application?
dressed links, fixed grammar