Closed chronark closed 1 year ago
what's the difference here? apart form kebab-kase and snake_case? and upper/lower case which is optional in redis?
@mdumandag
what's the difference here?
The original definition uses EX
, PX
, etc. and we're using seconds
, milliseconds
, etc.
This is intentional. I want to offer our users a good DX and for accomplishing that I've changed some namings to make them easier to understand. The reasons why I don't see this as a blocker are:
ooh, got it
let's use ex
and px
, naming should conform to RESP, and only adapt the casing to what is common in python
Well if you want to conform to RESP you'll have to change quite a few definitions. I designed them with dx in mind, I personally wouldn't find it very intuitive to find pxat
instead of unix_time_milliseconds
in a codebase.
I wonder how we can draw the line for DX. For example, aren't the nx
or xx
parameters we currently have in the set
method also quite counter-intuitive on their own?
I agree that we should simply follow the protocol definitions for the parameter names.
nx
, xx
and ch
are, if I'm not mistaking, the only exceptions I made when it comes to intuitiveness and that's because I couldn't find a better replacement (maybe even more unntuitive).
It's ultimately up to you, but I highly doubt someone will have a problem simply because we named some parameters in a more intuitive way.
Bonus point, compatibility with existing clients was not a requirement at the beginning so users might have to adapt some things anyway. And we don't even know if someone really needs these compatibility guarantees.
Yes compatibility is not a goal as the redis API is just horrible.
Keeping the same naming is best I believe. Not only do experienced devs know what it means but newer people can Google it and don't need to jump through hoops just to understand what something means in our sdk compared to the official docs.
I'm all for making the API nicer, but renaming will cause more confusion than it's worth I believe.
Makes sense. Since we're on this topic, I hope we're keeping some typing changes where they make sense. Like dict for HSET
(as it's in the ts sdk) instead of a plain list and maybe even for GEOADD
and ZADD
.
yes those are good, and greatly improve the dx.
closing in favour of #11