.NET exception advice:
Q: What should I throw?
A: System.Exception
Q: What should I catch?
A: System.Exception
The .NET exception model is a Pokémon based system. Gotta catch them all.
Levels of software ownership:
1. Actively developed
2. Maintained
3. Servicing only
4. Last one who touched it owns it
5. Last one who looked at it owns it
6. Pray nothing needs fixing
Today marks 17 years at Microsoft. In that time:
- 12 different bosses
- ~11 different offices
- 4 different product groups
- Countless friends made along the way
C# compiler now a pure .NET Core application inside the .NET SDK. Before our DLLs, where all compiler logic lives, were netstandard2.0 with a tiny netcoreapp3.1 exe on top. Now it's netcoreapp3.1 through and through.
Developer fallacy: we're going to rewrite this established product from scratch and fix all the bugs in the current implementation. It will be awesome!
Think developers should embrace `is object` as the canonical non-null test in C#. It works in every version, won't compile when the expression type is a struct, logical opposite of `is null`, emits efficient IL, ... the only fault you can say is the name isn't obvious.
The most under appreciated part of Visual Studio over the last three major releases is the Installer. I comfortably run and manage 3-5 versions of Visual Studio with different configurations on most of my boxes. Upgrades, installs and uninstalls are so smooth.
Removed some truly ancient code from roslyn today (code targeting .NET Framework 2.0). The change had no push back, every test passed, test insertions into VS passed ... green all across the board.
I could not be more terrified.
Career advice for younger developers: make sure always spend part of your time becoming a better writer. Code is only going to take you so far. At some point you need to be able to effectively communicate your ideas with other people.
Just hit my 20 year anniversary at Microsoft. It's pretty daunting to look back at all the products and features I've worked on over the years and where they are now. The good news though is I'm still having fun ;)
Me as a junior dev: why don't people trust me more and believe in my designs?
Me as a senior dev: why on earth do these people trust me and my designs? Haven't they seen the mistakes I've made before?
Every thing you teach your kids will come back to haunt you. Recently got an egg timer so my toddler can visualize what "5 more minutes" looks like. Today I said "5 more min and I'll be done". He said okay, walked over to the egg timer, set it for 5 minutes and said "only 5 min"
Wanted to share the steps I use when attempting to establish a coding style in a software project. Seen a number of people struggle with this over the years and wanted to share a strategy I've had some success with.
Interested in working on Go tools and developer experience? DevDiv is starting a team to help support the use of Go across Microsoft. Come help increase the success of Go across the company!
#golang
Absolutely terrible advice. The proper advice here is stop adding comments about "what" but keep adding comments about "why". Code tells you what it does, the comments tell you why that was necessary
I think developers often lose sight of the fact that the C# type system is not the .NET type system. Instead the C# type system is merely a layer on top of the .NET type system providing both additional capabilities and additional restrictions.
Good: After an hour of debugging finally figured out my tests weren't hanging instead the virus checker was blocking them from running.
Bad: Found this out during a meeting when I was unmuted and chose to tell the virus checker how I felt about the wasted time.
C# pattern matching making for some really nice changes in the compiler
if (member is IMethodSymbol
{
DeclaredAccessibility: Accessibility.Public,
IsStatic: false,
Parameters: { Length: 0 },
Arity: 0
} method)
Got a core dump for a .NET 5 process running on Linux today. Opened it in Visual Studio, attached the debugger and it just worked. Zero friction. Basically magic.
Don’t understand why so many of my coworkers have an uncountable number of tabs open in the browser. How do you find anything useful with that setup? After 10 tabs I just get annoyed and start closing things.
When C# local function shipped pretty much immediately got a bug report where a user had a 10,000 line program with only a Main method and ~50 local functions inside it. At the time I thought "okay ... but why???". Now though I must confess: I am that user.
The more I WFH the more I think I need two keyboards:
1. Mechanical keyboard for coding and email
2. Quiet keyboard for stealth typing in Teams meetings
Me: tall strawberry refresher
Starbucks: with or without lemonade
Me: ... i'm just gonna be honest, my wife did not prepare me to answer that question.
When’s the last time you emailed a junior coworker and told them: hey that was really well written email, nice PR for a weird bug, great issue write up, etc ...?
I got a few of these when I was a junior dev. Meant the world to me and my confidence.
This PR is essentially a farewell to Jenkins. It's been our CI system since we originally went OSS on GitHub. This PR though completes the transition of dotnet/roslyn to
@AzureDevOps
.
Now that C# supports module initializers, the ability to run code when your library is loaded, how do you plan on abusing them ... I mean using them in your apps?
In dotnet/runtime a test runs on average 50 times in CI. There about 100 CI / PR builds a day. That means a given test runs on about 25,000 times in a work week. At that scale a test passing 99.99% of the time isn't good enough
We're very nearly at the finish line now for C# 9 and earlier this week I was asked essentially: what has surprised you the most with C# 9 so far in terms of how customers have received it?
This is why I start all my C# programs with ManyFiles.cs. That way even though I put all my code in one file I can confidently tell people "All my code is not in a SingleFile, it's in ManyFiles"
@bradwilson
@maoni0
@jonskeet
When
@jonskeet
sends a "found a bug" email then it's a bug. When he sends a "can you help me understand why this is happening" email then it's a panic attack.
Question: Do u love or hate COM?
Answer when thinking about COM: it's a really elegant spec that is so complete and well thought out.
Answer when working on a COM bug: this is the devil incarnate
Deleting this ancient type of code must break something. Everything about my experience as a dev tells me this is true.
So now I've broken something and I have no idea what it is.
@kateward
Microsoft is a company you can have multiple different careers at. It's a big company, if you feel stale in one area there are lots of opportunities to shift to another very different area but still maintain all the social connections you had before.
This is one of the best end to end auth tutorials for and GitHub that I've gone through. Highly recommend if you're doing a first time auth project.
@buhakmeh
Initial proposal for allowing ref fields in C# is available for review. This also covers structs returning ref to their fields as well as safe fixed sized buffers
New first. Texting my wife’s coworker to get her to send my wife a teams message to come unlock the back door so I can get back into the house. Why not text my wife? Cause she left her phone outside next to me.
The dotnet/roslyn repository now has nullability checks on by default. Just merged the PR that flipped the default for us and simultaneously changed ~10,000 files to keep the current semantics the same.
Just spent an embarrassingly long amount of time searching for the VS 2022 installation on my hard drive before I realized I was searching in "Program Files (x86)" and not "Program Files". Going to take my brain a few years to adjust to this new world :)
It's common for members of the C# compiler team, even those with 10+ years experience, to learn new things about the language. It's a bit rarer when the new thing surprises the entire team room.
Time to sit down and finish my proposal for init only fields and properties for tomorrow's C# LDM. This should make it easier to declare and consume immutable data in C#.
Today as I return from parental leave I'm reflecting on just how awesome this benefit is at
@microsoft
. For the last eight weeks I've been at home bonding with my daughter, watching her grow, eat and become aware of her world.