Professional Development – 2023 – Week 27

Image Credit: https://www.flickr.com/photos/54585499@N04/

.NET

The New Request Short Circuiting of .NET 8 (via Nick Chapsas)

  • There are cases (e.g., health check, metrics endpoints) where some endpoints don’t need to go through the middleware pipeline because it allocates resources and takes more time. Look for the .ShortCircuit() method.
  • Other things that bots use — favicon, 404 static HTML, robots.txt — also get routed through middleware, so using the short circuit approach is effective there too. Look for the .MapShortCircuit() method.
  • These configurations go in your Program.cs, not in the controllers (which are inherently middleware).

Why You Might Not Need Interfaces in C# 12 (via Nick Chapsas)

  • We assumed everything might need to be mocked, so everything gets an interface. However, not everything needs to be injected, and static things are okay. Do you really need to mock everything?
  • It’s also rare that you get to keep the contract (interface) and swap out another implementation.
  • Interceptors are extension methods with an InterceptsLocation attribute (which needs the full path to the .cs file, the line number, and the character).
  • I’m failing to see how this is revolutionary compared to regular mocking. You still have to define what the interceptor does. Also the interceptors have to live in the system under test’s assembly, not the test assembly. (The comments on the video point out some other cases where this is a solution looking for a problem.)
  • One potential use case is testing code that can’t be turned into an interface (virtual or static classes).

Management

4 Ways to Earn the Respect of a More Powerful Colleague (via HBR)

  1. Choose to decline certain requests
  2. Connect them to other people in power who value you
  3. Help them surface their blind spots as a way of supporting them
  4. Make them work to earn your attention

Process

DORA Metrics: We’ve Been Using Them Wrong (via SWLW)

This article covers the DevOps Research and Assessment (DORA) metrics popularized by the book Accelerate: deployment frequency, cycle time, change failure rate, mean time to restore. Although useful, these metrics can be misused; the article describes anti-patterns and ways to move forward.

Psychology

The Benefits of Being Bored at Work (via HBR)

  • This article names the types of boredom so one can recognize them.
  • Indifferent — generally relaxed
  • Calibrating — not fully engaged, mind drifting
  • Searching — actively searching for alterative actions to ease the negative experience
  • Reactive — doing repetitive or tedious tasks
  • Apathetic — disinterest, low motivation, emotional detachment from things one typically enjoys

Software Development

JetBrains Rider Gets a ChatGPT-like AI Assistant! (via Nick Chapsas)

  • As of 3 Jul 2023 this is for EAP (early access preview). You have to accept the terms that it will use the code anonymously, so it is sending the code somewhere (although it doesn’t name ChatGPT, Bard, etc.).
  • The context menu gives you… new chat using selection, explain code, suggest refactoring, and find potential problems.
  • You can select code and give it a prompt, for example, “Can you refactor this code to use SOLID principles such as KISS and DRY and YAGNI?”. It emits the code in the chat window, but doesn’t actually modify anything in the IDE. The code produced had some issues understanding static classes and partial classes.
  • It’s not bad, but doesn’t have the complete context to trust it blindly. Perhaps it’s using ChatGPT 3.5?
  • With nudging, you can get it to write unit tests.

Technology

How to Train Generative AI Using Your Company’s Data (via HBR)

This article walks through several areas to consider when using internal content: training from scratch, tuning an existing LLM, prompt-tuning an existing LLM, content curation and governance, quality assurance and evaluation, legal and governance issues, shaping user behavior. Another thing that stood out to me is that the effectiveness of the model is dependent on high-quality input.

Wellness

6 Science-Backed Ways to Improve Your Well-Being at Work (via HBR)

  1. Check in with yourself daily.
  2. Take a few short, quality breaks during the day.
  3. Practice acceptance to focus on what you can control.
  4. Prioritize micro-moments of connection with colleagues.
  5. Practice gratitude to counter your brain’s negativity bias.
  6. Practice active rest outside of work.