jaybaz [MS] WebLog

We believe in nothing.

May, 2004

  • jaybaz [MS] WebLog

    enum->class Refactoring the OO way

    • 7 Comments
    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...
  • jaybaz [MS] WebLog

    Generic Enum helper dud

    • 0 Comments
    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...
  • jaybaz [MS] WebLog

    Refactor enum->class: Answer 1

    • 0 Comments
    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...
  • jaybaz [MS] WebLog

    Advanced bug reporting

    • 2 Comments
    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...
  • jaybaz [MS] WebLog

    Please send in crash reports

    • 8 Comments
    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...
  • jaybaz [MS] WebLog

    Refactor enum->class

    • 6 Comments
    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...
  • jaybaz [MS] WebLog

    EnableRTLMirroring

    • 5 Comments
    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...
  • jaybaz [MS] WebLog

    Time off

    • 6 Comments
    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...
  • jaybaz [MS] WebLog

    The perfect software project

    • 14 Comments
    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,...
  • jaybaz [MS] WebLog

    Update C# 2.0 Specification

    • 0 Comments
    The updated spec has been posted.
  • jaybaz [MS] WebLog

    rethrow for debugging

    • 14 Comments
    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...
  • jaybaz [MS] WebLog

    An update on C# Edit and Continue

    • 40 Comments
    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...
  • jaybaz [MS] WebLog

    A new C# team blogger

    • 4 Comments
    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.
  • jaybaz [MS] WebLog

    Cleaning up 'using' directives

    • 8 Comments
    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...
  • jaybaz [MS] WebLog

    Generate Method Stub

    • 2 Comments
    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...
  • jaybaz [MS] WebLog

    The new new lazy loader

    • 15 Comments
    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...
  • jaybaz [MS] WebLog

    Cyrus likes Weak & Strong references

    • 13 Comments
    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...
  • jaybaz [MS] WebLog

    Cyrus enhances Optional<>

    • 2 Comments
    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...
  • jaybaz [MS] WebLog

    The new LazyLoader

    • 8 Comments
    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; ...
  • jaybaz [MS] WebLog

    Lock/NoLock code

    • 4 Comments
    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...
  • jaybaz [MS] WebLog

    Cyrus’s Optional<T>

    • 2 Comments
    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>...
  • jaybaz [MS] WebLog

    Re-ZBB coming

    • 0 Comments
    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...
  • jaybaz [MS] WebLog

    Default references list in the VS IDE

    • 7 Comments
    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...
  • jaybaz [MS] WebLog

    Unbound type smart tag

    • 6 Comments
    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...
  • jaybaz [MS] WebLog

    String colorization

    • 6 Comments
    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”...
Page 1 of 2 (26 items) 12