#codingguidelines
C# 12 primary constructors reduce boilerplate when capturing dependencies.

Prefer when:
✅ Constructor only captures dependencies/config
✅ No complex initialization
Avoid when:
✅ Validation or non-trivial initialization is needed
#csharp #codingguidelines #classdesign
August 12, 2026 at 5:19 AM
Do not use “the AI wrote it” as an excuse during a code review.
AI is a productivity tool, not a substitute for engineering judgment. At least, not yet...

#codingstandards #csharp #codingguidelines #designpractices #bestpractices #ai
June 29, 2026 at 6:09 AM
When should a C# operation be a method rather than a property?

Use a method if it’s expensive, performs a conversion, returns a different result each call, or causes side effects.

Lazy-loading and internal caching are reasonable exceptions.

#csharp #codingguidelines #codingconventions
September 7, 2026 at 6:32 AM
Properties should be stateless with respect to other properties. Setting DataSource then DataMember should have the same result as the reverse. Sounds trivial, but I've seen plenty of classes where properties were anything but simple.

#csharp #codingguidelines #classdesign #codingconventions
August 31, 2026 at 1:40 PM
Prefer a single-method interface when state matters, the contract is strong (IDisposable, IEquatable), default interface methods help, or more members are likely soon. #codingstandards #csharp #codingguidelines #designpractices #bestpractices
August 10, 2026 at 4:41 PM
...that are used to transfer data over a communication channel, also called Data Transfer Objects, or a class that wraps several parameters of a method. For DTOs, consider using an immutable record type instead of a class to make the intent explicit.

#csharp #codingguidelines #classdesign #
August 4, 2026 at 4:27 PM
💡 Inversion of Control or Dependency Injection frameworks sometimes require exposing a dependency as a public property. If it's only used for dependency injection and nothing else, I wouldn't consider that a violation.

#bestpractices #codingdesign #codingguidelines #csharp
July 29, 2026 at 1:14 PM
...class. A less subtle example is not honoring the behavior expected by the base class.

#bestpractices #codingdesign #codingguidelines #csharp
July 23, 2026 at 1:19 PM
Creating company document for #Sitecore best practices and guidelines, hooray for #codingGuidelines
November 27, 2024 at 8:12 PM
Apple doesn't always follow them, but they do publish great guidelines of what is okay to abbreviate in code: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/APIAbbreviations.html
Documentation Archive
developer.apple.com
December 2, 2024 at 7:10 AM
The original "architects" of the codebase may have had a great vision, but that information often gets lost. As a senior developer, I recognize the desire to keep a codebase consistent and tidy. We use #codingguidelines, automated style checkers, and auto-formatting tools. (cont'd)
November 4, 2024 at 2:47 PM