Latest Posts
-
-
Sixth Edition MEGA UPDATE
Another update, with a lot of details, on the sixth edition (still quite a ways out).
-
-
Sixth Edition Update
The sixth edition is still in the works, but the anticipated date is still not close.
-
-
WinForms Book Recommendations
I frequently get asked, “What book is like yours that could help me with X. In this post, I’ll answer that question where X is WinForms.”
-
-
Performance of 2D Arrays
Compares the performance of a 2D array styles.
-
-
6th Edition is Coming!
This is an announcement post that the 6th Edition is coming.
-
-
Generic Math Part 4: All Generic Math Interfaces
In the final post about generic math, we’ll look at all of the operator-related interfaces defined in the Base Class Library.
-
-
Generic Math Part 3: Making an Interface with Operators
In this second post about generic math, we’ll begin to search for a solution to our problem by making an interface with an operator in it.
-
-
Generic Math Part 2: Making an Interface with Operators
In this second post about generic math, we’ll begin to search for a solution to our problem by making an interface with an operator in it.
-
-
Generic Math Part 1: The Problem
The first post in a series about generic math, discussing a sample problem.
-
-
UTF-8 Strings in C# 11
A discussion about the new UTF-8 strings in C# 11.
-
-
The Nuances of Bit Shifting
This post talks about why C# now has two right bit shift operators and how they are different from each other.
-
-
Representing Integers in Binary
This post describes how the computing world takes advantage of base-2/binary counting to represent integers.
-
-
Counting in Other Bases
A discussion in how to work in other bases besides the common base-10 decimal system. This serves as a foundation for some interesting conversations around how the integer types store values in binary.
-
-
Characters, Strings, and Encodings
A discussion on character encodings and how C# uses them.
-
-
Namespace ‘Hacks’ in Project Files
Some interesting little tricks for working with namespaces in .csproj files.
-
-
How much math do I need to know to program?
A discussion about how much math you need to know to be successful at programming.
-
-
Handling Bad Inputs Early in the Book
I get a lot of questions in the book about how to handle bad user input. Situations like a user typing in letters when numbers were expected, etc. I’m planning on doing some revising for future editions to address this more directly. This post is my current thinking on how this might be done in the 6th Edition. TL;DR: Early in the book, we don’t have good tools for validating input. It is just fine (and expected) to just handle the “happy path” and not worry too much about bad inputs until you learn more tools throughout the book.
-
-
Parsing Enumerations
The book discusses enumerations in depth, but this post is some supplemental information about converting to and from strings to let a human pick one of the various enumeration options.
-
-
Struct Layout: More Than Words
Elaborates on padding in struct layouts beyond just word sizes.
-
-
Mysterious numbers
For what number is this true?
x == -x
-
-
More On Value And Reference Types
I sometimes hear people say, “Value types get stored on the stack and reference types get stored on the heap.” That’s a common misconception. There’s a bit of reason behind it, but reality is quite a bit more complex than that.
-
-
Struct Layout Basics
Describes how struct data is organized in memory.
-
-
A Range Hack
A little hack to make
foreach (int number in 1..10)
work in C#.
-
-
How to Ask Questions
Covers some guidelines and suggestions to get the most when asking a question in the Discord server. These guidelines also generally apply to asking technical questions anywhere on the web.
-
-
Stepping Into a new Run of an Application
This post discusses how to debug your program but pause execution before the first line even runs.
-
-
Switches and Jump Tables
This post looks at performance around switches in C# when compared to
if
statements.
-
-
Analyzing the Cost of Exception Handling
The book claims that exceptions are slower than normal procedural code, but the question is, how much slower is it?
-
-
Comparing the Performance of
for
vs.foreach
LoopsMany things that can be done with a
for
loop can also be done with aforeach
loop. Which one is faster? Which one should you pick?
-
-
Interfaces vs. Abstract Base Classes
Discusses the times when an interface or an abstract base class is preferred to the other.
-
-
Capitalization Conventions
Talks about how capitalization of identifiers is typically handled in C#.
-
-
What happens if you throw
null
?You can throw an exception, but what happens if you try to throw
null
instead?
-
-
Which version of .NET am I using?
Describes how to determine which version of .NET your project is using.
-
-
5th Edition available in print!
The 5th Edition is now available in print form from Amazon!
-
-
5th Edition available in digital form on Gumroad!
The 5th Edition is now available in print form from Amazon!
-
-
Directory.Delete
A story about a time I nearly destroyed my computer with
Directory.Delete
-
-
Can Structs Have Methods?
A discussion on when it is appropriate for structs to have methods.