5,347 reputation
11535
bio website blog.svick.org
location Czech Republic
age 26
visits member for 4 years, 3 months
seen 46 mins ago

8h
comment Is it good practice to inherit from generic types?
Also, Irony used these non-generic classes inheriting from generic ones since the first commit in 2007.
8h
comment Is it good practice to inherit from generic types?
"C# has been used for a lot longer than it has had generic types for." Not really, C# without generics existed for about 4 years (January 2002 - November 2005), while C# with generics is now 9 years old.
2d
awarded  Popular Question
Dec
15
comment OK to make a method generic just to pass in a System.Type?
Because of #1, I would consider having both overloads. For example, GetCustomAttribute() does just that. The generic one for convenience, the one taking Type for when you only have Type.
Dec
12
revised Explicitly defining variable data types vs. using the keyword 'var'?
rm tag from title; rm thanks
Dec
11
comment Is there ever a reason to use an array when lists are available?
The question specifically asks about the .Net type List<T>, which is not implemented using a linked list, but using an array (it's essentially equivalent to ArrayList<T> in Java).
Dec
11
comment Is there ever a reason to use an array when lists are available?
Actually, .Net is weird in this regard: multidimensional arrays (e.g. T[,]) are slower than the equivalent jagged arrays (e.g. T[][]).
Dec
11
comment Is there ever a reason to use an array when lists are available?
@PeteBecker The expression vector<T> x compiles just fine for me in C. :-)
Dec
11
comment Using reflection vs creating a new class
Writing a throwaway script that parses a code file in a very specific format (like the one in your first snippet), manipulates it to the new format and outputting a replacement is also straightforward.
Dec
11
comment Using reflection vs creating a new class
Why do you have to create a new class for every egg? Why not something like new EggValidatorMapping("Egg1", validator1, validator2)?
Dec
9
awarded  Popular Question
Dec
8
revised Java - Can't call an Array from a different method
edited tags; edited title
Dec
8
comment Adding non distinct elements to a dictionary
@whatsisname If you have multiple threads, then neither option is safe without a lock. So no, option 2 wouldn't be more appropriate.
Dec
8
revised Adding non distinct elements to a dictionary
link formatting
Dec
7
comment Adding non distinct elements to a dictionary
BTW, if you post code samples, it's better if they actually compile (no missing semicolons) and are indented properly.
Dec
7
answered Adding non distinct elements to a dictionary
Dec
7
comment Historical precedent for why Prolog is less popular than SQL in Imperative Programming?
@amon That sounds like the start of a good answer :-)
Dec
5
awarded  Nice Question
Dec
4
revised How to test when arranging the data is too cumbersome?
syntax highlighting
Dec
4
asked How to test when arranging the data is too cumbersome?