Settings

Theme

Ask HN: Why Apple put a whitespace on iCloud Path?

1 points by amineazariz 7 years ago · 3 comments · 1 min read


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/"

pwg 7 years ago

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.

Someone 7 years ago

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.

dddddaviddddd 7 years ago

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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection