Skip to content
DevMeme
3865 of 7590
Languages Post #4208 · source on Telegram

A Pun-derful Guide to Function Declaration Syntax

Description

This is a four-panel meme that humorously compares the function declaration syntax of four different programming languages through visual puns. Each panel features the language's logo, a code snippet for declaring a function, and a corresponding image. The first panel shows the Rust logo with 'fn myFunction()' next to an image of a crudely rendered airplane labeled 'PLNE,' a surreal meme pun on 'fn.' The second panel features the Kotlin logo and 'fun myFunction(),' paired with a photo of people having fun on a boat, a literal interpretation. The third panel displays the Go logo with 'func myFunction()' next to a retro graphic that reads 'Play that FUNKY Music,' a pun on 'func.' The final panel shows the JavaScript 'JS' logo and the code 'function myFunction(),' alongside a photo of someone writing a long, dense essay by hand. For experienced developers, the humor lies in the clever wordplay and the final jab at JavaScript for having a comparatively verbose keyword, a long-standing trope in language comparisons

Comments

17
Anonymous ★ Top Pick Modern languages treat function declaration like a command. JavaScript treats it like a formal declaration of intent that must be notarized
  1. Anonymous ★ Top Pick

    Modern languages treat function declaration like a command. JavaScript treats it like a formal declaration of intent that must be notarized

  2. Anonymous

    Rust: “fn” - trimmed for zero-cost abstractions; Kotlin: “fun” - marketing swears your NPEs will smile; Go: “func” - stopped typing when the scheduler pre-empted; JavaScript: “function” - leaves the verbosity to be dieted away so the bundler feels important

  3. Anonymous

    After 20 years in the industry, I've realized the correlation between function keyword length and the amount of therapy needed after debugging production issues is statistically significant. Rust developers type 'fn' because they've already optimized away their will to type unnecessary characters along with their heap allocations

  4. Anonymous

    JavaScript types out 'function' in full, then ships half its ecosystem as arrow functions to avoid ever saying it again

  5. Anonymous

    Ah yes, the four stages of function declaration grief: Rust's 'fn' where you crash and burn fighting the borrow checker, Kotlin's 'fun' where Android development is actually enjoyable for once, Go's 'func' that makes you want to play funky music while your goroutines dance, and JavaScript's 'function' keyword so verbose you might as well write it out longhand with a quill pen. The real question is: which language's function syntax best represents your current relationship with your codebase?

  6. Anonymous

    Empirical rule: keyword length is inversely proportional to compile‑time guardrails - by the time you’re typing “function”, you’re type‑checking with Grafana

  7. Anonymous

    Rust functions board the plane on time; Kotlin/Go hit the disco; JS? Still hand-scoring the callback symphony

  8. Anonymous

    Lifecycle of a function keyword: Rust’s fn - compiler yells; Go’s func - linter grumbles; Kotlin’s fun - IDE smiles; JavaScript’s function - your pager vibrates

  9. @kitbot256 4y

    function myFunction() ? So very oldschool.

  10. @dsmagikswsa 4y

    I prefer rust or go way.

  11. @lord_nani 4y

    def:

  12. @sin_senya 4y

    Return_type foo();

    1. @Box_of_the_Fox 4y

      fun foo(): bar

  13. @lord_nani 4y

    Better reference

  14. @asm3r 4y

    Arrow functions?

  15. @zotho 4y

    const f = () => {};

  16. @Dexconv 4y

    Fuc myFunction() For devs with anger issues

Use J and K for navigation