Coder Social home page Coder Social logo

clss's Introduction

CLSS - The C# Language Syntactic Sugar suite

A collection of independent or loosely-coupled packages to enhance the syntax of C# in a minimal way.

Why CLSS?

The C# Language Syntactic Sugar suite was created out of my frustration working with C#. The language and its Class Library have not evolved fast enough to address the inconsistencies, performance traps, unintuitiveness and lacking accommodation of common use-cases despite it is very much inline with the language's tradition to accommodate such use-cases. It still lacks some batteries for a "batteries included" language, even long after the inclusion in the BCL of types that serve a very niche use case such as the Version type that parses version strings in the major.minor[.build[.revision]] syntax and also programmatically implements IComparable<T> and IEquatable<T>.

Even when these concerns are addressed, they only come to the latest versions of the language and Class Library. Working in a bleeding-edge .NET environment is a luxury for many developers.

Our good friends such as language-ext, csharp-extensions and CSharpFunctionalExtensions made great efforts to address such concerns but one issue remains. Like many other language extension packages, their monolithic structure creates a high risk of conflicting with existing extension methods in your own projects once you using their namespaces.

CLSS set out to go in a different direction.

Modular

CLSS suite embraces the Unix philosophy. CLSS tried not to be one monolothic package but rather an umbrella for multiple packages. Each package is laser-focused on providing one functionality and can be installed (mostly) independently of other packages. Only install what you want and what is compatible with your current project, and no more.

More batteries

There are several irregulaties in the .NET Standard Library.

Why is there a GetOrAdd method for ConcurrentDictionary but not for other Dictionary types?

Why is there a ForEach method for List<T> but not for other iteratable collections?

Why does Enum.Parse allow non-Enum value types in its type parameter?

If you ever felt like these irregularities should not have existed to provide better consistency, CLSS suite offers a solution for you. It fills in the gaps left by the Base Class Library. Its XML comments do the best to resemble ones that ship with classes and methods in the BCL. Its implementations try to follow the .NET reference source as closely as possible. CLSS suite is built to make the BCL feel complete, to take the "batteries included" philosophy one step further. To add more batteries, so to speak.

Inkeeping with the intent to feel like a natural part of the language and its Class Library, CLSS will be averse to being revolutionary such as language-ext. CLSS packages may lean toward the syntax of functional programming, but will commit to the familiarity of the C# syntax. No monad or endofunctor here. Just functional programming the way you can still recognize as C#.

Polyfilling

A secondary goal of CLSS suite is to polyfill for older language versions and .NET versions. Some of the features from new .NET versions that CLSS can polyfill are: LINQ MaxBy/MinBy, shared Random instance and array filling.

CLSS packages multi-target .NET Standard 2.0 and - wherever possible - as low as .NET Standard 1.0. Learn how compatible these standards are here.

How to install & use

You can find and install every CLSS packages under the 'CLSS' tag on the NuGet Gallery.

To start using CLSS packages after installing, add this line to the top of your C# source file:

using CLSS;

How to contribute

Package-specific issues should be submitted to their respective repositories. If you have an idea that you think should make it into the shared CLSS namespace, submit an issue to this repository.

What this suite contains

Below is the list of packages contained in the CLSS suite so far:

New in Update 1:
New in Update 2:
New in Update 3:
New in Update 5:
New in Update 6:
New in Update 8:

clss's People

Contributors

tonygiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.