Somewhere along the line, it changed from "do you program in your spare time?" to "show us your side projects."
I program in my spare time. I like it. But when interviewers want to pour over my "spare time" code before I get a job, it stops being fun. It becomes more work.
Without the ability to look at code you've written "on the job", side projects are the next best thing. Get a license for code you've written at previous employers and showcase that during the interview.
I'd much rather simply be asked to code (at the interview, or as a "homework" thing before the interview, whenever... just not over the phone, please!) something similar to what they'd want me to do at the job.
My side projects are for fun and playing around with new ideas, and don't really represent the style of code I'd be writing in a professional engagement. Here's an example from in the past: I wanted to crunch some baseball stat numbers using a Matlab library I'd found. So I hacked together some minimal parsing of publicly available game logs in Python, since I wasn't that interested in learning Matlab IO, then dumped them from Python to a format Matlab could read. Iterated that part until it worked for all the files I was interested on (but still in a rather ugly state) then hacked together some analysis in Matlab. DRY, or good design in general? Nah, it was a one-off thing.
You can't please everyone. There are numerous HN posts about how people don't want to spend a lot of time doing coding during an interview. Or are offended that they'd be ask to do a code test as part of an interview. And doing work for hire like this is considerd spec work in other industries, which is often frowned upon too.
My point was that sideproject code is better than no code at all. And it's not so much the quality of the code that's at issue, it's being able to talk intelligently about it. Hopefully you'd want to work with someone who can understand that something that is one-off is going to be lower quality than something you might write professionally, and having code to look at and examine that you wrote, that you're an expert on (because you wrote it), gives context to having discussions around how the code might be improved or why you made the decisions to made for a one-off.
There are numerous HN posts about how people don't want to spend a lot of time doing coding during an interview. Or are offended that they'd be ask to do a code test as part of an interview.
Those people are instant no-hires. You aren't going to write code when I ask you to write it? That is your job!
(I would grant exceptions is very exceptional cases, like the candidate having physically lost his hands. Or being blind.)
And doing work for hire like this is considerd spec work in other industries
Are you talking about the company giving the guy a problem, and then taking his answer and putting it right in their codebase without hiring him?
"Those people are instant no-hires. You aren't going to write code when I ask you to write it? That is your job!"
Well... typically, my 'job' involves people paying me as well. If you want me to 'code when you ask for it', then you need to pay for that. Or... make it easier to judge how I do stuff (like look at my side work).
OP was talking about companies judging the quality of your one-off side project play for-fun code in the same way that they might judge the quality of your professional work code.
It's not necessarily unheard of. People who work at architecture firms routinely having portfolios of stuff they've worked on. If you don't have a portfolio of work from previous employers handy, what is in your portfolio? And if one doesn't have a portfolio of demo code that showcases style and experience and skill, one doesn't really get to complain that someone else doesn't have context to judge appropriateness for a job, or that they are expecting some context to be able to make an informed judgement.
I program in my spare time. I like it. But when interviewers want to pour over my "spare time" code before I get a job, it stops being fun. It becomes more work.