Browse by Tags

What I'm doing these days
28 January 05 01:52 PM
Gee, this blog has been pretty quiet. Why? Could I have lost interest in the connection with all the C# developers in the world? No! My responsibilities have drifted somewhat, to areas that make less sense to blog about. Dev Lead I'm the development lead Read More...
Postedby jaybaz_MS | 5 Comments    
'switch' in C#
15 November 04 06:02 AM
On Eric's blog, a discussion about 'switch' statements in C# & why they require 'break' inspired this post. One of my favorite principles in the design of C# is that it forces you to be explicit when that removes confusion. The best example is the Read More...
Postedby jaybaz_MS | 20 Comments    
Won't Fix or Postponed?
16 September 04 10:42 AM
In our bug database, when resolving a bug, you have to select a “Resolution”. Obviously you can resolve as “Fixed”. Other options include: By Design - this isn’t a bug, we meant it to work this way. Not Repro - you were mistaken, this bug doesn’t exist. Read More...
Postedby jaybaz_MS | 5 Comments    
Separating out unit tests
09 September 04 02:33 PM
This question came up on a customer chat today. It’s probably interesting to a wider audience, so I’m posting it here. I'm currently doing TDD with NUnit. With the upcoming testing tools in Whidbey, how do you see the separation of tests from production Read More...
Postedby jaybaz_MS | 4 Comments    
A Factory pattern
01 September 04 02:49 PM
The idea popped in to my head, so I wrote it down. I’m not sure what it’s good for, but here it is: class C { private C() { } public static class Factory { public static C New() { return new C (); } } } class Program { static void Main ( string [] args) Read More...
Postedby jaybaz_MS | 7 Comments    
What are named indexers?
21 July 04 09:49 AM
Someone asked me about this, so I decided to write up the answer here in case other folks are interested. Indexers are pretty well documented on the web; I’ll quote some here. http://www.csharphelp.com/archives/archive140.html C# introduces a new Read More...
Postedby jaybaz_MS | 8 Comments    
A way to do named indexers.
16 July 04 12:49 PM
In this entry on Ladybug , a customer asked for named indexers in C#. Here’s one way to get it: class Car { object [] wheels; public WheelsHelper Wheels { get { return new WheelsHelper ( this ); } } public class WheelsHelper { readonly Car _outer; Read More...
Postedby jaybaz_MS | 16 Comments    
The hidden costs of a Refactoring
07 July 04 10:49 AM
Looking over our oldest C++ code, there is, of course, a lot of potential for Refactoring. That’s a nice way of saying that it sucks. We learned about Refactoring because we wanted to build good tools for our customers. Along the way, we also realized Read More...
Popular patterns around events?
01 July 04 05:03 PM
In Properties with events: another attempt , Omer said: I would rather have a protected virtual OnSet method and AfterSet event than just an OnSet event (also consistant with the naming convention ;). I know understand that this is a common pattern found Read More...
Postedby jaybaz_MS | 6 Comments    
Making regex less painful
01 July 04 03:09 PM
So, Regex is darn powerful. But they’re hard to write correctly, hard to read, and hard to verify. To wit: Regex repositories around the ‘net, where you can find regexes instead of writing them. ( google ) Regex tools – Eric’s Read More...
Postedby jaybaz_MS | 7 Comments    
PDB always
29 June 04 11:51 AM
In my last post , I wrote: “ Debugging information (pdb). Set with ‘csc /debug[+|-]’. It doesn’t affect codegen, so it’s really not very interesting.” In my opinion, this should always be on, and compilers shouldn’t Read More...
Postedby jaybaz_MS | 8 Comments    
The C/C++ casting codundrum.
18 June 04 02:20 PM
In C, casting is simple. “See that thing on the right? It’s really a thing on the left.” The compiler was perfectly willing to consider any set of bits as whatever you like. With no inheritance & no casting operators, types generally Read More...
Postedby jaybaz_MS | 10 Comments    
rethrow for debugging
21 May 04 06:16 PM
A question came up on an internal email list. You will get this error in the following code, as per the rules of C#: try { .... } catch(Exception e) { // Handle cleanup. throw; } With the exception of disabling this specific warning, is there anyway to Read More...
Postedby jaybaz_MS | 14 Comments    
Scott’s lazy loader
30 April 04 03:37 PM
Scott Wisniewski posted a lazy loader implementation on his blog. He coded it blind, without the help of a compiler that could do C# generics. I went back through and made it legal C# code. I also did a little refactoring. The ILazyLoader is now nested Read More...
CCC2: InitializeComponent()
28 April 04 02:14 PM
Call it a Clearest Code Challenge: What should InitializeComponent() look like? What’s the best code you can imagine, that the WinForms designer should generate? Let’s take a simple, concrete case: a form with an OK button. The button is anchored Read More...
More Posts Next page »

This Blog

Syndication

Page view tracker