Is there any problem (real and/or code ) using flexible lines (copper/brass or stainless like is normaly used to connect a hot water heater or plastic like used on sink faucets) to connect a new shower faucet to existing iron pipes?

I don't see why the application would be any different than a sink faucet, but i've never seen it done so I may be missing something.