|
|
Browse by Tags
All Tags » Code » C#
Showing page 3 of 3 (25 total posts)
-
My previous article on this subject dealt with creating a lazy-loaded data type. But, if you think about it, that's realy just a collection, with just one item. I promised you use of generics without collections, so let's move this to the next step, using the type to affect the behavior of the code, without ever storing an object of that ...
-
Some time ago, I needed a function that would take a block of text, and word-wrap it at a specific line length. As apparently you have now done, I googled for it, and found a blog with a seemingly appropriate algorithm.
Except it wasn't. I immediately noticed that it wasn't very efficient -- but that was merely annoying. It wasn't grave ...
-
Having moved to C# after years of being a C++ programmer, I was quite happy when generics were added to C#. I could finally do some of the things I was doing before with C++'s templates.
However, I noticed something about how C# programmers were using generics --- In fact, it was exactly the way C++ programmer were using templates when they ...
-
Mads Kristensen wrote on the subject on if/else statements in C#, running time benchmarks on code such as this: private bool RunIf(string input) { if (input == ''hello'') return true; else if (input == ''jelly'') return true; else return true; } I wrote an analysis in the comments in his blog, but I ...
-
Based on a CodeSmith template (v1.4) by Lance Hunt.
3
|
|
|