For questions specific to finding out about the platform operated by the client software. For platform detection based on library usage, use the specific library or framework tag instead.
Programs which comes with platform detection features can be useful for completing independent user interfaces for specific platforms, for example, between mobile and Mac. Some programming language also enables the programmer to write "System check code" which relies on the inconsistencies of operations across platforms even if the code is the same.