The C# Workshop (Packt)

Author: Jason Hales, Almantas Karpavicius and Mateus Viegas
Publisher: Packt
Date: September 2022
Pages: 780
ISBN: 978-1800566491
Print: 1800566492
Kindle: ‎ B0BGRBDJLS
Audience: C# developers
Rating:  4
Reviewer: Mike James
C# is not the language it once was - time for a revival?

C# is indeed undergoing a revival. Once it was commonly used  to create desktop apps for Windows. To do so it had a complete GUI - WPF and a design language XAML. You could use it to prototype desktop apps using a drag-and-drop designer in Visual Studio - it was amazing. How things change.

Now .NET is open source and cross platform. C# is the mainstream language of .NET while VB .NET is dead in the water and F# is mostly for enthusiasts. Today C# is used for all sorts of server and web-based apps that hardly need a GUI and if they do then HTML is the most reasonable choice. It's a different world and even if MAUI promises to give us a cross-platform GUI C# development isn't what it was.

So here we have a big book claiming to "Kickstart your career as a software developer". This suggest it's an introductory book, but its huge! It starts off with how to install .NET and C# and recommends using VS Code. Personally, while I use VS Code for most things, I still prefer the full Visual Studio for C# development. It's much better and if you do need a GUI it has the aforementioned drag-and-drop editor. Despite the book saying Visual Studio is expensive, there is a free community edition.

The first thing to say is that this is a "completist" book in the sense that the ideas aren't introduced in any sort of order designed to make learning easy. You get the kitchen sink even when you are just trying to use the toaster. For example, if you are introducing to a beginner the idea of variable declaration you just do it one way. If you show the beginner more than one way the result is confusion and questions about why are there two ways. In the first chapter we meet how to declare a variable and how to avoid declaring a variable - just to make sure everything is explained and nothing missed. This is the sense in which the book is "completist". It starts from the very simple and basic and works its way up the ladder of complexity, hardly ever failing to mention everything concerned on the way. 

In keeping with "Workshop", this book takes a very practical approach and there's plenty of code. You are expected to do more than read the book. The idea is that, as you work through it, you tackle realistic exercises that simulate the types of problems software developers work on every day. 

The "mini-projects" mentioned include building a random-number guessing game,generating images for the Fibonacci sequence using async/await tasks and developing a temperature unit conversion app that is then deployed to a production server.

Banner

After Chapter 1 has introduced the basics of data types, Chapter 2 gets on with being object-oriented. This is a very basic account of OOP as you would find in any other book on the subject, but customized to C#. This one chapter covers a huge amount of ground including nullability, structs, overloading operators and so on - I would prefer a bit more structure in the presentation. 

From here we move on to consider C#'s interesting approach to the function problem. It doesn't make functions first class objects, but wraps them in a delegate object - a complicated way of avoiding having pure function objects. This philosophy isn't made clear but we do get a technical discussion of delegates and lambdas.

Next we meet data structures and LINQ which is far too early for most. Then async in the form of Tasks which is core C#, but then we move on to Entity Framework which really isn't core as it isn't part of the language.

The remaining chapters deal with applying C# in various ways - ASP.NET, Web API clients and creating API services. These are moden applications of C# - there isn't a mention of XAML for example or anything particularly Windows-specific. If this is your take on C# then everything is fine. I really don't think that ASP.NET belongs here, however. It needs a book to itself.

This is not a beginner's book, but its beginning is targeted at beginners. As its title suggests, it is a book on applications of C# and if any of these are what you want to know about then read on. Personally remove the first thee chapters which are simply out of place and belong in a differently focused book. I also can't help but comment on the terrible layout - very unsympathetic to programs. There are lots of examples of code simply being allowed to wrap round, so making a mess of any indenting and the way that programs are split across pages doesn't make followijng them any easier.

The conclusion is that if you are looking for a book about using C# for anything but desktop apps then you might find this useful, but it isn't a primer on the language. 

  • Mike James is the author of Deep C#: Dive Into Modern C# in which he provides a “deep dive” into various topics that are important or central to the language. By exploring the motivation behind these key concepts, which is so often ignored in the documentation, the intention is to be thought-provoking and to give developers confidence to exploit C#’s wide range of features.

To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.

Banner


Modern Fortran

Author: Milan Curcic
Publisher: Manning
Date: November 2020
Pages: 416
ISBN: 978-1617295287
Print: 1617295280
Audience: Fortran programmers
Rating: 5
Reviewer: Mike James
Not your parents' Fortran?



Beginning Programming All-in-One For Dummies

Author: Wallace Wang
Publisher: For Dummies
Pages: 800
ISBN: 978-1119884408
Print: 1119884403
Kindle: B0B1BLY87B
Audience: Novice programmers
Rating: 3
Reviewer: Kay Ewbank

This is a collection of seven shorter books introducing key aspects of programming, but it fails through trying to cover too [ ... ]


More Reviews

 

Last Updated ( Tuesday, 15 November 2022 )