> There has to be a huge number of ‘ifdef lightning’
Why would that be the case? Why would apps need to know what kind of port is used for charging?
Not for usual apps, but iOS for iPhone might need to know. USB is a fairly complex standard to implement correctly and now Apple tries to bring this to billions rather than millions. So the bar is much higher.
The lightning port is not just for charging. It can be used for audio, data and possibly other things.