Pinned — 28 Oct 2025 #codingStreet-Smart Coding: 30 Ways to Get Better at Coding Without Losing Your Mind
I spent five years in college learning to code.
A stupid dissertation delayed my graduation. But that’s another story.
Most of my five-year program didn’t prepare me for real-world coding. My real coding journey began at my first job, with one Google search: “how to get good at coding.”
I found a lot of conflicting advice:
“Use comments”
“Don’t use comments”
“Do this”
“Don’t do that”
Arrggg!
It took years of trial and error to learn what worked.
I had to survive on-call shifts, talk to stakeholders, and say “no” politely. More importantly, I had to learn that coding takes more than just syntax.
That’s why I wrote Street-Smart Coding— a roadmap of 30 lessons I wish I had when I started. For every dev who’s ever typed “how to get better at coding” into Google or ChatGPT. (Back in my days, I didn’t have ChatGPT… Wait, I sound like a nostalgic grandpa…)
Preview of the first ~12 pages
Inside “Street-Smart Coding”
This isn’t a textbook. It’s a battle-tested guide for your journey from junior/mid-level to senior.
Some lessons are conventional.
Others were learned the hard way.
And a few are weird.
One lesson comes from a TV show. Nope, not Mr. Robot or Silicon Valley. That’s on Chapter #29. It will teach you about problem-solving.
You’ll learn how to:
Google like a pro
Debug without banging your head against a wall
Communicate clearly with non-tech folks
…and 27 more lessons I learned over ten years of mistakes.
One of the tasks was coming up with title ideas. One of the participants had an immigration practice helping people move to Australia. While he waited for the perfect title, I suggested Aussie Job and follow-ups like Aussie Colleges and Aussie Marriages.
I don’t know which title he chose or if he even wrote the book. I just checked Amazon and there’s no Aussie Job. Insert shrugging emoji.
As a fan of 10-idea lists, that exercise was a piece of cake. It was just another daily prompt for ideas.
That workshop pushed me to keep writing my 10 ideas daily.
3.
Don’t wait for a perfect book title, blog post subject, or business idea.
Chasing the “perfect” idea leaves you blocked, waiting for inspiration. Aim for 10 guilt-free bad ideas. Among those you’ll find a decent one that leads you to the right idea.
Put your work out there. Show it. If people like it, they will engage with it and remember it. Otherwise, they won’t.
I’ve published over 600 posts over the years (half of them reposted on Medium and dev.to). Not every single post is a hit. Good ones stand out. People like, comment, and share them. Others go without “fame or glory.”
Then the work is to have more bad ideas, find the least bad, and share them. Rinse and repeat.
Sharif Shameem shared a similar idea. He calls it, Aadil’s Law, named after a friend:
The amount of stupidity you’re willing to tolerate is directly proportional to the quality of ideas you’ll eventually produce
Be willing to look stupid. Write 10 bad ideas every day and let the good ones emerge.
Take public transportation at rush hour. You’ll notice a clear pattern.
More than half the people are heads down, headphones on, scrolling.
If we don’t take care of our health, we’ll be depressed, sleep-deprived, deaf, people with the attention span of a fish.
Taking care of our health is the first step towards reinvention. After commuting, scrolling, junk food, and poor sleep, we lack the energy and drive to be creative and have new ideas. That’s when AI will eat us alive, when we’re too drained to imagine and create.
#3. Last week, another npm package was infected. The interesting part? Someone stole the npm token by injecting a prompt into a GitHub issue (10min). SQL injection isn’t the #1 vulnerability anymore.
Beyond the basics, Brian’s recent videos taught me to aim for a lower heart rate before sleep. Try journaling, taking deep breaths, or meditation. Slow down before going to bed.
In another episode of Adventures with Entity Framework while migrating a legacy app…
Entity Framework Core only populated a child entity on one item in a result. To honor the 20-minute rule, and for my future self, here’s what I found:
TL;DR: You don’t need the WithOne() and HasForeignKey() when configuring the relationship.
#1. Let’s create an optional one-to-one relationship.
Let’s create a Movie and an Award table.
USEMovies;GOCREATETABLEAwards(IdINTPRIMARYKEYIDENTITY(1,1),NameNVARCHAR(100)NOTNULL);CREATETABLEMovies(IdINTPRIMARYKEYIDENTITY(1,1),NameNVARCHAR(100)NOTNULL,AwardIdINTNULL/* <-- Optional. No FK here */);GO
And now, let’s create an award, add two movies, and retrieve them to check their awards.
usingMicrosoft.EntityFrameworkCore;namespaceLookMaWhatEntityFrameworkDoes;[TestClass]publicclassMovieTests{[TestMethod]publicasyncTaskAllAwardsPlease(){conststringconnectionString=$"Server=(localdb)\\MSSQLLocalDB;Database=Movies;Trusted_Connection=True;";varoptions=newDbContextOptionsBuilder<MovieContext>().UseSqlServer(connectionString).LogTo(Console.WriteLine).Options;// 1. Let's create an "Oscar"using(varcontext=newMovieContext(options)){context.Awards.Add(newAward{Name="Oscar"});context.SaveChanges();}// 2. Let's create two movies that have won an "Oscar"using(varcontext=newMovieContext(options)){varoscar=awaitcontext.Awards.FirstOrDefaultAsync();Assert.IsNotNull(oscar);context.Movies.AddRange(newMovie{Name="Forrest Gump",AwardId=oscar.Id},newMovie{Name="Titanic",AwardId=oscar.Id});context.SaveChanges();}// 3. Let's retrieve all movies, expecting to have an Awardusing(varcontext=newMovieContext(options)){varmovies=awaitcontext.Movies// Imagine more filters here .Include(m=>m.Award)// ^^^^^// Yes, I'm including it here.ToListAsync();foreach(varmovieinmovies){Assert.IsNotNull(movie);Assert.IsNotNull(movie.Award);// ^^^^^// Assert.IsNotNull failed.// Play sad trumpet sound.}}}}
Sorry for the foreach inside the Assert. That’s not a good idea. But I’m lazy and I’m taking too long writing this.
Yes, it fails. Play sad trumpet, please. The second movie’s award isn’t populated. Arrggg!
My fault!
#4. Ignore WithOne()
Since I’m setting an unidirectional relationship, one movie/one award/multiple movies, only configuring HasOne() is enough.
Using WithOne() was telling Entity Framework Core that one award could only belong to one movie. And that’s not the case here.
publicclassMovieContext:DbContext{publicMovieContext(DbContextOptions<MovieContext>options):base(options){}protectedoverridevoidOnModelCreating(ModelBuildermodelBuilder){// Remove the entire configuration// Or, modelBuilder.Entity<Movie>().HasOne(m=>m.Award);// ^^^^^// Just this}publicDbSet<Movie>Movies{get;set;}publicDbSet<Award>Awards{get;set;}}
And since I’m following default naming conventions, I could even delete the configuration. Ahh, Cascade sets to null, which is fine here.
Yes, the right answer is to do nothing.
Et voilà!
For debugging and problem-solving tips, read Street-Smart Coding. Those two skills are more relevant now in the era of AI-assisted coding.