3,905 reputation
1638
bio website heinzi.at
location Vienna, Austria
age 35
visits member for 3 years, 8 months
seen 22 hours ago

Mar
20
comment Why aren't field-like events implemented as a list of delegates?
@JeppeStigNielsen: At least with C# 6.0 and the Elvis operator, the null check won't be necessary anymore: MyEvent?.Invoke(this, e);
Mar
15
comment Why aren't field-like events implemented as a list of delegates?
Yes, that's exactly my question: Why did they choose a (custom) list representation with an utterly inconvenient 0-element case instead of a (default) list with a convenient 0-element case?
Feb
28
comment Am I designing software or architecting software?
I doubt there is a formal definition for job titles such as "software designer" or "software architect". Choose whatever buzzword you would like to see on your CV.
Dec
14
comment When to use .ToString() when concatenating a string in C#?
Side note: In VB.NET, this ambiguity is avoided by having an explicit string concatenation operator: "Expression: " + a will throw a compile time error (with Option Strict On), "Expression: " & a will perform string concatenation.
Apr
28
comment Static linking with modified LGPL code
@TacB0sS: It means that if you statically link MyApp.obj to SomeLgplLibrary.lib to create MyApp.exe, you need to provide MyApp.obj, so that the user can replace SomeLgplLibrary.lib with SomeCompatibleLgplLibrary.lib and re-link MyApp.exe.
Apr
28
comment Static linking with modified LGPL code
@TacB0sS: "(not necessarily source)" applies to your application, whereas "has the opportunity to modify" applies to the library.
Apr
19
comment What is meant by a primitive data type?
...and the wink illustrates the (obvious) implication that his definition of a primitive type is not particularly in the context of C#.
Apr
19
comment What is meant by a primitive data type?
@barlop: My comment starts with "Then...", so please read it in context: Josh said that by his definition, C#'s int is not a primitive type, and I replied that, in that case ("then"), none of C#'s types were primitive, since none meets his definition of primitive.
Jan
29
comment Are classes with only a single method a problem?
Related (almost a duplicate): programmers.stackexchange.com/q/175070/33843
Nov
21
comment Dictionary of objects
Due to floating-point inaccuracies, I'm not sure if double is a wise choice for a dictionary key.
Nov
12
comment In retrospect, has it been a good idea to use three-valued logic for SQL NULL comparisons?
@DanielB: That was exactly the point of my question: From a mathematical point of view, it all makes perfect sense. However, from a practical point of view, does it really make life easier for developers?
Nov
7
comment In retrospect, has it been a good idea to use three-valued logic for SQL NULL comparisons?
PS: I know that this borders on "too broad" and "opinion-based", but I've tried to make it as answerable as possible. It is not meant as a rant, but as a genuine question.
Oct
21
comment I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?
Nice idea! One drawback: In your example, validation is actually performed twice: Once during Validate (returning False if invalid) and once during Save (throwing a specific, well-documented exception if invalid). Of course, the validation result could be cached inside the object, but that would add additional complexity, since the validation result would need to be invalidated on changes.
Sep
12
comment Hiding query strings logically?
@ratchetfreak: Please elaborate. I'm quite familiar with web.config, yet I do not see the relevance of your comment to the question.
Sep
12
comment What can multiple threads do that a single thread cannot?
@ColeJohnson: A deadlock is an implementation detail. The visible output is "not halting", which is easily doable with a single thread.
Jul
25
comment How to develop line-of-business tablet apps as a .NET developer?
@Jetti: It might interest you that, for performance reasons, your option 1.) was the one successfully used in the end (after trying a HTML-based solution).
Jul
20
comment Why do CSV file formats normally use quoting instead of escaping?
I'm not sure it would be easier: For example, in foo,bar,foo\\,bar, the last comma would be a field separator.
Jun
12
comment If the model is validating the data, shouldn't it throw exceptions on bad input?
+1, I'd much rather have a descriptive ValidationException than going back to the dark ages of having to check the return value of every method call. Simpler code = potentially less errors.
Jun
10
comment Responsibility to reproduce bugs
So if an app crashes "every now and then", without dicernible pattern for the user, then the developer does not have to fix it because the user cannot reproduce it on command? I strongly disagree here...
May
4
comment I should have used a factory method instead of a constructor. Can I change that and still be backwards-compatible?
+1, nice option. I still prefer option 2, though, since it allows me to access XmlDataSource-specific functionality by explicitly instantiating XmlDataSource.