Jef1:
All you have to do is understand that carpet installers use a "wall trimmer" to cut the carpet to the shape of the room. That's cuz the carpet trimmer can be adjusted to cut the carpet BEFORE, FLUSH WITH or even PAST the wall. If you cut the carpet before the wall, then the gameplan is to then stretch the carpet to the wall with a power stretcher (or knee kicker if you're not doing this kinda work for a living) to secure it onto the tackless strips. If you're gluing down the carpet, you want to cut it flush with the wall because it's not going to be stretched and you want the carpet to fit up to the wall, no further, no less. And, some installers prefer to tuck the cut edge of the carpet between the tackstrip and the wall so that they don't have to reinstall shoe moldings, so then you want to cut the carpet a bit past the wall so that you can tuck the cut edge of the carpet down into what's called the "gulley" (which is the slot between the tackless strips and the wall).
But, notice that the carpet trimmer has a shoe (which is closest to you in the photo) than slides along the wall. As you slide the carpet trimmer along the wall, those two razor blades (held in place by those two triangular nuts) cut through the carpet. The plate those razor blades sit in can be raised or lowered to cut the carpet shorter or longer. (The carpet goes under the body of the wall trimmer and folds up between the shoe and the body of the wall trimmer so it's cut by one of the two razor blades.)
You can install the baseboards first or after the carpet is installed. All that's really important is that you have a flat surface for the shoe of the carpet trimmer to slide on. If your baseboard has a contour on it's front so that there is no flat surface on that baseboard for the carpet trimmer to slide along, then the carpet trimmer may slide up higher on the baseboard, with the result that it cuts the carpet longer, and that can cause problems for the installer (who then has to recut it).
So, you can install the carpet either way, as long as you have a flat surface at the bottom of the wall to slide the carpet trimmer along. So, the answer to your question largely depends on what kind of baseboard you'll be installing. If it has a flat surface for the carpet trimmer to slide along, then you can install it first and either tuck the cut edge of the carpet into the gulley or install a shoe molding to cover the cut edge of the carpet. If your baseboard has a contoured front so that there's no flat surface on it, then (in my humble opinion) you'd be better off to install the carpet first, and then install the baseboard. This would typically be done by dropping a piece of sheet metal down in front of the wall (so the wall trimmer shoe doesn't go under the drywall), slide the wall trimmer on the flat sheet metal to cut the carpet flush with or before the wall, then stretch the carpet (or whatever) to install it, and THEN install your baseboard AFTER the carpet is installed.
PS: Notice the handle on the carpet trimmer is secured with a triangular nut. Notice how the opposite end of the handle connects to the body of the wall trimmer with a toothed joint (like a bicycle rack for a car). If that nut is loosened, then the angle of the handle can be changed. This is because when using the wall trimmer, you want to push down on it at a 45 degree angle (to keep it down in the corner where the wall meets the floor). But, also notice the handle itself is shaped like this: /\
Thats because not only do you want to be pushing down at a 45 degree angle to keep the wall trimmer in the corner between wall and floor, you also want to be pushing forward on it at the same time at about a 45 degree angle to make it slide along the baseboard and thereby cut the carpet. It's that pressing down at both 45 degree angles simultaneously that folds the carpet tightly into the corner and movest the trimer forward to cuts the carpet to a precise and uniform length relative to the wall. Without a flat edge for the carpet trimmer shoe to slide against, then it can't trim the carpet to a precise and uniform length, which is what you want for the installer to do a good job.
Here's a wall trimmer made by a different company, but with it's handle moved to vertical just for the picture. It wouldn't normally be used in the vertical position. Despite being made by a different company, it's essentially the same design.