You’re checking out some code. It’s been a long time since you looked at this project. Or maybe it’s the first time. You point your editor at an interesting file name and double-click to open it. Your coffee is warm, your mind is clear, and you’re ready to go. And there it is, sticking out like white socks in sandals. A spelling error. How do you handle it? Do you fix it? Do you ignore it? Discuss it with the author? Bring it up during lunch when he’s not around?
Time to cover yet another construct of the C# language. In this series, we’ve already covered the C# list, array, and string, to name a few. Today’s post is a little bit different, though. Its subject isn’t a data structure or type, but instead, a decision structure: the switch statement. Le’s get started!
We here on the SubMain blog love to talk about programming best practices. Sometimes we’ll cover topics that are specific to C# or .NET as a whole. Other times, however, we write about concepts that are universal. Today’s post falls into the latter category. And I’ll start out by making a strong claim: you absolutely should treat warnings as errors when developing in .NET. Well, to be honest, that applies to virtually any platform. The examples in this post, as usual, will be in the C# language. But as we’ve said, the concept applies pretty much everywhere.
Code review is, hands down, one of the most fundamental best practices a software shop can employ to produce better software. A good code review practice can shed light on design problems, improve the readability of the code, and spread knowledge throughout a team. It also helps you find bugs early (when it costs less to fix them). Code reviews sound like a gift from the heavens, right? While far from being a panacea, I’d say they are a spectacular tool to ensure software quality—when done correctly. And that, of course, is the tricky part. It doesn’t take much for…
It’s time for yet another discussion on an important C# construct. We started this journey with the C# array. Then we covered the list and enum. And, finally, the dictionary. Today, we cover yet another fundamental but often misunderstood type in C#: the string.
Here on the SubMain blog, I’ve already covered how to use CodeIt.Right to Create C# Coding Standards. Today Visual Basic gets the same treatment. In case you haven’t read the previous post (or any post in this blog at all), I’ll briefly explain what these posts are about. CodeIt.Right is an automated code review tool. It checks the source code of your application against a set of rules (which can be the standard rules or custom ones), giving you instant feedback on its quality. Similarly to the previous post, I’ll explain how you can create a Visual Basic coding standard by…
So far we’ve had the opportunity to take a deep C# dive on arrays, lists, and the very valuable enum. Today we are going to stay in the System.Collections.Generic namespace and learn about a structure that’s designed for lookups—the C# dictionary.
When I last looked for software engineering jobs, I came across a post that looked perfectly normal until I got to a line that said, “Participate in daily code inspections.” What the heck was a code inspection? It sounded pretty serious. And we’d be doing it every single day? A quick Google search brought me to a Wikipedia page for “software inspection,” which told me that “code inspection” was pioneered in the 70s at IBM. My grandfather’s cousin happened to work there at the time, so I asked him to weigh in. He said they were a “formalized effort by team…
We’ve discussed arrays and lists in C#. This time, we’ll take the same journey with a funky little type called the enum. C# enums are very useful constructs, but they have some quirky behavior that can bite you if you’re not careful. Let’s now see what makes enums tick, how to use them effectively, and what to be careful of when using them.
Not that long ago, we published a post about the fundamentals of the C# array. Today’s post will continue the trend, covering the C# list. Don’t worry: if you’re a beginner, you’ll also benefit from this post. Instead of brushing up, you’ll get your first contact with this incredibly useful data structure. As in the array post, we’ll discuss what a list is. We’ll learn how to use it, what its most common operations are, and how to avoid some common pitfalls. With that in mind, you’re ready to see what the C# list has to offer you.