Open in app

Sign In

Write

Sign In

bytedev
bytedev

240 Followers

Home

About

Apr 3

Cyclomatic Complexity & C#/.NET

Cyclomatic complexity is a code metric (integer value 1 or more) used to measure how complex a function/method is. It does not take into account lines of code but instead considers complexity to be the distinct paths through a function. Microsoft defines cyclomatic complexity as measuring the amount of decision…

Dotnet

4 min read

Cyclomatic Complexity & C#/.NET
Cyclomatic Complexity & C#/.NET
Dotnet

4 min read


Mar 6

The God Constant Class

An anti-pattern I have observed in some .NET projects, though it could equally be relevant in any object-oriented environment, is placing all constants for a project (or even a solution) in a single class file (e.g. Constants.cs). There are two major problems with this: 1. Cohesion The constants very often have nothing…

Programming

2 min read

The God Constant Class
The God Constant Class
Programming

2 min read


Feb 22

Treating Warnings as Errors in .NET projects

Compiler warnings can be an indication of potential problems in your code project. For this reason it can be good practice to treat all warnings as errors. Enabling treat warnings as errors can be set in the .NET project file directly. For example: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> …

Dotnet

2 min read

Treating Warnings as Errors in .NET projects
Treating Warnings as Errors in .NET projects
Dotnet

2 min read


Sep 13, 2022

.NET Niggles (2): When to use First or Single

This might seem remediable to more senior .NET developers however I wanted to address a mistake I often see more junior .NET developers make. In .NET the enumerable extension methods First and Single are used to select single elements from a sequence. First: literally as the name implies, takes the…

Csharp

2 min read

.NET Niggles (2): When to use First or Single?
.NET Niggles (2): When to use First or Single?
Csharp

2 min read


Sep 13, 2022

.NET Niggles (1): Overuse of File.Exists

This is a post aimed at the slightly more junior .NET developer audience. Something I’ve seen time and again is the wrongful (over)use of the File.Exists method or more specifically using File.Exists before attempting to read from a file. The overuse of File.Exists Consider the following simple C# code: string path = @"C:\MyFile.txt"; if…

C Sharp Programming

2 min read

.NET Niggles (1): Overuse of File.Exists
.NET Niggles (1): Overuse of File.Exists
C Sharp Programming

2 min read


Aug 1, 2022

Quickly setup StyleCop for new .NET solutions

StyleCop is an open source tool that can be used within .NET projects to define and enforce code style guidelines in an automated manner. If you are completely new to StyleCop then you can read more about it in the submain guide to StyleCop. There are various different ways to…

Programming

3 min read

Quickly setup StyleCop for new .NET solutions
Quickly setup StyleCop for new .NET solutions
Programming

3 min read


Jul 25, 2022

What not to unit test

Writing unit tests is certainly a good software development practice, however there are a number of things we should not actually test when writing unit tests. These include… The framework Do not unit test any frameworks you are using. Unit testing an external framework is the author of the framework’s job, not…

Programming

3 min read

What not to unit test
What not to unit test
Programming

3 min read


Jul 25, 2022

What’s a software developer’s job?

The purpose of a software developer’s job is primarily to write code that: Works. Obviously not only compiles but does something functional. Your client wants the system to do “X” then your code should do “X”. Communicates with other developers. Code should be readable, easy to understand and by virtue…

Programming

2 min read

What’s a software developer’s job?
What’s a software developer’s job?
Programming

2 min read


Jun 20, 2022

Code comment anti-patterns

The following describes some of the various different types of bad code comments and anti-patterns as well as what we can do to improve them. Rotting comments Rotting comments are ones that have become out of date and are misleading. They make no sense and bear no relation to the code they…

Programming

5 min read

Code comment anti-patterns
Code comment anti-patterns
Programming

5 min read


Apr 12, 2022

ISO data code standards useful to software developers

The ISO defines standards that are internationally agreed by experts. However, for the scope of this article we will only examine different ISO defined standards for classes of data codes (country codes, currency codes, etc.) that can often come up when working as a software developer. The sections below define…

Iso

4 min read

ISO data code standards useful to software developers
ISO data code standards useful to software developers
Iso

4 min read

bytedev

bytedev

240 Followers

Senior Software Developer

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech