.NET
The Fastest Way to Run Your Tests in .NET (via Nick Chapsas)
- XUnit runs test classes in parallel, but test methods within a class (called a test collection) run sequentially. This is done to prevent state clashing. It creates on test instance for each test you run.
- If the test class inherits from IClassFixture<State> it will be instantiated only once for all tests in the class where you can pass state between tests.
- The Meziantou.Xunit.ParallelTestFramework NuGet package lets you run in parallel. To make some tests in a class run sequentially, use the [DisableParallelization] attribute on the class.
- Note: There’s still a risk of state clashing, so use caution.
“Remove Braces From Your Code Now!” | Code Cop #004 (via Nick Chapsas)
Braces, although technically not required, visually define a scope. This can happen in single-line loops, or for using blocks. Sometimes using braces can make the line count higher, but also increase readability.
Enums in .NET 8 Are FAST, but Mine Are Faster! (via Nick Chapsas)
- There are built in Enum methods such as IsDefined, GetName, GetNames<T>, GetValues<T>, and TryParse<T> but they were slow in .NET 6.
- There is a NuGet package (NetEscapades.EnumGenerators), which does some source generation at compile time.
- The advantage is that if you can’t upgrade your .NET version, you can use this NuGet package to get performance benefits.
Career
How to Grow as an Engineering Manager (via SWLW)
This article describes six archetypes engineering managers can follow to create opportunities: inspirational leader, tough coach, business strategies, tech innovator, master orchestrator, and savvy politician. I’m definitely the master orchestrator type.
Project Management
Managing a Project? Formalize Your Follow-Up Process. (via HBR)
- Most people prioritize tasks where there is accountability.
- Clarify expectations about what’s due and when.
- Use a shared system to track tasks, progress, and due dates. Use meetings depending on the stakes and urgency.
- Build in margin for the reality of missed deadlines
- Talk through the results (like a retrospective).
Stress
How Hard Should I Push Myself? (via SWLW)
This post is a summary of Robert Sapolsky’s book Why Zebras Don’t Get Ulcers. To manage stress, increase your sense of control and predictability, create outlets for frustration, and increase social support.
Time Management
5 Tactics to Combat a Culture of False Urgency at Work (via HBR)
- Recognize the signs
- Pinpoint the source of urgency
- Prioritize ruthlessly
- Employ strategic procrastination
- Vet external requests and buffer your team