jaybaz [MS] WebLog
We believe in nothing.
May 2004 - Posts
enum->class Refactoring the OO way
31 May 04 10:18 AM
This one was pretty much TheoY’s. I coded it up, which probably means I corrupted his idea. So, give him credit for the good parts and I’ll take balme for the bad parts. Pretty much the same approach was taken in C++ by Johny in his comment
Read More...
Generic Enum helper dud
31 May 04 10:14 AM
I hoped I could write a generic helper class that you could use when Refactoring your enum to a class. I wrote this: class EnhancedEnum <T> where T : struct { public readonly T Value; public EnhancedEnum (T value) { this .Value = value; } public
Read More...
Refactor enum->class: Answer 1
31 May 04 10:07 AM
This is the follow up to the enum->class refactoring post . So, one approach is to try to decode what ‘enum’ does in C#. Thomas Eyre’s answer is pretty much the same, with a couple differences: · Thomas wrote his TDD, and delivered
Read More...
Advanced bug reporting
28 May 04 04:23 PM
A commenter asks about reporting crashes when working in a private network. There's another way to send in a crash, but it invloves a bunch of manual labor, on both your side & and on mine. One of the advantages is that it's good for reporting hangs,
Read More...
Please send in crash reports
28 May 04 01:34 PM
Cyrus blogs about the “Watson” technology we use. I want to second his request. When a product crashes & Windows offers to upload a crash report, please send it! The dumps get uploaded, analyzed by an automated system, and sent to the
Read More...
Refactor enum->class
27 May 04 10:36 PM
Every so often, I see a C# user say they’d like to add a method to an enum. Maybe it’s [Flags] and they want to verify that the combination of flags is legal according to their business rules. Or maybe they’re in the process of moving
Read More...
EnableRTLMirroring
27 May 04 02:27 PM
Rovert asks: “ What is RTLMirroring? ” The answer comes from Marin who is responsible for Visual Studio Localization: We made a breaking change to the RTL behavior for controls inheriting from the common control, so we added this new method
Read More...
Time off
27 May 04 11:21 AM
In a comment on the Perfect Software Project, 2 of Todd's items are: - Training days. The company doesn't have to pay for it, but if I want to go to TechEd, don't make me take vacation to do it. - Allow some playing around in your code. Every now and
Read More...
The perfect software project
26 May 04 11:52 AM
What do you love about how software development is done where you are? What do you hate, and how would you improve it? Suppose you could work on the perfect software project. What would it look like? What's the ideal hardware, tools, processes, people,
Read More...
Update C# 2.0 Specification
24 May 04 03:06 PM
The updated spec has been posted.
Read More...
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...
An update on C# Edit and Continue
17 May 04 11:33 AM
There has been a lot of discussion, both here and on Andy's blog about C# E&C. Some folks really want it badly. So, I figure you deserve an update on its status. At the last PDC, we got a lot of strong feedback along the lines of “We understand
Read More...
A new C# team blogger
17 May 04 10:49 AM
There's a new blogger from the C# team. Cyrus works for me on the IDE. He is being quite prolific on his new blog - 29 posts in 3 days. He's just as prolific when coding, which is great new for you - Cyrus's work results in better C# IDE features.
Read More...
Cleaning up 'using' directives
10 May 04 11:32 AM
A suggestion arrived in email, and here is my response. (None of this is on the feature list for Whidbey, it’s just ideas.) 1. Fully qualify (all names / all names in namespace X / all instances of type Y / the instance under my cursor), removing
Read More...
Generate Method Stub
10 May 04 11:23 AM
Chris got his wish : We have Generate Method Stub in Whidbey. There is a command & key binding in my build. It may not have made it into the last Community Preview, but it should be in the upcoming Beta. You can edit the test that gets inserted (its
Read More...
The new new lazy loader
07 May 04 04:02 PM
Cyrus then incorporated the Weak/Strong reference stuff into the LazyLoader. He also refactored the factory to give you a reliable, predictable default & be a bit simpler. (You also need Optional<> and the Lock<> code.) First, the delegate
Read More...
Cyrus likes Weak & Strong references
07 May 04 12:02 AM
Then Cyrus decided he wanted to support weak references. A weak reference is one that the GC can decide to release if there are no other references to it. For our LazyLoader, that would mean that you create the item when demand appears, and it may go
Read More...
Cyrus enhances Optional<>
06 May 04 11:54 PM
Cyrus just can’t stop! First he Refactored Optional<> , basically to use a singleton for None<> interface IOptional <A> { A Value { get ; } } class None <A> : IOptional <A> { public static readonly IOptional <A>
Read More...
The new LazyLoader
06 May 04 02:57 PM
Finally, the LazyLoader class. Credit goes to Kevin & Cyrus (who doesn't have a blog). delegate T Creator <T>(); class LazyLoader <T> { IOptional <T> value = new None <T>(); readonly ILock @lock; readonly Creator <T>
Read More...
Lock/NoLock code
06 May 04 02:51 PM
There was a comment that the LazyLoader was not thread safe . We decided to add thread safety & refactor. One of the concerns we had was that locking isn’t necessary if you know ahead of time that you’ll always be single-threaded. You
Read More...
Cyrus’s Optional<T>
06 May 04 12:21 PM
While Refactoring the LazyLoader , we produced the code below. It’s useful any time you want to add a sentinel value to a type. interface IOptional <T> { T Value { get ;} } class None <T> : IOptional <T> { public T Value { get
Read More...
Re-ZBB coming
05 May 04 08:27 PM
2 weeks ago we hit ZBB . We do some funky stuff to describe the goal. For example, we only counts bugs that are >48 hours so. Bugs take time to get routed, investigated, etc., so this helps make the problem more tractable. Then we discount bugs that
Read More...
Default references list in the VS IDE
02 May 04 11:30 AM
When you install VS (or rather the .NET Redist), you get a C# compiler (csc.exe + cscomp.dll), which comes with a csc.rsp. Gus blogs about how it affects how you build. However, this response file ony affects command line builds, not building with the
Read More...
Unbound type smart tag
02 May 04 11:24 AM
One of the things we're trying to do for Whidbey is a feature we call the “unbound type smart tag”. You'd probably call it “automatic add 'using'”, I guess. It works like this: You have a typename in your code, and you've referenced
Read More...
String colorization
02 May 04 11:05 AM
In VS, you can have your strings colorized. This feature has been around for a long time. However, the default string color is the same as the default text color, so you may not notice at first. In C#, there are two string colors: “String”
Read More...
ASP.NET in Whidbey
01 May 04 09:24 PM
Kevin is someone I make tea with pretty often. Oh yeah, we also work together. He has written his first real blog about his work on C# ASP.NET support in Whidbey . Also, some of the folks from the ASP.NET team have commented on the thread. Check it out
Read More...
This Blog
Home
Links
Tags
Admin vs. Normal User
C# Edit and Continue
Development Practices
Personal
PowerShell
Refactoring
Sailing
Visual Studio
Windows Home Server
Archives
November 2007 (2)
October 2007 (3)
September 2007 (2)
June 2007 (1)
April 2007 (2)
March 2007 (2)
February 2007 (1)
January 2007 (4)
October 2006 (2)
August 2006 (1)
May 2006 (1)
October 2005 (2)
August 2005 (5)
May 2005 (2)
April 2005 (6)
January 2005 (3)
December 2004 (6)
November 2004 (4)
October 2004 (3)
September 2004 (9)
August 2004 (14)
July 2004 (28)
June 2004 (54)
May 2004 (26)
April 2004 (16)
March 2004 (23)
February 2004 (11)
January 2004 (2)
December 2003 (3)
Syndication
RSS 2.0
Atom 1.0
See also my
Personal blog
.