622
you are viewing a single comment's thread
view the rest of the comments
[-] ugo@feddit.it 13 points 7 months ago

If this was cpp, clang-tidy would tell you “do not use else after return”

I don’t know how null works in swift, but assuming it coerces to bool I’d write

if (a) return a;
return b;
[-] eutampieri@feddit.it 3 points 7 months ago

It's nil, and you can coalesce it with ??

this post was submitted on 08 Dec 2023
622 points (96.4% liked)

Programmer Humor

31259 readers
830 users here now

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

Rules:

founded 4 years ago
MODERATORS