6 ms·
I guess I associate having cleaner URLs with REST. It's just funny to me this URL just passes params.
by rortian 16y ago
I guess I associate having cleaner URLs with REST. It's just funny to me this URL just passes params.
- alexandros 16y agoclean uris are orthogonal to REST. They're nice to have, but you could have randomly generated strings of alphanumericals as resource identifiers and still be perfectly RESTful.
- rortian 16y agoYeah I guess that is true. I wish I knew a better term for what I'm getting at.
- jacobolus 16y agoHow do you suggest associating URLs to nodes in a revision control history in a "clean" way? The URL linked in this post doesn’t seem exceptionally unreasonable given the content it points at. It uses a URL query string in a similar way to countless other mainstream web resources. How does that have anything to do with REST? Incidentally, if you want, you can shorten your URL quite a bit (from 182 to 107 characters). As in the use of git from the command line, your hashes only have to be long enough to be unique. So this goes to the same place: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;f=arch/x86/lib/mmx_32.c;h=c9f2d9;hb=e467e1 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6... If you want an even shorter URL (73 characters), you can drop the hb and f arguments, though that provides a bit reduced functionality (just the content): http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;h=c9f2d9 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6... You’re probably right that it could/should intelligently fill in the path, and not require that as an explicit argument. The a=blob argument seems to be unnecessary so could likely be dropped altogether. But eh.
- rortian 16y agoI think github makes a good crack at it http://github.com/rortian/Retinex/blob/53a2f818ce301f4912b02fe0620ce2a0c8136ce5/src/org/pseudopattern/retinex/ByteImage.java http://github.com/rortian/Retinex/blob/53a2f818ce301f4912b02... But, you're right I was wrong to say anything about REST. I just thought it was an interest way to do a git tree explorer. I'm sure it's not desirable to come up with a minimal character URL for this sort of thing, but I hard to see either approach as suboptimal.
- jacobolus 16y agoSo you like slashes between unlabeled arguments instead of key=value pairs separated by semicolons? I don’t see how the slashes have any particular advantage, given that the URLs are much too long to be remembered or easily read aloud, etc., either way.
- rortian 16y agoTotally depends on the context. I see no reason to have a priori preference for either. This way of doing it somehow felt counter to what feels like the trend for a lot of sites. When I'm messing with my own site, I prefer to do key value pairs, so I can easily see what I'm messing with. I do like having some things with a rails/route type url mapping. Tends to allow for much more simplified code.