GithubHelp home page GithubHelp logo

Comments (5)

anaisbetts avatar anaisbetts commented on April 19, 2024

What is the practical benefit to being CLSCompliant (i.e. what scenarios are currently impossible but are now enabled with this?)

from reactiveui.

 avatar commented on April 19, 2024

If the library is CLS compilant you can be sure that it is usable by all .NET languages such as VB, F# etc (in short being CLS compilant set some constraints on the naming externally accessible (public/protected) functions and variables).

In this specific instance protected members variables starts with underscore which is not possible all .Net compatible languages.

from reactiveui.

anaisbetts avatar anaisbetts commented on April 19, 2024

Which languages don't support this? Removing protected member variables that start with underscore is a breaking change.

from reactiveui.

 avatar commented on April 19, 2024

Regarding which languages don't support leading underscore I have seen some examples earlier but right now I can only come up with C++ where leading underscore is reserved.
"Use of two sequential underscore characters ( __ ) at the
beginning of an identifier, or a single leading underscore
followed by a capital letter, is reserved for C++ implementations
in all scopes."

I would still argue for at least putting CLSCompilant(true) at the assembly level so that other isssues such as names that differ only by case (which won't work with VB) is not introduced.

To preserve backwardscompability you could do a rename on the variables and then create propteries.
One property (which is annotated as depreciated and CLSCompilant(false)) with the old name and another version with a new name such as Changed. By not exposing member variables directly but though properties you also adhere to OO best practices.

Ex:
Old:
protected IObservable<IObservedChange<object, object>> _Changed;
New:

[Obsolete("use Changed instead")]
[CLSCompilant(false)]
protected IObservable<IObservedChange<object, object>> _Changed { get {return _changed;} set {_changed = value;} }
protected IObservable<IObservedChange<object, object>> Changed { get {return _changed;} set {_changed = value;} }
private IObservable<IObservedChange<object, object>> _changed;

from reactiveui.

github-actions avatar github-actions commented on April 19, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from reactiveui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.