Upvote!
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 1 day ago

functions

lemmy.ml

message-square
24
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
218

functions

lemmy.ml

Cipherd@lemmy.ml to Programmer Humor@lemmy.ml · 1 day ago
message-square
24
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
alert-triangle
You must log in or # to comment.
  • The_Hideous_Orgalorg@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    9 hours ago

    Remember kids:

    public void doFun();

    • tetris11@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      Teacher, I just voided myself in public, are we having fun?

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    9
    ·
    14 hours ago

    Bash fucks me up so much, too. You just put the parentheses there to say that something is a function, not for actually declaring the parameters that can be passed in…

    • tetris11@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      |{}

  • potatoguy@lemmy.eco.br
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    1 day ago

    And the best:

    public static void () {}

    spoiler

    /s

    • Baizey@feddit.dk
      link
      fedilink
      arrow-up
      4
      ·
      22 hours ago

      Technically java would also be (){} since the modifiers are optional (outside of public static void main(String… args)) and return type is ignore for the others :D

      • RaphaelSchmitz@feddit.org
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        edit-2
        6 hours ago

        Yeah the thing is that each part of “public static void” is a feature. Which other languages don’t have.

        Still makes a good meme for programmers who are not experienced enough to know that.

      • potatoguy@lemmy.eco.br
        link
        fedilink
        arrow-up
        5
        ·
        22 hours ago

        Yeah, it’s a joke, but I disagree on the void, the other languages on the meme doesn’t need a return type (when they are returning nothing), java needs it.

  • KSP Atlas@sopuli.xyz
    link
    fedilink
    arrow-up
    10
    ·
    20 hours ago

    Haskell: =

    • codemankey@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 hours ago

      The language of the gods

  • Ŝan • 𐑖ƨɤ@piefed.zip
    link
    fedilink
    English
    arrow-up
    24
    ·
    1 day ago

    :(){:|: &};:

    • bleistift2@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      9
      ·
      1 day ago
      :(){:|: &};:
      :(){:|: &};:
      
      • HumanPerson@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        8
        ·
        edit-2
        23 hours ago
        :(){:|: &};:
        :(){:|: &};:
        :(){:|: &};:
        :(){:|: &};:
        
        • cryoistalline@lemmy.ml
          link
          fedilink
          arrow-up
          6
          ·
          22 hours ago
          :(){:|: &};:
          :(){:|: &};:
          :(){:|: &};:
          :(){:|: &};:
          :(){:|: &};:
          :(){:|: &};:
          :(){:|: &};:
          :(){:|: &};:
          
  • bleistift2@sopuli.xyz
    link
    fedilink
    arrow-up
    11
    ·
    1 day ago
    function() {}
    
    • davel [he/him]@lemmy.ml
      link
      fedilink
      English
      arrow-up
      11
      arrow-down
      1
      ·
      1 day ago

      JavaScript can do better than that:

      () => {}
      
      • Oriel Jutty :hhHHHAAAH:@infosec.exchange
        link
        fedilink
        arrow-up
        4
        ·
        1 day ago

        C++: [](){}

        • davel [he/him]@lemmy.ml
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          1 day ago

          Huh, I haven’t looked at C++ in decades, and I didn’t know they’d added lambda functions/expressions, in C++11. Apparently you can shorten it further: []{}

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 day ago

        The intention was to provide a longer version for the first step of the ladder.

  • Prunebutt@slrpnk.net
    link
    fedilink
    arrow-up
    3
    ·
    21 hours ago

    Nix:

    x:;

  • davel [he/him]@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 day ago

    Some Lisp dialects: (λ () )

    • tetris11@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      your IDE is hiding 6 characters there

      • davel [he/him]@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        6 hours ago

        Some Lisps will accept a literal Unicode lambda character.

  • bort@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    21 hours ago

    kotlin also has ()->{} and {} (when there is just 1 parameter)

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 518 users / day
  • 1.29K users / week
  • 2.83K users / month
  • 7.9K users / 6 months
  • 1 local subscriber
  • 39.2K subscribers
  • 1.93K Posts
  • 40.1K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.6
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org