Remix.run Logo
fozdenn 2 days ago

doesn't this point to a bigger problem that there are two ways of doing the same thing?

nikolayasdf123 2 days ago | parent | next [-]

no. it is different thing. container-agnostic zero value vs struct init.

unsnap_biceps 2 days ago | parent | prev [-]

multiple ways of doing something isn't inherently bad.

For example, if you want to set a variable to the number of seconds in seven hours, you could just set the variable to 25200, or you could set it to 60 * 60 * 7. The expanded version might be clearer in the code context, but in the end they do exactly the same thing.

pests 2 days ago | parent | next [-]

Your math equation turned the asterisks into italics.

unsnap_biceps 2 days ago | parent [-]

Whoops, fixed. Thanks for the note

nikolayasdf123 2 days ago | parent | prev [-]

hold on, why would you have 7 hours?

dont you mean a week? 60 x 60 x 24 x 7 ?

or at lest 8 hours?

7 hours is just odd

unsnap_biceps 21 hours ago | parent [-]

The goal was to pick an arbitrary number that wasn't well known. There was no intention behind the specific value chosen.