620
Find yourself (lemmy.ml)
submitted 2 years ago by [email protected] to c/[email protected]
(page 2) 50 comments
sorted by: hot top new old
[-] [email protected] 5 points 2 years ago

@coja I am the engineer because I forget about Math.max existence

[-] [email protected] 4 points 2 years ago

Engineer likely ends up with the smallest code. Though the hit to execution time for a branch sucks. (Pipelines and such)

Bit hacker will take the least execution time because of pipelines, but it needs more comments. Maybe something like // trust me, this works.

[-] [email protected] 5 points 2 years ago

Last one should be // still a student

[-] [email protected] 4 points 2 years ago

Every single entry other than thief is "still a student"

[-] [email protected] 4 points 2 years ago

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

[-] [email protected] 4 points 2 years ago

Yoink.

Actually I've probably been all of these at various times in my career.

[-] [email protected] 3 points 2 years ago

here’s another mathematical approach (that has the added benefit of only working when x and y are both positive).

let f denote the linear functional on ℝ^2^ defined by f(1,0) = x and f(0,1) = y (and extend by linearity). then the operator norm || f || is equal to max(x,y).

[-] [email protected] 3 points 2 years ago

I'm mostly lost and in over my head

[-] [email protected] 3 points 2 years ago

Why use const max = (x, y) => x > y ? x : y instead of function max(x, y) { return x > y ? x : y } ?

[-] [email protected] 2 points 2 years ago

2, but I'm incredibly embarrassed to say that I've had to do 9 before

load more comments (2 replies)
[-] [email protected] 1 points 2 years ago* (last edited 2 years ago)

my $max = $x > $y ? $x : $y;

load more comments
view more: ‹ prev next ›
this post was submitted on 22 Oct 2023
620 points (95.7% liked)

Programmer Humor

35867 readers
354 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS