Live data from Hacker News

Things you should do now (2011)

secure.phabricator.com

11–20 of 115 posts

Re: Things you should do now (2011)

#11
post #7
post #6

Earlier quoted context omitted.

A better tip would be to use something like time-ordered uuids: You can‘t misuse them for something different and the added bonus is that no one can iterate your db records by just incrementing the url.

My main gripe with UUIDs at the moment is that they look ugly in urls :/

They're not the prettiest sight, yes, but I think anyone who isn't in some way a geek particularly cares about what's actually in URLs.

There's a reason why Apple got away with only showing the hostname of a URL: It doesn't matter to ordinary people. :)

Re: Things you should do now (2011)

#12
post #7
post #6

Earlier quoted context omitted.

A better tip would be to use something like time-ordered uuids: You can‘t misuse them for something different and the added bonus is that no one can iterate your db records by just incrementing the url.

My main gripe with UUIDs at the moment is that they look ugly in urls :/

You can encode it to a shorter string if you use larger alphabet. Still, it's 16 bytes of information, so not as short as sequential IDs.

See for example https://pypi.org/project/shortuuid/

    >>> shortuuid.uuid()
    'vytxeTZskVKR7C7WgdSP3d'

Re: Things you should do now (2011)

#14
post #10

I thought we weren’t supposed to call it “blacklist” or “whitelist” anymore?

Sigh..

What? Did I miss a memo or something? I would have hoped to get an actual answer to my question instead of rhetorical sighs (and downvotes). Note: I am not a native English speaker.

Re: Things you should do now (2011)

#15
post #14

Earlier quoted context omitted.

Sigh..

What? Did I miss a memo or something? I would have hoped to get an actual answer to my question instead of rhetorical sighs (and downvotes). Note: I am not a native English speaker.

This topic is pretty close to flamebait so it gets downvoted would be my guess.

Re: Things you should do now (2011)

#16

That start ids at a gigantic number idea is great, even though I've never encountered a bug caused by not doing it.

I once debugged a case where the id had left sided zero padding so the whole id length was a fixed number of digits, for example `238974` might be represented as `00238974`.

In a process that joined two tables the match counts were off. Somehow, on one side of the join the id was being converted to an integer and then back to a string, which stripped the zero padding. Meaning that `00238974` was failing to match `238974`.

Sigh.

Re: Things you should do now (2011)

#17
post #12
post #7

Earlier quoted context omitted.

My main gripe with UUIDs at the moment is that they look ugly in urls :/

You can encode it to a shorter string if you use larger alphabet. Still, it's 16 bytes of information, so not as short as sequential IDs. See for example https://pypi.org/project/shortuuid/ >>> shortuuid.uuid() 'vytxeTZskVKR7C7WgdSP3d'

Those shorter strings can come with their own caveats. Long-form UUIDs have the nice property of being URL-safe - but IIRC, path pieces in HTTP urls are not meant to be case-sensitive, and browsers have historically tried to "help" by re-casing URLs. For correct semantics, short UUIDs have to go in the request parameters instead.

Re: Things you should do now (2011)

#18
post #15
post #14

Earlier quoted context omitted.

What? Did I miss a memo or something? I would have hoped to get an actual answer to my question instead of rhetorical sighs (and downvotes). Note: I am not a native English speaker.

This topic is pretty close to flamebait so it gets downvoted would be my guess.

Yes, but why? How? I'm a non-native-speaker as well, and these things might be obvious to you, but they aren't to me. Is it a "should not use it", "must not use it", "maybe" or "it's fashionable"? How bad would it be if I accidentially use it, more like a four-letter-word or more like "well, he's a foreigner, he doesn't know"?

Re: Things you should do now (2011)

#19
post #18
post #15

Earlier quoted context omitted.

This topic is pretty close to flamebait so it gets downvoted would be my guess.

Yes, but why? How? I'm a non-native-speaker as well, and these things might be obvious to you, but they aren't to me. Is it a "should not use it", "must not use it", "maybe" or "it's fashionable"? How bad would it be if I accidentially use it, more like a four-letter-word or more like "well, he's a foreigner, he doesn't know"?

Basic Googling: https://en.wikipedia.org/w/index.php?title=Blacklist_(comput...
Post reply on HN