762
ifn't (programming.dev)
you are viewing a single comment's thread
view the rest of the comments
[-] xmunk@sh.itjust.works 26 points 5 months ago

PHP has the always wonderful (and perfectly functional) syntax of

logUserIn() or die();

[-] msage@programming.dev 6 points 5 months ago
[-] frezik@midwest.social 10 points 5 months ago* (last edited 5 months ago)

Perl also has unless() for the very purpose in OP, which is a more sensible choice.

Oh, and if you need to reinforce your belief that Perl is a mess, the single-quote character can be used as a package separator instead of "::". This was set in the 90s when nobody was quite sure of the right syntax for package separators, so it borrowed "::" from C++ and the single quote from Ada (I think).

That means the ifn't() in OP can be interpreted as calling the t() function on the ifn package.

The "::" separator is vastly preferred, though. Single quotes run havoc on syntax highlighting text editors (since they can also be used for strings). About the only time I've seen it used is a joke module, Acme::don't.

[-] evatronic@lemm.ee 3 points 5 months ago

Where do you think PHP stole it from?

this post was submitted on 18 Jan 2024
762 points (98.6% liked)

Programmer Humor

18319 readers
907 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS