That means they need to be unique per document (btw, an aspect of layers that Adobe and other artistic software does not have) and must consist only of valid 'name' sequences (limited characters, no spaces, etc).
...

We might want to look into tuning up the lable/id synchronization, but need to be careful about introducing unexpected consequences. (Changing behavior in one direction might make Illustrator happier, but at the expense of breaking script/extension compatibility, etc.)

I recall having a discussion about this somewhere with respect to (the lack of) gradient names. My suggestion was that IDs should be derived from Inkscape names using a well defined algorithm that removes invalid characters or maps them to valid ones (e.g. spaces to underscores). If the resultant ID is not unique in the document then a suffix would be appended to force uniqueness.

For example "My Layer" might get an ID of "my_layer", whilst "My Layer!?!" in the same document would get an ID of "my_layer_1".

The problem, of course, is getting this conversion to work everywhere it's needed, including importing files and copy-pasting fragments. But I do think that derving IDs from names would make life a lot easier for anyone who has to subsequently hand-edit files for whatever reason.

As Jon suggested, this could cause issues with any software which expects Inkscape-generated IDs to be in a particular format (e.g. LinearGradient*) . I'm not convinced this would be much of a problem in practice, but I'm not familiar enough with Inkscape extensions, or other third party tools, to know for certain.

Mark

--
Co-creator of The Greys and Monsters, Inked webcomics

Website      http://www.peppertop.com/
Facebook   http://facebook.com/TheGreysComic
Twitter        https://twitter.com/TheGreysComic