• 0 Posts
  • 13 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle






  • kionay@lemmy.worldtomemes@lemmy.worldAmiright?
    link
    fedilink
    English
    arrow-up
    9
    ·
    8 months ago

    ECMAScript spec says Math.random must be less than 1. I was about to stop there, but a thought occurred to me: could the multiply with a float make a number large enough to floor to a different value for large enough values? 🤔

    I imagine it’d have to be a ridiculously large number to amount enough floating point imprecision to matter, if so.





  • If we stop spam accounts from brand new or low usage servers those could both be easily mailed (emulated activity, pre-create instances and let them marinate)

    I don’t know much about how making new instances works, but could someone create instances in large qualities with smaller populations with the goal of giving human moderators too much work to defederate them all?


  • kionay@lemmy.worldtoProgrammer Humor@lemmy.mlwhy not a,b or x,y?
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    1 year ago

    I prefer index variable names that are two words. The second word is always ‘index’ and the first word describes the enumerable objects. carIndex, productIndex, thingIndex

    I’m not paid by the character count. Longer and more descriptive is better. Long lines that go past your 1080p monitor are probably not long because of variable names but because you insist on doing many things in one line (quit doin’ that). For small functions this isn’t necessary, but too often I’m shunted to the middle of a big function with two or three indecies doing acrobatics over one another and while working on it I have to constantly remind myself that this i and j mean particular things.