Traps are a thorny subject in D&D. Both literally and figuratively. They can grind the session to a complete halt. This is bad. Especially when most players' perception of traps is more akin to what happens in the opening scene of Raiders of the Lost Ark. Run run, dodge dodge, jump jump. That said I did use a rolling boulder trap against my players. There was a door, but it was locked and they took effort to delay the boulder to avoid being squished.
Art from GIS for "D&D traps" probably from a 4e book based on the art style.