Truth is, when I started out, I was a terrible developer and among the worst in my coding bootcamp cohort. None of the programming concepts stuck.
The reason I made it this far, and others in my cohort didn't, was that I didn't quit 🔥
“…plans are useless, but planning is indispensable” - Dwight D. Eisenhower
Planning is better if you want to handle uncertainty, complexity, and change.
And having a plan is still useful, and you really want both, but without continuous planning, the plan becomes obsolete fast
Never return null collections in C#.
Why? Because it forces every caller to handle the null case—even when they just want to iterate.
This leads to:
- Extra null checks
- More verbose code
- Potential runtime errors if checks are missed
Instead, return an empty collection:
- Enumerable.Empty<T>()
- new List<T>()
- Or [] if you're using C# 12
This keeps your code safer and easier to work with — no surprises, no crashes.
I share tips like this every Saturday with 67,000+ .NET engineers.
Join here: https://t.co/fkjATDld4x
What’s your take on returning null vs empty collections?
Tackle the real root cause, not just the symptoms.
This mindset saves time and prevents the same problems from resurfacing repeatedly. It’s what separates quick fixes from true problem-solving.