When comparing C# vs Clojure, the Slant community recommends Clojure for most people. In the question“What are the best languages for learning functional programming?” Clojure is ranked 5th while C# is ranked 25th. The most important reason people chose Clojure is:
Clojure programmers are highly encouraged to use immutable data in their code. Therefore, most data will be immutable by default. State change is handled by functions (for transformations) and atoms (an abstraction that encapsulates the idea of some entity having an identity).
Ranked in these QuestionsQuestion Ranking
.NET offers rich functionality.
Can be designed visually with the Visual Studio designer for traditional Windows forms, WPF, or Web forms.
Pro 3rd Party support
Lot's of tools and libraries available.
Pro Can be used in a variety of fields
With Xamarin for Mobile (ios, android),
with .net core asp for server (linux, windows),
with .net core for desktop (windows, mac),
with mono for desktop (windows, linux),
with blazor for web client with webassembly.
However, it is not considered top for any of those categories, but it is top choice for Windows desktop with .net framework and top choice for Unity.
.net 5 will unify frameworks similar to JVM (just one).
Runs on Linux, Mac, and Windows.
Pro Supported By Microsoft
Constant updates and bug fixes to many popular frameworks, as well as great first-party support from Microsoft. This can be a con as well in certain circumstances.
Pro It is a C like language
Being a C like language counts in favor for it as a general purpose programming language, given the ease of using existing skills to pick up this language easily.
There are other superior languages that could be used as a general purpose, such as: F#, Haskell, but the complexity of those languages, being functional, make them strange to the usual C Syntax.
C# is better than C whenever garbage collection, Objects, classes, data access, are needed. But C is going to be the choice when hardware access and performance are paramount.
Pro Immutability is the default
Clojure programmers are highly encouraged to use immutable data in their code. Therefore, most data will be immutable by default.
State change is handled by functions (for transformations) and atoms (an abstraction that encapsulates the idea of some entity having an identity).
Pro Minimal syntax
Being a LISP, programs are simple: they're just functions and data. That it doesn't get bogged down with syntax or the loftier FP concepts like monads makes it one of most approachable functional languages for beginners.
Pro Tries to solve problems as simply as possible
Simplicity is one of the pillars on which Clojure is built. Clojure tries to solve many problems in software development as simply as possible. Instead of building complex interfaces, objects or factories, it uses immutability and simple data structures.
Pro Good for writing concurrent programs
Since Clojure is designed for concurrency, it offers things like Software Transaction Memory, functional programming without side-effects and immutable data structures right out of the box. This means that the development team can focus their energies on developing features instead of concurrency details.
Pro Huge ecosystem of libraries to work with
There's a very large ecosystem of high-quality Clojure libraries which developers can use. One example is Incanter. It's a great data analytics library and a very powerful tool for dealing with matrices, datasets and csv files.
Pro Cross platform
Clojure compiles to JVM bytecode and runs inside the JVM. This means that applications written in Clojure are cross-platform out of the box.
Pro Rich Hickey
The creator is so awesome, he's a feature. Just look up his talks and see why.
Pro Dynamic language
A superb data processing language. While rich type and specification systems are available they are optional.
Clojure has an elegant macro system which enables language additions, Domain-specific languages (DSLs), to be created much easier than most other languages (with the exception of Racket, perhaps).
Pro Great tool used in automating, configuring and managing dependencies available
Leiningen is a very useful tool for Clojure developers. It helps wiht automation, configuration and dependency management. It's basically a must for every Clojure project.
Pro No C/Java syntax
Pro Game is available with which you can learn Clojure
Nightmod is a tool used to make "live-moddable" games. It displays the game's code while you are playing and allows you to inject new code using Clojure. This can be a fun and useful experience for people trying to learn Clojure.
Con Learning curve
For a beginner the .NET framework can be daunting, the rich functionality means that things often can be done in several ways.
Con Very large runtime
Cannot be used for embedded programming.
Con Microsoft will mess up with the Visual studio installation
And all of a sudden you'll need to reinstall the entire thing just because it stopped working.
Microsoft assumes that every workstation is connected to the Internet then it is always pushing updates.
Con .NET is a mess
Troublesome in regards to being Microsoft centric, updates, security, excessively large, cross-platform issues, etc...
Con Windows OS centric
Not very good at being a cross-platform programming language.
Con Strictly object oriented
Con .NET is closed source and owned by Microsoft
And like always, Microsoft is to be avoided, no exceptions.
Con Confusing error messages
Clojure's error messages more often than not are very confusing. They usually involve stack traces that do not thoroughly explain where the error was caused or what caused it.
Con Tied to the JVM and it's limitations.
Some language constructs were obviously created as workarounds for JVM limitations. This makes the language much less elegant than it could have been.
Also, the JVM has a very cumbersome FFI.
Con Syntax can be alien / jarring for those used to other Lisps
Perhaps some may consider this attribute an advantage, but I do not. Clojure does not attempt to maintain significant compatibility with other Lisps. So, if you already know a Lisp or are used to the way Lisp works in general, you'll probably be confused if you take a look at Clojure. See these resources for more details on this subject: