Basically, don’t buy raw wood if you’re going to paint. Medium-density fiberboard (MDF) is a popular trim option because it’s typically the cheapest. However, it does have its own set of issues.
So don't buy raw wood if you're going to paint ... The MDF will soak up water like a sponge, expand and shed paint in very short order. So avoid using MDF anywhere at risk of getting wet.