At the grocery store it was a decision I could never make. I leaned toward plastic because I could carry more at once. My home is perpetually overrun with leftover plastic bags. I like the idea of reusable cloth bags, but I can never remember to bring the damned things with me to the store.
In the homebrewing community a similar debate rages between brewers who prefer plastic or glass fermentation vessels. Like so many other things in life there are pros and cons to both. It is a matter of personal preference. My first kit came with a plastic primary fermentation bucket and a glass carboy to use for secondary fermentation, so I have used both from the beginning.
Plastic vessels are lighter and easier to carry around than glass. A plastic bucket will have a built-in handle, and if you do drop it there is no concern about shattering like there is with glass. There are horror stories out there of people being seriously injured by shattered carboys. For some brewers that is reason enough to use plastic only. When using glass carboys a handle like this or this is an essential accessory.
Cleaning is also a consideration. It is easier to reach inside a plastic bucket with your arm than squeeze in a carboy brush and manipulate it into clean the inside of a big glass bottle. Unlike glass, plastic stains and stains permanently. Just like plastic containers used for food, if you use a bucket too many times it will be stained beyond the point of ever being white again. With glass you can almost always rinse any debris with a sink-mounted, bottle washer. If that doesn’t work a good, long soak with a PBW or OxiClean solution will.
When it comes to durability, glass wins in a landslide. In addition to staining, unlike glass, plastic is susceptible to scratching. Microbes that will infect your beer love to hide in even small scratches. At that point the bucket can no longer be used as a fermentation vessel. Taking lids off plastic buckets is a pain in the rear. In my experience I have had lids crack along the lip while being removed and had to replace them.
To state, but not assume the obvious, never pour hot liquid into a room temperature glass vessel of any kind. The rapid change in temperature will make the glass shatter. The only time you would ever want to pour hot wort into glass is if you are bottling wort for yeast starters to save for future use. In that case, be sure to fill the glass bottles with hot water so the glass can heat up. When you add your hot wort the change in temperature will be less drastic.
Unless it shatters, a glass carboy will last a lifetime with proper care, which is why I lean more and more to glass. As long as dried krausen or trub is not allowed to cake on the inside, I don’t find glass carboys that much harder to clean plastic buckets. I made sure to buy handles for all my carboys to alleviate the weight and safety concerns. I still have four seven gallon plastic buckets. As they begin to scratch, stain, or even smell I will start to replace them with 6.5 gallon glass carboys that have adequate head space to use as a primary fermentation vessel for five gallon batches. I would rather spend $40 on something that will last a lifetime, than $12 on buckets with a limited shelf life, and $3 lids that are even less durable.
Another consideration is that plastic is not completely impervious to oxygen. For any type of extended aging, glass is essential.