Use structures to improve the readability of your code

It's very common to use basic types such as string, int, or long to represent your data. However, sometimes there is a semantic behind the type. For instance, a string can be a file path, a full name, or an id. Also, you need to compare them or pretty-print the value. For instance, the length of a file is a long, but you almost never show the raw information. Instead, you format it as MB or GB. Which one… [read more]

Exploring the MSBuild log using the binary log viewer

Following my previous post about ILRepack, some people asked me where the MSBuild property ReferencePathWithRefAssemblies comes from. Is there a documentation, or something to find properties like this one? The documentation of MSBuild is very useful to understand how it works and the key concepts. However, they cannot document all the properties because there are dependents of the kind of project you… [read more]

How to enforce a consistent coding style in your projects

Every company/team has its own coding style. The coding style is about naming, spacing, or language feature usages. Do you use tabs or spaces, and how many spaces? Do you use PascalCase or camelCase? Do you prefix field names with _? Do you always use var or only when the type is visible? And a few more questions in that vein… In an open/inner source project, you want to ensure every contributor uses your… [read more]