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...
Postedby jaybaz_MS | 7 Comments    
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...
Postedby jaybaz_MS | 0 Comments    
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...
Postedby jaybaz_MS | 0 Comments    
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...
Postedby jaybaz_MS | 2 Comments    
Filed under:
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...
Postedby jaybaz_MS | 8 Comments    
Filed under:
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...
Postedby jaybaz_MS | 6 Comments    
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...
Postedby jaybaz_MS | 5 Comments    
Filed under:
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...
Postedby jaybaz_MS | 6 Comments    
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...
Postedby jaybaz_MS | 14 Comments    
Update C# 2.0 Specification
24 May 04 03:06 PM
The updated spec has been posted. Read More...
Postedby jaybaz_MS | 0 Comments    
Filed under:
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    
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...
Postedby jaybaz_MS | 40 Comments    
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...
Postedby jaybaz_MS | 4 Comments    
Filed under:
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...
Postedby jaybaz_MS | 8 Comments    
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...
Postedby jaybaz_MS | 2 Comments    
Filed under:
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...
Postedby jaybaz_MS | 15 Comments    
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...
Postedby jaybaz_MS | 13 Comments    
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...
Postedby jaybaz_MS | 2 Comments    
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...
Postedby jaybaz_MS | 8 Comments    
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...
Postedby jaybaz_MS | 4 Comments    
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...
Postedby jaybaz_MS | 2 Comments    
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...
Postedby jaybaz_MS | 0 Comments    
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...
Postedby jaybaz_MS | 7 Comments    
Filed under:
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...
Postedby jaybaz_MS | 6 Comments    
Filed under:
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...
Postedby jaybaz_MS | 6 Comments    
Filed under:
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...
Postedby jaybaz_MS | 0 Comments    
Filed under:

This Blog

Syndication

Page view tracker