Shhalahr,

Procrastinator.

Okay, but seriously: “Thief”. Why reimplement it if it’s already available in the language?

snowcatridge10,

Thief

marco,
@marco@beehaw.org avatar

And not feeling one byte bad about it :p

wethegreenpeople,

Engineer I guess… Thief is the objectively better enterprise programmer option but I don’t know why I always forget about it and just write a ternary ¯⁠\⁠⁠(⁠ツ⁠)⁠⁠/⁠¯

mindbleach,

JS instills distrust. Rely on built-in sort? It’s alphanumeric. Rely on built-in reverse? It modifies your array. Copy an array? No you didn’t.

Yeah no kidding we bang out a kata in a dozen characters. I don’t even believe in order of operations at this point. I’ve been routinely betrayed.

writeblankspace,

Thief, or Procrastinator.

Snazz,

Bit hacker 2 is really fascinating. It uses a bit mask of all 1s (-1) or all 0s (0) and takes advantage of the fact that y ^ (x ^ y) = x and y ^ 0 = y

neosheo,
@neosheo@discuss.tchncs.de avatar

Thief no doubt

BautAufWasEuchAufbaut,
@BautAufWasEuchAufbaut@lemmy.blahaj.zone avatar

Thief gang. Why stand on shoulders of giants if you’re not using it to your advantage?

TonyToniToneOfficial,
@TonyToniToneOfficial@lemmy.ml avatar

Last one should be // still a student

xmunk,

Every single entry other than thief is “still a student”

DumbAceDragon,
@DumbAceDragon@sh.itjust.works avatar

Either engineer or bit hacker, depending on whether or not I’m trying to avoid branching.

Moxvallix,
@Moxvallix@sopuli.xyz avatar

I’m number 11.

davel,
@davel@lemmy.ml avatar

Thief. Writing code is for chumps, and the more code you right, the more of a chump you are.

cheerjoy,
@cheerjoy@lemmy.world avatar

why say many word when few do trick

independantiste,
@independantiste@sh.itjust.works avatar

Why 🗣️📈 word when 😃👍

tiredofsametab,

Writing code is for chumps, and the more code you right, the more of a chump you are.

So you're the one in there wronging up my code?

davel,
@davel@lemmy.ml avatar

It’s too late now to wright my wrongh ¯_(ツ)_/¯

Number358,
Eufalconimorph,

<span style="color:#323232;">#define max(x,y) ( { __auto_type __x = (x); __auto_type __y = (y); __x > __y ? __x : __y; })
</span>

GNU C. Also works with Clang. Avoids evaluating the arguments multiple times. The optimizer will convert the branch into a conditional move, if it doesn’t I’d replace the ternary with the “bit hacker 2” version.

Windex007,

I use 8, but only when I’m operating on unsigned longs.

lwhjp,
@lwhjp@lemmy.sdf.org avatar

TDD


<span style="color:#323232;">const max12 = (x, y) => {
</span><span style="color:#323232;">    if (x === 1 &amp;&amp; y === 2) {
</span><span style="color:#323232;">        return 2;
</span><span style="color:#323232;">    } else if (x === 7 &amp;&amp; y === 4) {
</span><span style="color:#323232;">        return 7;
</span><span style="color:#323232;">    } else {
</span><span style="color:#323232;">        return x;
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">};
</span>
cpw,

Max11 is all my code. Why doesn’t it work???🤔

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines