Six and a half years ago, I was working 70+ hour weeks in natural gas for a less than desirable hourly rate. Today, I'm writing C# .NET applications with a much better work-life balance. That transition taught me something most bootcamps don't cover: blue collar work habits translate directly to writing better code.
If You Half-Ass a Gas Line, People Notice. Same With Code.
In natural gas work, there's no hiding sloppy craftsmanship. A bad joint leaks. A rushed connection fails inspection. Your shortcuts become everyone else's problem, and fast.
Writing C# is the same way. That public static void Main() method you threw together at 5 PM on Friday? Your teammates are going to see it Monday morning. That database connection you forgot to dispose? Production will remind you.
Here's what those Long Island job sites taught me about clean code:
Use the Right Tool for the Right Job
You wouldn't use a pipe wrench when you need a tubing cutter. In C#, this means:
- Don't use
ArrayListwhen you needList<T> - Don't use
stringconcatenation in loops when you needStringBuilder - Don't use
Thread.Sleep()when you needawait Task.Delay()
The tools exist for a reason. Use them.
Measure Twice, Cut Once
Before cutting expensive pipe, you double-check your measurements. Before writing code, you should understand the problem you're solving.
I've seen too many developers (myself included) jump straight into coding without thinking through the solution. In C#, this looks like:
- Writing methods that do three different things
- Creating classes with 15 properties when you need 3
- Building elaborate inheritance hierarchies for simple problems
Take five minutes to think through your approach. Your future self will thank you.
Clean Up Your Workspace
A messy truck leads to lost tools and wasted time. Messy code leads to bugs and late nights.
In C#, this means:
- Use meaningful variable names (
customerOrder, notco) - Keep methods focused on one responsibility
- Remove unused
usingstatements - Follow consistent naming conventions
It's not about being fancy. It's about being professional.
Test Your Work Before You Leave
In natural gas, you pressure test every connection before calling it done. In software, you test your code before pushing to production.
This doesn't mean writing perfect unit tests for everything (though that's great if you can). It means:
- Running your code with different inputs
- Checking edge cases
- Making sure it actually solves the problem you set out to solve
The Bottom Line
Good software engineering isn't about knowing every design pattern or using the latest framework. It's about craftsmanship. It's about taking pride in your work and leaving things better than you found them.
That work ethic that got me through 70-hour weeks in natural gas? It's the same work ethic that helps me write maintainable C# code today. The tools changed, but the fundamentals didn't.
At the end of the day, whether you're joining pipes or joining tables, do the work right the first time. Your coworkers, your customers, and your future self are counting on it.