What if we gave you $100 to spend? [Krzysztof Cwalina]

What if we gave you $100 to spend? [Krzysztof Cwalina]

  • Comments 37

The BCL team is starting to plan our next release. Is there any base API that if you’d heard we were working on you’d say “I can’t wait to get the next version of the Framework”? Any basic data structures? Any Win32 functionality that we don’t currently expose in the Framework and you can’t live without? Any APIs that other frameworks have and you miss them in the .NET Framework?

 

Tell us how you would distribute hypothetical $100 to fund the features. For example, this is what I would do if my car manufacturer asked me this question:

  1. The ability to wirelessly upload music to the car’s stereo system ($60)
  2. More torque ($30)
  3. Beep when I lock the car ($5)
  4. Larger trunk ($5)
  • I'd love a good generic collection that I can use to derive my own custom collection implementations from. The current System.Collections.ObjectModel.Collection<> lacks several important functions such as sorting and single entry point adds and deletes (to verify non null entries or to set ownership for example).
  • How about unloadable dlls... I know you can kludge it by using appdomains, but why can't a dll "garbage collector" be created. After you unload a dll, the "garbage collector" will unload it as soon as no more objects created from classes in it loaded. Of course there is the can of worms about subsequently trying to create an class from an unloaded dll... Still, handling it is no different than what people are doing with appdomains today...
  • I would pay the entire $100 to get a GetDeclaredInterfaces function that would only returned interfaces specifically declared on a type.

    public interface IService {}

    public interface IUserInterface: IService {}

    internal UserInterfaceImplementation: IUserInterface {}

    ...

    type.GetDeclaredIntefaces() would return only IUserInterface rather than type.GetInterfaces() which returns both IService and IUserInterface.

    -- Robert
  • $10 "first-class" xs:YearMonth and xs:Date types with XmlConvert support
    $25 TimeZone support for DateTime behaviour: conversion, ToString(), numeric (+01:00) and named TimeZones (GMT / Z)
    $10 Support for BCE dates (remove internal reliance on TickCount??)
    $35 Complete exposure of the remaining NLS API capabilities via System.Globalization
    $20 Exposure of some Windows localization resources (e.g. "Help" for menus, etc)
  • $20 Integrate DynamicAccessor, DynamicComparer and DynamicFilter (classes that use cached DynamicMethod-delegates to remove almost all costs to doing Reflection-like access of object properties, comparing them and filtering them).  [You can start with mine ;)]

    $30 TimeZones (and all appropriate behavior for converting to/from and tracking of input timezone/offset in DateTime).

    $10 ArgumentValidation class that brings best-practice validation of arguments, should include basic locale-safe IsNumber, IsCurrency, etc. [You can start with mine ;)]

    $15 Loan yourself out to the ASP.Net team to fix the steaming pile that is known as ObjectDataSource.

    $10 Unloadable AppDomains

    $5 Set collection and flesh out the collections (use PowerCollections for a starting point).

    $5 Fix and enhance HtmlEncode and HtmlDecode to support all W3C entities, not the subset currently supported.  Add unsafe-tag-stripping methods.

    $5 Currency class that tracks the unit of currency and the decimal.
  • Oh, and I forgot...

    $0 Fix TypeConverter.IsValid to actually work as documented [see: http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=9810731d-021a-4de1-90aa-24fdc0d259b4 ]

    $0 Fix Framework use of CurrentUICulture (where it should be CurrentCulture). [see: http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=b0e0eff7-7ab6-4b82-ba84-e3a181a884ef ]

    $0 Fix System.Web.Caching.CacheSingle's TrimLock bug [see: http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=64a8cd76-0d1b-4c50-9cbc-1894fde44a4f ]

    These are bugs, trivial to fix and shouldn't cost me anything! The first two are serious lapses in the correctness of BCL, and the last one is just silly.
  • Sounds like you are scrumming..
  • This is more of a C# thing than the BCL, but it would REALLY rock to be able [when desired] pass a struct by-reference to operator +=, -=, *=, /=, %=.  This would make matrix operations much cheaper to implement!

    [see http://blogs.extremeoptimization.com/jeffrey/archive/2005/02/19/153.aspx ]
  • $100 for adding a switch that makes all framework classes use CultureInfo.InvariantCulture by default.

    Currently if you miss a function you could for example write incorrect data to files (hidden bug). If it were the other way around you'd still have a bug but it would be more visible on the UI and not cause faulty data.
  • 5: Units (SI, etc) as a compile-time-checkable type (probably a CLR change)

    10: Library of standard validators (numeric types, common regexes, etc)

    5: Library of common XML namespaces

    15: Library of common schemas (RSS, Exchange, etc) marked up for XLinq

    15: A type to transform a graph into something similar to a XML-navigable structure.  This would allow searching a structure for nodes matching certain patterns (see http://blogs.msdn.com/kfarmer/archive/2006/03/15/551780.aspx).  Might entail creating a standard visitor implementation (see next item).

    15: Standard, best-practices implementations of certain pattern types (singleton, sink, source, processor = sink + source, etc).  The singleton is something that most people don't seem to get right, for one.

    10: An out-of-the-box way to wrap a stream as an IEnumerable<T> (for read-only purposes of course)

    5: Generics w/ operators (okay, so that and its ilk are actually CLR issues)

    10: List<T>.ForEach moved to IEnumerable<T>, and a multi-threaded overload made available (see http://blogs.msdn.com/kfarmer/archive/2006/04/01/566466.aspx)

    10: Array slices and indexable collections (see http://weblogs.asp.net/brianbec/archive/2006/03/15/440293.aspx)
  • Further on validators:

    I think it'd be nice to have attributes that provided the validation information, and then a method that could be called, passing in the propertyinfo/fieldinfo and the value in question.  The validation info could be grouped or otherwise named, such that you could select which validation parameters to use (for example, to select between different regexes for phones, based on the value of the country).  It would be useful to also have overrides that could take validation info directly.

    [NumericValidation(1, NumericValidationOperator.GreaterThan, 5)]
    [NumericValidation(1, NumericValidationOperator.IsOdd)]
    [NumericValidation(2, NumericValidationOperator.IsEven)]
    int Foo
    {
     get;
     set
     {
       if (Validate(MethodBase.GetCurrentMethod()))
       { this._foo = value; }
       else
       { ... exception ... }
     }
    }
  • Re indexable collections and slicing: meant to link to http://blogs.msdn.com/kfarmer/archive/2006/04/01/566466.aspx
  • $70: More collections!
    (Start with PowerCollections and C5 as a baseline. At least include the basics: sets, binary trees, etc.)

    $20: Complex number support
    (Needs to interop well with base numeric types; add appropriate support in System.Math)

    $10: Better use of generics where useful (Enum.Parse<T>, WeakReference<T> etc.)

    And please pass on the following requests (I'm on my knees begging!) to the CLR & C# teams.

    -Generic operator overloading
    -Covariant return types (including out parameters)
  • 10: Rationals

    You'd of course need the means to reduce them to avoid over/underflows.  But a buddy just suggested you could just wrap everything in a checked and do the reduction in the case of an exception -- this could happen automatically.  Exposing prime factorization for the numbers would be good as well.
  • re: Rationals.

    You can get a pretty strong implementation from the CodeProject stuff I contributed on here:

    http://www.codeproject.com/csharp/Fractiion.asp

    I've got a slightly improved version I can blog about if anyone is interested which uses Generics to get even clearer.
Page 1 of 3 (37 items) 123