C# (pronounced “See Sharp”) is a multi-purpose computer programming language suitable for a wide variety of development needs.
C# combines the power and flexibility of C++ with the simplicity of Visual Basic. It encompasses strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines with support for the concepts of encapsulation, inheritance, and polymorphism. It incorporates many elements of the expression and statement syntax of C, and has a more refined object-oriented programming syntax than C++.
C# is one of the more popular programming languages, but is not as widely used as say C, Java, C++ or PHP.
1. C# Programming Yellow Book by Rob Miles
The C# Book is a book that teaches you how to program using C#.
It’s the basis of the first year programming course at the Department of Computer Science in the University of Hull.
This is the 2016 version of the book, the “Cheese” edition. The book can be read at no cost. Kindle and printed versions are available to purchase.
- Computers and Programs – find out what a computer is and get an understanding of the way that a computer program tells the computer what to do. Discover what you should do when starting to write a program. The chapter finishes with a look at programming in general and the C# language in particular.
- Simple Data Processing – create a genuinely useful program. Start by creating a very simple solution and investigate the C# statements that perform basic data processing. The author then uses additional features of the C# language to improve the quality of the solution.
- Creating Programs – build on our programming abilities to make programs that are broken down into manageable chunks and find out how a program can store and manipulate large amounts of data using arrays.
- Creating Solutions – a case study which will allow you to see the features of C# in a strong context.
- Advanced Programming – looks at the ArrayList class, the List class, the Dictionary class, storing business objects, saving an account, loading an account, multiple accounts, handling different kinds of accounts, business objects and editing, threads and threading, structured error handling, program organization, a graphical user interface including the XAML markup language, extensible markup languages, XML schema, and debugging.
- Glossary of Terms.
The author’s website indicates the book is released under an open-source license.
2. Dissecting a C# Application: Inside SharpDevelop by Christian Holm, Mike Krüger, Bernhard Spuida
Learn advanced .NET programming techniques by getting an insiders’ look at a complete application.
The developers who created SharpDevelop give you an inside track on application development with a guided tour of the source code for SharpDevelop. They will show you the most important code features and explain how you can use these techniques in your own projects. You will gain valuable experience of building an application on this scale, learning from the decisions, mistakes, problems and solutions that lead to the current version on SharpDevelop.
The SharpDevelop team will show you how to:
- Build a highly modular application.
- Provide a flexible, extendable, customizable user interface.
- Manage the efforts of translators for efficient internationalization.
- Represent and manipulate text efficiently.
- Code search and replace functionality.
- Construct reusable controls.
- Implement a parser to provide syntax highlighting and auto-completion as users type.
- Use reflection to access information about .NET classes.
- Create a Windows Forms designer.
- Generate code programmatically.
3. Fundamentals of Computer Programming with C# by Svetlin Nakov, Veselin Kolev & Co
This book is designed for beginners. It teaches the reader to think like a programmer and the C# language is just a tool that can be replaced by any other modern programming languages, such as Java, C++, PHP or Python. This is a book on programming, not a book on C#.
The book was originally written in the Bulgarian language by a large team of volunteer software engineers and subsequently translated into English.
The book is distributed freely. Download it here.
4. .NET Book Zero by Charles Petzold
.NET Book Zero – What the C or C++ Programmer Needs to Know About C# and the .NET Framework is a book that provides an introduction to C# and the Microsoft .NET Framework for programmers who have experience with C or C++.
- Why .NET?
- Runtimes and SDKs.
- Edit, Compile, Run, Disassemble – discusses the structure and contents of simple example programs.
- Strings and the Console – a string is an object of type String whose value is text.
- Primitive Data Types – takes a more methodical approach to data types of string, char, int, double and the other primitive data types supported by C# and the CLR.
- Operators and Expressions – operator precedence and associativity, primary operators, unary operators, multiplicative and arithmetic operators, shift operators, relational operators, equality operators, logical operators and conditional operators, and assignment operators.
- Selection and Iteration – discusses statements built around the if, else, switch, case, default, do, while, for, foreach, in, break, continue, and goto keywords.
- The Stack and the Heap – keep memory management and garbage collection in mind in order to optimize the performance of applications.
- Arrays – ordered collections of objects of the same type.
- Methods and Fields.
- Exception Handling – examines C# support for structured exception handling.
- Classes, Structures, and Objects.
- Instance Methods – when a method declaration does not include a static modifier, the method is said to be an instance method.
- Constructors – enable the programmer to set default values, limit instantiation, and write code that is flexible and easy to read.
- Concepts of Equality – explore in more depth the differences between classes (reference types) and structures (value types).
- Fields and Properties – classes and structures have several types of members, most notably fields, methods, constructors, and properties.
- Inheritance – one of the primary features of object-oriented programming. Inheritance provides a structured way to reuse code that has already been written, but inheritance also provides a way to alter or enhance the code in ways that make it more useful or convenient.
- Operator Overloading – permits user-defined operator implementations to be specified for operations where one or both of the operands are of a user-defined class or struct type.
- Interfaces – an interface contains definitions for a group of related functionalities that a class or a struct can implement.
- Interoperability – enables you to preserve and take advantage of existing investments in unmanaged code.
- Dates and Times – a particular moment in time is represented by an object of type DateTime, a structure defined in the System namespace.
- Events and Delegates.
- Files and Streams.
- String Theory.
- Generics – a new feature in version 2.0 of the C# language and the common language runtime (CLR). Generics introduce to the .NET Framework the concept of type parameters, which make it possible to design classes and methods that defer the specification of one or more types until the class or method is declared and instantiated by client code.
- Nullable Types – instances of the System.Nullable struct.
This book is freely distributable.
5. C# Programming by Wikibooks.org
This book provides a through treatment of the C# language.
It covers the language basics, classes, advanced concepts, the .NET framework, and keywords.
Along the way, it introduces C# language fundamentals and covers a variety of the base class libraries (BCL) provided by the Microsoft .NET Framework.
The book is published under the Creative Commons Attribution-ShareAlike 3.0 Unported license.
All books in this series:
|Free Programming Books|
|Java||General-purpose, concurrent, class-based, object-oriented, high-level language|
|C||General-purpose, procedural, portable, high-level language|
|Python||General-purpose, structured, powerful language|
|C++||General-purpose, portable, free-form, multi-paradigm language|
|C#||Combines the power and flexibility of C++ with the simplicity of Visual Basic|
|PHP||PHP has been at the helm of the web for many years|
|HTML||HyperText Markup Language|
|SQL||Access and manipulate data held in a relational database management system|
|Ruby||General purpose, scripting, structured, flexible, fully object-oriented language|
|Assembly||As close to writing machine code without writing in pure hexadecimal|
|Swift||Powerful and intuitive general-purpose programming language|
|Groovy||Powerful, optionally typed and dynamic language|
|Go||Compiled, statically typed programming language|
|Pascal||Imperative and procedural language designed in the late 1960s|
|Perl||High-level, general-purpose, interpreted, scripting, dynamic language|
|R||De facto standard among statisticians and data analysts|
|COBOL||Common Business-Oriented Language|
|Scala||Modern, object-functional, multi-paradigm, Java-based language|
|Fortran||The first high-level language, using the first compiler|
|Scratch||Visual programming language designed for 8-16 year-old children|
|Lua||Designed as an embeddable scripting language|
|Logo||Dialect of Lisp that features interactivity, modularity, extensibility|
|Rust||Ideal for systems, embedded, and other performance critical code|
|Lisp||Unique features - excellent to study programming constructs|
|Ada||ALGOL-like programming language, extended from Pascal and other languages|
|Haskell||Standardized, general-purpose, polymorphically, statically typed language|
|Scheme||A general-purpose, functional language descended from Lisp and Algol|
|Prolog||A general purpose, declarative, logic programming language|
|Forth||Imperative stack-based programming language|
|Clojure||Dialect of the Lisp programming language|
|Julia||High-level, high-performance language for technical computing|
|Awk||Versatile language designed for pattern scanning and processing language|
|BASIC||Beginner’s All-purpose Symbolic Instruction Code|
|Erlang||General-purpose, concurrent, declarative, functional language|
|VimL||Powerful scripting language of the Vim editor|
|OCaml||The main implementation of the Caml language|
|ECMAScript||Best known as the language embedded in web browsers|
|Bash||Shell and command language; popular both as a shell and a scripting language|
|LaTeX||Professional document preparation system and document markup language|
|TeX||Markup and programming language - create professional quality typeset text|
|Arduino||Inexpensive, flexible, open source microcontroller platform|
|Elixir||Relatively new functional language running on the Erlang virtual machine|
|F#||Uses functional, imperative, and object-oriented programming methods|
|Tcl||Dynamic language based on concepts of Lisp, C, and Unix shells|
|Factor||Dynamic stack-based programming language|
|Eiffel||Object-oriented language designed by Bertrand Meyer|
|Agda||Dependently typed functional language based on intuitionistic Type Theory|
|Icon||Wide variety of features for processing and presenting symbolic data|
|XML||Rules for defining semantic tags describing structure ad meaning|
|Vala||Object-oriented language, syntactically similar to C#|
|Standard ML||General-purpose functional language characterized as "Lisp with types"|
|D||General-purpose systems programming language with a C-like syntax|
|Dart||Client-optimized language for fast apps on multiple platforms|
|Markdown||Plain text formatting syntax designed to be easy-to-read and easy-to-write|
|Kotlin||More modern version of Java|
|Objective-C||Object-oriented language that adds Smalltalk-style messaging to C|