Although it's equally easy to custom-build them to a particular length, you might want to consider the best use of your lumber. For example, standard 2x4s are eight feet long, so making the shelves ...
If you want to build a hanging bike rack ... so making the shelves six feet by two feet would be economical. Don't rush the design step. Marking outlines on the floor and wall with chalk can ...