When comparing Scheme vs C#, the Slant community recommends Scheme for most people. In the question“What are the best languages for learning functional programming?” Scheme is ranked 8th while C# is ranked 25th. The most important reason people chose Scheme is:
Scheme syntax is extremely regular and easy to pick up. A *formal* specification of the syntax fits onto just a few pages; it can be introduced informally in a paragraph or two. Students are not distracted by remembering how to write if statements or loops or even operator precedence because every syntactic follows the same pattern. Ultimately, everything looks something like this: (func a b c) This includes not only user-defined functions but even control flow: (if cond then-clause else-clause) or even primitive operations like `define` and `set`: (define foo 10) (set! foo 11) This means that nothing really has special syntactic treatment in the language. There are essentially no weird edge-cases to memorize, and different concepts are given a more equal weight in the language. (Unlike Algol-like languages which tend to given undue weight to loops and assignment statements, for example.)
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Simple syntax
Scheme syntax is extremely regular and easy to pick up. A formal specification of the syntax fits onto just a few pages; it can be introduced informally in a paragraph or two. Students are not distracted by remembering how to write if statements or loops or even operator precedence because every syntactic follows the same pattern.
Ultimately, everything looks something like this:
(func a b c)
This includes not only user-defined functions but even control flow:
(if cond then-clause else-clause)
or even primitive operations like define
and set
:
(define foo 10)
(set! foo 11)
This means that nothing really has special syntactic treatment in the language. There are essentially no weird edge-cases to memorize, and different concepts are given a more equal weight in the language. (Unlike Algol-like languages which tend to given undue weight to loops and assignment statements, for example.)
Pro No magic - it's clear how everything works
Scheme has far less built into the language itself, helping students see that things like OOP are not magical: they are just patterns for organizing code. Everything in Scheme is built up from a very small set of primitives which compose in a natural and intuitive fashion.
Having a language that does not accord many things special status helps keep students open minded. This will help students later go between different languages and paradigms from procedural to object-oriented to functional.
Pro Great at teaching fundamental programming ideas
Scheme teaches the important, fundamental ideas immediately without the distraction of unnecessary syntax or language features.
Pro Multi platform
GNU/Linux, OS X, and Windows versions available.
Pro Great, well known textbooks
There is a set of very strong textbooks introducing CS and programming using Scheme. These books are available for free online.
The most famous example--and one of the most famous CS books full stop--is Structure and Interpretation of Computer Programs usually known as SICP. This book introduces fundamental ideas in computer science and covers an incredible amount of material quickly and clearly without requiring any prior knowledge.
However, some people find SICP a bit challenging as a first text. Happily, there are other more introductory texts as well. Simply Scheme is a book designed to be read before SICP, easing beginners into the language as well as CS and programming in general. How to Design Programs is another text used in introductory college courses.
Pro Encourages creativity
Pro Robust metaprogramming
The quotation functionality of Lisp allow for extremely powerful, yet syntactically straightforward metaprogramming via macros. This is more powerful than the C preprocessor while being less involved than something like Template Haskell or F# quotations.
Using macros to properly decompose a problem domain teaches new developers good habits, improving composibility and reliability when tackling large programs. Scheme metaprogramming also serves as a gentle introduction to domain specific languages.
Pro Multiparadigm
Unlike most languages, Scheme actually accords both functional programming and imperative programming roughly equal status. Many other languages like Python and Java are staunchly imperative while SML and Haskell are primarily functional; Scheme is a nice middle ground.
Additionally, since Scheme syntax is extremely flexible, it can easily be re-purposed for teaching non-deterministic and logic programming. There is no need to learn a new language like Prolog when the same ideas can easily be expressed with Scheme syntax.
This gives students a good perspective on different ways to think about and organize programs, which makes it much easier to move forward to other languages and technologies.
Pro Versatile
.NET offers rich functionality.
Pro Visual Studio
The Visual Studio IDE offers one of the best development environments. The Community Edition and Visual Studio Code can be used for free.
Pro Forms
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).
Pro Cross-Platform
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.
Cons
Con Little job market
There are little to none jobs searching for a Scheme programmer. The ones that exist are more related to Research in Maths or Artificial Intelligence.
Con A language that is purely academic
If someone said "I am starting a project in Scheme" then they are either talking about their homework or they are starting a joke.
Con Fragmented ecosystem
Scheme is an IEEE standard, not an implementation. Unfortunately, the standard is too minimal and practical implementations have diverged--they had to expand on the standard to get anything done, but did so in incompatible ways.
The later de facto standard R6RS tried to correct this, but lost Scheme's minimalist elegance in the process. The newer R7RS standard takes the best of both worlds with an elegant minimalist core and a practical standard library.
Con Very different semantics from mainstream programming languages
LISP-like languages are very different from mainstream languages (such as C/C++/Java/JavaScript/Python/you-name-it) - both in semantics and syntax. This, in turn, severely limits uses of whatever-learned-with-Scheme, for real-world use.
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 Owned by Microsoft
And like always, Microsoft is to be avoided, no exceptions.