Ask HN: Why Apple put a whitespace on iCloud Path?
Genuine question.
Why on earth an engineer, supposedly good since she/he is working at Apple, would think that putting a whitespace on a working-space path is a good idea ? (+ Now way to change it.)
Reasons to not do that :
- It costs nothing to not do it - No one sees the path ever, no need for it to be "pretty" - It breaks so many things, especially dev-wise - It's not a good practice in general
Reasons to do it :
- I have no idea
For reference the path is : "/Users/<user>/Library/Mobile Documents/com~apple~CloudDocs/" One guess: Sometimes this is done to force other 'consumers' of paths into properly handling file paths with spaces. If they handle this, then they should also handle user created filenames (which will /very often/ contain spaces). Is this the real reason? I have no way to know. If that breaks your code, it better do it fast, and not when your code breaks navigating the files in that directory. The user is in charge of naming them, so no, there’s no guarantee their names lack whitespace characters. White spaces aren't uncommon in Mac system files, e.g. in /Library: Application Support, Contextual Menu Items, Internet Plug-Ins, Keyboard Layouts, Modem Scripts, PDF Services, etc The list of characters not permitted in paths is limited, whereas the numbers of possible characters increases with each addition by the Unicode consortium. No reason that your dev paths shouldn't include emoji for example.