It is not uncommon to oppose the empirical process of TDD, together with its heavy use of unit tests, to the more mathematically based techniques, with the “formal methods” and formal verification at the other end of the spectrum. However I experienced again recently that the process of TDD can indeed help discover and draw…
Étiquette : enum
Programmation
Polymorphic enums in C#, implementation revealed
by Pierre Irrmann •
(pour consulter l’article précédent: Polymorhic enums in C#, generic incrementation) How can we implement a polymorphic enum to mimic the Java ones ? In a previous post, as an answer to @cyriux’s one, I showed how we could try to use a polymorphic enum in C# in order to mimic the Java ones. I have…
Programmation
Polymorphic enums in C#, generic incrementation
by Pierre Irrmann •
Consultez ici l’article précédent During the implementation of my polymorphic enum, I have chosen to allow several types for the underlying “ordinal” value, as it is also possible for standard C# enums… From the MSDN documentation, the allowed underlying types for enum types are the following (although other value types such as char are eligible,…
Programmation
Polymorphic enums in C# ?
by Pierre Irrmann •
Using Java as a inspiration source for C# (hmm wait, hasn’t that already been done from the start ?) A few weeks ago, I read this post by @cyriux, describing how you could use polymorphic enums in Java. Actually, I had already heard him telling that enums in C# were nothing like the ones in…
Programmation
Java Enums: You have grace, elegance and power and this is what I Love!
by Cyrille •
While Java 8 is coming, are you sure you know well the enums that were introduced in Java 5? Java enums are still underestimated, and it’s a pity since they are more useful than you might think, they’re not just for your usual enumerated constants! Java enum is polymorphic Java enums are real classes that…