Indeed, all you can do is learn and memorise what they represent. But a square filled with a solid color can do the same ("yellow is the hard disk thingy"), and that would actually be more glanceable and quicker to distinguish.
If your icon loses to a yellow cube, it is not a good icon.