It would nice if you could somehow deprioritize folders so that the files within them don't show up in the top N results in Spotlight, because yeah it's probably not useful for it to present source files from that one sprawling project I forked and tinkered with a couple years ago.
When I’m done with a project, I’ve taken to packing up these kinds of files into a disk image. That way, I can access them if I need to, but they don’t show up in search. There’s a risk that the image gets corrupted or isn’t readable on some future OS, but since these aren’t mission critical files, I’m not too worried about that.