If you can stick with a terminal or some lightweight editors, 8GB might be okay for you, but I feel like 8GB has been pushing it for at least 5 or more years now.
There was a lot of discussion of this at the time the M1s first came out, with loads of people (who had never touched one) confidently declaring that 8GB of RAM was far too little...and then nearly everyone who actually bought an 8GB M1 Mac saying "yeah, it might not handle heavy loads well, but that's what the Pro machines are for—in normal use, it has no problem at all with 8GB."
And then a bunch more people talking in a fair amount of detail (that kind of went over my head) about what Apple did to improve memory management with the M1 so that this would be possible.
So don't assume that 8GB on an Intel Mac is the same as 8GB on an Apple Silicon Mac.
Now, it does sound like you were trying to run a whole bunch of rather heavy stuff on it—y'know, the stuff that one might call "pro", and possibly even buy a "pro" machine for? The kind of thing where if you're buying the absolute bottom of the line, you might be able to expect that it wouldn't work well.
That's nice, but I can buy a much cheaper non-"pro" computer with better specs that can handle a basic workload that involves a browser, IDE and maybe Docker. Like I've run all of that on entry level machines without a problem.
I own a base Macbook Pro 14", 16GB RAM. If anything, it feels like less than 16GB (maybe because the shared video memory or macos bloat) saved by the fast SSD that's inevitably going to fail not too far and turn the laptop into e-waste.
I feel like every single talk point of the early review cycle was a huge exaggeration:
1. battery life just browsing the web is no more than 4/5 hours. Like any other windows laptop.
2. Performance is really nothing special really. Things like maximizing/minimizing a youtube video are choppy and lag for 2/3 seconds.
I mean, it's still the best value in the market for the screen, keyboard, chassis, speakers combo but Apple Silicon is extremely overrated.