Contents tagged with C#
-
Mixing Server and Client-side - is it hard to be elegant?
I had to write some functionality for a friend tonight based on the following request :
-
How to build a comma-separated list
Dave has an interesting little thread going about how to do build a comma-separated list and what you can do with that annoying, left-over ',':
-
More language esoterica - falling through a switch statement
Not that I'm much of a comp-sci guy but, I do like my language esoterica... earlier I posted about repeating structures in C# and it got me thinking about other language features - many of which are shared between VB and C# such as short-circuit evaluation and such. One language feature which I thought was pretty cool that C# didn't implement was switch-case fall-through. I'll bet that was a tough one to leave out! Here's an example of using fall-through behaviour to convert a number of Days, Hours, Minutes, or Seconds toMilliseconds:
-
Going loopy over control statements
While reading through some Rotor source I was reminded of the wonderful C# syntax for looping constructs, some of which included:
-
Some helpful Generics guidelines
Krzysztof Cwalina is a BCL team member who has just started blog'ging. His first post is an update to the design guidelines for Generics - a really useful document.
-
Some new stuff I learnt about the Console
It's amazing how often related events seem to occur close to one another. Often I'll be working on a project and I'll need some code to do something I've never done before ( for example, writing an Ftp client ) and on the same day someone will post some cool code which does exactly what I need, or I'll stumble upon an article which does. It happened again this weekend.
-
Defensive coding practices - check inputs
Something which, although I knew a bit about through my scant knowledge of using the Command line, had never really dawned up me. I created 2 files called "File.txt" and put them into the following locations:
-
SqlDataReader.Dispose( [I think]true ) ;
I've finally started doing some application development again (it's been a while), and had to construct a bunch of DataTier methods and classes. I did lots of data access but, one of the things that I noticed was that I didn't use a single data reader! Maybe I'm missing something, and maybe (likely) I've just constructed a poor app. but, I just couldn't think of a single place to use one.
-
Picking random guys
Ron just asked me to demo how I thought the Random guy selector would be implemented so, I thought I'd crank out a quickie demo. First, I'll create a Guy type:
-
New problems, new algorithms
I couldn't help but blog this. On the [C# lang] list the following question was asked: