Joshua A. Schaeffer

My feedback

  1. 146 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    7 comments  ·  Visual Studio IDE » .NET  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    I think people have been clamoring for an INumeric<T> for a long time now actually, there's even been high-level discussion.

    Joshua A. Schaeffer supported this idea  · 
  2. 181 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    5 comments  ·  Visual Studio IDE » .NET  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    I'd like to add, when you define a "static readonly" variable in a class, that should go into another heap that doesn't get scanned during a GC.

  3. 134 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    9 comments  ·  Visual Studio IDE » .NET  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    I definitely think the .NET Framework should support a wider variety of intrinsics for things like this.

  4. 221 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    14 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    "const" already means "compile time", so my vote would be with "readonly". This feature would keep you in good behavior while writing the rest of the method in question. I would say we should also allow "readonly" with method parameters, which are after all on the same stack as local variables.

    readonly int customer = customers.First();

    Joshua A. Schaeffer supported this idea  · 
  5. 241 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    6 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    This is a no-brainer, I don't know why it doesn't get top votes considering how simple it is. Yes you can pass in a delegate as a generic parameter but it has to have a "class" constraint. And you can pass in an enum but it has to have a "struct" constraint. Inside the generic method though, there is no strong-typing against the delegate or the enum. There's no explainable reason for this.

    Joshua A. Schaeffer supported this idea  · 
  6. 138 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    23 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    I have a simple class that implements INotifyPropertyChanged, caches PropertyChangedEventArgs instances, and exposes PropertyChanged that you want to use the += operator on. I want to be able to tack this onto any other class. Without multiple inheritance I have to duplicate this functionality every single time and maintain it separately every single spot.

    People who are against multiple inheritance tend to be simple programmers. Bleeding edge requires more.

  7. 199 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    15 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
    Joshua A. Schaeffer commented  · 

    You can thank me later.

    public static bool InRange<T>(this T value, T lower, T upper) where T : IComparable<T>
    {
    return (value.CompareTo(lower) >= 0) && (value.CompareTo(upper) <= 0);
    }

Feedback and Knowledge Base