this post was submitted on 24 Sep 2023
470 points (92.9% liked)

Programmer Humor

32410 readers
1 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
all 38 comments
sorted by: hot top controversial new old
[–] Reinsch@feddit.de 73 points 2 years ago (2 children)

Ewww default exports. Explicit named exports are better! And so it begins

[–] Bishma@discuss.tchncs.de 16 points 2 years ago

How very dare you share my opinion!

[–] ShortFuse@lemmy.world 11 points 2 years ago* (last edited 2 years ago)

PascalCase default exports for Classes

camelCase named exports for functions

ALL_CAPS named exports for constants

[–] the_beber@lemm.ee 35 points 2 years ago (4 children)
[–] Andrew15_5@mander.xyz 29 points 2 years ago (4 children)

How about some fn instead?

[–] MultipleAnimals@sopuli.xyz 13 points 2 years ago* (last edited 2 years ago) (2 children)
pub async fn foo() -> Pin>>>>>

oh fuck commonmark cant display the syntax :( well anyone who has done async rust can imagine

[–] flashgnash@lemm.ee 5 points 2 years ago

p a f fn(){}

[–] AVincentInSpace@pawb.social 2 points 2 years ago* (last edited 2 years ago) (1 children)

Pin<Box<dyn Future<Output=Result<AsyncResponseThatYouWillHaveToAwaitAgain<ActualResultType>, InscrutableErrorTypeThatDoesntImplementDisplay>> + Send + Sync + 'static + 20MillionMoreAutoTraits>>

[–] MultipleAnimals@sopuli.xyz 2 points 2 years ago

Exactly, now we are talking

[–] Xylight@lemmy.xylight.dev 10 points 2 years ago

these puns are getting funcy

[–] LufyCZ@lemmy.dbzer0.com 2 points 2 years ago

So much better

[–] ______@lemm.ee 2 points 2 years ago

Chef's kiss 👌

[–] autokludge@programming.dev 9 points 2 years ago

How about some (defun)?

[–] DmMacniel@feddit.de 4 points 2 years ago (1 children)
[–] the_beber@lemm.ee 2 points 2 years ago
[–] redcalcium@lemmy.institute 13 points 2 years ago

When the grey beards wake up they're going to be fuming

[–] HStone32@lemmy.world 2 points 2 years ago

int main() {}

Seriously. why isn't there any C love around here?

[–] TheGayTramp@lemmy.ca -5 points 2 years ago (2 children)

Who doesn’t use arrow functions?

[–] marwwin@suppo.fi 27 points 2 years ago (1 children)

Arrow functions should be used only for callbacks. I hate that people has started defining named functions with arrow functions in JS. Arrow functions are not hoisted and the ordering of your functions is going to get wonky, because you need to define all you functions first before composing them, when it should be the other way around. Start with the most high-level function which calls lower level functions.

[–] Paradoxvoid@aussie.zone 6 points 2 years ago (1 children)

I had this exact fight with my team several months ago, and lost to popular opinion since the rest of my team are either zoomers or indifferent.

[–] JonEFive@midwest.social 3 points 2 years ago

I've reached the point that I cringe at the mention of arrow functions because so many people seem to always want to use arrow functions.

Like I'm looking up something on stack overflow and half the answers are arrow functions that are that way for no other reason than to use the fun little =>

[–] Cargon@lemmy.ml 15 points 2 years ago (2 children)
sum(your_mom &lt;- rep(69, 420))
[–] JonEFive@midwest.social 2 points 2 years ago (1 children)
[–] Cargon@lemmy.ml 2 points 2 years ago

It's being assigned and passed to sum at the same time. One of the many entertaining quirks of R.