Find yourself
![](https://kbin.cafe/media/cache/resolve/entry_thumb/26/34/2634b8e826300c21599e79cbeb7708c5acbc13732f329489ccc791fe364a8299.png)
Shhalahr, Procrastinator.
Okay, but seriously: “Thief”. Why reimplement it if it’s already available in the language?
snowcatridge10, Thief
marco, ![]()
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, ![]()
Thief no doubt
BautAufWasEuchAufbaut, ![]()
Thief gang. Why stand on shoulders of giants if you’re not using it to your advantage?
TonyToniToneOfficial, ![]()
Last one should be // still a student
xmunk, Every single entry other than thief is “still a student”
DumbAceDragon, ![]()
Either engineer or bit hacker, depending on whether or not I’m trying to avoid branching.
Moxvallix, ![]()
I’m number 11.
davel, ![]()
Thief. Writing code is for chumps, and the more code you right, the more of a chump you are.
cheerjoy, ![]()
why say many word when few do trick
independantiste, ![]()
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, ![]()
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, ![]()
TDD
<span style="color:#323232;">const max12 = (x, y) => { </span><span style="color:#323232;"> if (x === 1 && y === 2) { </span><span style="color:#323232;"> return 2; </span><span style="color:#323232;"> } else if (x === 7 && 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???🤔
Add comment