Should I buy a circular saw or a table saw?

You need a circular saw first. It’s got the most utility because it’s one-hand toss-it-in the car portable and can be used at any angle. It’s not extremely accurate, but with a guide board or one of many guide rails systems it’s pretty close to a table saw, and you’d need a really big table saw to deal with 4’x8’ sheet goods.

Then you need a compound miter saw, preferably a sliding version. Even though it’s not quite as accurate as a table saw it makes quick work of basic cross cuts even with compound angles. For construction purposes you’d rather use that than a table saw.

Once you have the circular saw and the compound miter saw you need a table saw. Small 8" table saws are useless unless you are making small items. Portable worksite 10" table saws are okay, a little on the small side but very economical. Larger table saws are very nice to have. 10" blades are fine, but what you are looking for is a large table.

Don’t assume it’s just a matter of getting 3 saws either, you need a bandsaw, portable bandsaw handheld and benchtop jigsaw/saber saw, reciprocating saw, cutoff saw, brick/tile/stone saw, metal cutting saw, plus all your hand saws.

You just can’t have enough tools. I mean really, you can try to have enough, you can try, but there will always be more.

In general, the circular saw is good for making buildings. It is generally accurate enough, and can handle large stock, and make in-situ cuts where you could never get a table saw. Miters, for example, will be as close as you can follow a pencil line, unless you buy or improvise some sort of jig to cut them more accurately.

In general the table saw is good for making furniture, cabinetry and the like. It will make straighter and smoother cuts than the circular saw and will require far less setup for joints and the like.

Note that those are generalities. There are some building tasks where it is great to have a table saw…making moldings and trim come to mind. And it is really hard to rip sheets of plywood into smaller panels on a table saw, at least not without some accessories that require some setup.

It is possible to make jigs for either that will really help offset the negatives if you need to do a lot of a particular kind of work for which the basic saw is ill-suited. Often home-made jigs work better than commercially available versions, which have to be cheap, light, adjustable, fit in a box, etc.
The miter saw saw will cut precision miters with no setup and cut long things to length with great precision. It pretty much won’t make wide boards into narrow(er) boards at all. A table saw will do this with a bit more setup and care in use.

As for multiple saws: It is seldom possible to make all the needed cuts of one type, then all of the next type etc. So even though a table saw might make all of those cuts fine, there is setup time converting from mitering to ripping to dado-ing, etc. So if you have multiple tools you can save a lot of set-up time and hassle by using one for one type of cut, and leaving the other set up for different cuts.
This goes 10X for a shopsmith.

Hot dog!

And that’s why the first thing I do with a new table saw is build a sled. In fact, I do almost all of my cuts on the sled.

(mine isn’t as pretty as that)

BTW, I haven’t used my saw for anything more than small home improvement work for the past few years, so it was an absolute joy to put it to use the past couple of weeks to build a 7-foot cross out of mahogany to go in our church. I had forgotten how enjoyable it is to work with wood!