this post was submitted on 10 Sep 2025
281 points (98.0% liked)

Programmer Humor

26265 readers
730 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] abbadon420@sh.itjust.works 7 points 1 day ago (4 children)

Where does that notation work?

[–] felsiq@piefed.zip 39 points 1 day ago (2 children)

Lisp uses it, with the fun extra part that operators are just normal functions - so instead of foo(bar) you get (foo bar), or for operators 1+1+2 becomes (+ 1 1 2). It’s a really fun language even just for being different than most, I def recommend playing around with it if you’re looking for something new.

[–] BennyInc@feddit.org 40 points 1 day ago (2 children)

The fun part comes from using it without syntax highlighting, so you can regularly play „find the missing paranthesis“.

[–] felsiq@piefed.zip 27 points 1 day ago

My lisp days were back in my “IDEs are bloat” phase so that’s the only way I ever interacted with it lmao

[–] AnUnusualRelic@lemmy.world 7 points 1 day ago

Editing lisp with ed is the best way to learn it.

[–] Mika@piefed.ca 12 points 1 day ago (1 children)

The most interesting part about Lisp is homoiconicity:

(+ 1 1 2) is literally a list with symbol "+" and 3 numbers.

Which allows to build the most powerful macro possible, manipulating code (with data as a tree-like structures) and changing it into whatever else at compile time.

Now if only there was any good use for macros, this would be the best language 🙃

[–] RecallMadness@lemmy.nz 10 points 1 day ago (1 children)

Threading is a great case for a macro.

(-> x (* 2) (/ 3) (- 1))

Is the same as (- (/ (* x 2) 3) 1)

[–] Mika@piefed.ca 1 points 1 day ago (1 children)

Sure it's not like it has no uses, but it's something languages have built-in as syntax sugar or operators, and you rarely need to built your own macro for anything.

[–] palordrolap@fedia.io 8 points 1 day ago (2 children)

(f x) works this way in Lisp - as in the joke - and Lisp descendants like Scheme. And then there's Haskell which takes the whole thing a step further still.

Also Perl, because Larry thought it would be fun(ctional). The external parentheses are technically optional in this case, but won't break anything if included. Regular f(x) syntax is also supported there. (You could probably remake this meme with Python and Perl in first and second panels tbh.)

And I know of at least one dialect of BASIC that allowed subroutine calls to lack their parentheses, so the same external parentheses thing would apply if that subroutine was a function.

[–] CanadaPlus@lemmy.sdf.org 4 points 1 day ago (1 children)

And then there’s Haskell which takes the whole thing a step further still.

Wait, what works in Haskell that doesn't in Lisp, exactly? Are the spaces not just function composition?

[–] palordrolap@fedia.io 3 points 1 day ago (2 children)

My mistake. I had somehow missed or forgotten that Lisp also supports currying, which is what I was thinking of as Haskell taking further. There might be other things regarding type declaration and such, but that's a little beyond me to confirm or deny at the moment.

[–] KSPAtlas@sopuli.xyz 2 points 1 day ago (1 children)

In haskell, any function with a name made entirely out of symbols (like + or >>=) works as an infix operator (you can turn any function into an infix operator using backticks)

[–] palordrolap@fedia.io 1 points 1 day ago

Now that you mention it, I do remember the backticks and symbols thing for infix, so yeah that'd be something extra that Haskell did. One of the few things about Haskell that wasn't on the fringes of my capability and understanding as I recall.

I remember thinking that it would be cool if other, more procedural, languages allowed it, but then most other languages also don't have the capability of setting the precedence of new operators relative to old ones on the fly. A lot of that stuff is hard-coded into those languages' compilers.

[–] bitcrafter@programming.dev 2 points 1 day ago

In Haskell, all functions are curried by default, so you can partially apply a function merely by applying it to fewer than the supported number of arguments.

Also, it is worth noting that laziness-by-default in Haskell makes it so that you can use ordinary functions to define control structures, rather than needing to turn to metaprogramming like you do in Lisp.

[–] dan@upvote.au 2 points 1 day ago (1 children)

of at least one dialect of BASIC that allowed subroutine calls to lack their parentheses

Did sub calls normally have parentheses in BASIC?

[–] palordrolap@fedia.io 1 points 1 day ago (1 children)

Yes. Most early BASICs even required that any reference to a function name, in definition or calling, be preceded by an FN keyword as well as the parentheses.

QBASIC, Visual BASIC and the related dialects of BASIC found in MS Office and LibreOffice all have slightly better syntax for defining and calling functions than the older BASICs, but they all still require parentheses on their subroutine parameter lists too.

At best, you might be able to call a subroutine by name with no empty parentheses after it, but as soon as you need parameters, you'll need parentheses around them.

But like I say, there was at least one rare BASIC that didn't need them, so I'm assuming there might have been others that I'm not aware of.

[–] dan@upvote.au 1 points 1 day ago

Thanks for the info. I haven't used BASIC in a very long time and can't remember much about the syntax. Must be over 20 years ago now. I switched from VB6 to C# when .NET Framework 2.0 was released.

[–] Decq@lemmy.world 7 points 1 day ago

In c style languages, Java, c++, rust, etc.