Which is better as a switch diode or transistor?

I don't know which kind of switch, diode or transistor could act as. (I've missed that class). All I know is that a transistor is formed by two diodes.
If any of them can act as a switch on a electronic circuit I think that a diode should be simpler to do that. Anyway, only an technical on electronics can give you the correct answer.