Remember there are 2x4s and then there are 2x4s. Sometimes you will encounter super-deep-discount ones, but they are generally either twisted like a propeller, auditioning to become the letter J, or splitting and splintering badly. For some purposes these characteristics are not a problem, but for other purposes (e.g. framing stud walls) they ARE a real problem. Sometimes you can pick and choose, but sometimes (esp. with the super cheapies) you are not allowed to. (If you CAN pick and choose, sight down the end of each board to see how crooked/twisted it is, and look for physical damage like bad splits)
So it is worth considering what your purpose is, and making sure you select wood that is appropriate.
I actually sometimes walk into the lumberyard and say 'hey, I need <some number of> 2x6's but you know what, you may as well give me the messed-up ones that nobody else wants b/c they're all going to get cut into 4' lengths to make gates and sheep-shed sides, so it really doesn't matter what problems they have". OTOH if I am buying wood for framing a the roof of a big shed, it needs to be reasonable quality structurally; and if I am buying wood for building trusses or fencing in my ram, I want the good straight solid no-edge-spikes stuff!
(e.t.a. -- 2x4s of arbitrary shorter-than-8' lengths are actually some of the easiest material to scrounge. Ask at construction sites or houses being remodelled/renovated/built; ask at the lumberyard if they have any bits and bobs; and look for suitable pallets or packing crates that can be disassembled)
Pat