Matt Segal Dev

Programming blog posts

How to highlight unused Python variables in VS Code

I make a lot of stupid mistakes when I'm working on Python code. I tend to:

  • make typos in variable names
  • accidently delete a variable that's used somewhere else
  • leave unused variables lying around when they should be deleted

It's easy to accidentally create code like in the image below …

There's no one right way to test your code

Today I read a Reddit thread where a beginner was stumbling over themself, apologizing for writing tests the "wrong way":

I'm now writing some unit tests ... I know that the correct way would be to write tests first and then the code, but unfortunately it had to be done this …

How to polish your GitHub projects when you're looking for a job

When you're going for your first programming job, you don't have any work experience or references to show that you can write code. You might not even have a relevant degree (I didn't). What you can do is write some code and throw it up on GitHub to demonstrate to …

Studying programming: where to start

You have zero programming knowledge and you want to start learning to code. Where do you start?

Maybe you want to learn enough to get yourself a coding job, or you're planning to study computer science in the future and you want to try it out before you start your …

Studying programming: pace yourself

You can learn programming all by yourself and get a coding job. Just you, your laptop and the internet. It's great! You don't have to pay thousands of dollars for a degree and you can work at your own pace.

There's a problem with this approach though: with no teacher …

Studying programming: tools or theory?

When you're studying web development you have a lot to learn and limited time. One of the hard choices that you'll need to make is whether you learn tools or concepts. Should you study data structures and algorithms to be a web developer? It seems kind of esoteric. Do you …

Studying programming: what to learn next?

A lot of people trying to teach themselves programming have an anxiety about what they should be learning. There is an endless array of options - you've seen these ridiculous lists of online courses, right? There's too much to learn and not enough time! You don't want to waste time learning …

Keeping your config files valid with Python

It's common to use a config file for your Python projects: some sort of JSON or YAML document that defines how you program behaves. Something like this:

# my-config.yaml
num_iters: 30
population_size: 20000
cycle_type: "long"
use_gpu: true
plots: [population, infections, cost]

Storing config in a file is nice because it …

8 helpful tools for programming on Windows

Software development on Windows can be a pain. Not because of any issues with C#, .NET or the operating system, but simply because the tools surrounding your work can be quite clunky by default. I'm talking about the lack of a package manager, PowerShell's ugly blue terminal with no tabs …

Run your Python unit tests via GitHub actions

You've written some unit tests for your Python app. Good for you! There are dozens of us, dozens! You don't always remember to run your tests, or worse, your colleagues don't always remember to run them.

Wouldn't it be nice to automatically run unit tests on every commit to GitHub …

Page 1 / 2