Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
cm0002 ( cm0002@piefed.world )  to Programmer Humor@programming.devEnglish · 1 year ago

Programmer meme

i.redd.it

message-square
6
link
fedilink
107

Programmer meme

i.redd.it

cm0002 ( cm0002@piefed.world )  to Programmer Humor@programming.devEnglish · 1 year ago
message-square
6
link
fedilink
alert-triangle
You must log in or # to comment.
  • JohnnyCanuck ( JohnnyCanuck@lemmy.ca ) 
    link
    fedilink
    arrow-up
    18
    ·
    edit-2
    1 year ago
    import builtins
    
    def HelloWorld(funcname):  
        getattr(builtins, funcname)("HelloWorld")
    
    HelloWorld("print")
    

    Edit, improved:

    import inspect, builtins
    
    def HelloWorld(funcname):
        caller = inspect.currentframe().f_code.co_name
        getattr(builtins, funcname)(caller)
    
    HelloWorld("print")
    
    • palordrolap ( palordrolap@fedia.io ) 
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Perl time:

      sub AUTOLOAD {
          our $AUTOLOAD=~s/.*:://;
          no strict;
          local $_=$_[0] and *STDOUT->$_($AUTOLOAD)
      }
      
      HelloWorld("print");
      

      Pro: You can Give HelloWorld any (syntactically valid) name you like and (as long as the parameter is "print", anyway) its name will be printed, no pre-declaration required.

      Con: The specified function inside the quotes has to be a method associated with a file descriptor.

  • goatinspace ( goatinspace@feddit.org ) 
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    I’m not surprised by anything at this point

  • handsoffmydata ( handsoffmydata@lemmy.zip ) 
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Why Yoda switched his major from CS to Jedi Studies

  • pewpew ( pewpew@feddit.it ) 
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    print

  • marsza ( marsza@lemmy.cafe ) 
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Sometimes I wish there were Easter eggs like this in programming languages. But then, people would just be using these Easter eggs for everything

Programmer Humor@programming.dev

programmer_humor@programming.dev

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: !programmer_humor@programming.dev

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

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

  • 221 users / day
  • 1.64K users / week
  • 3.13K users / month
  • 7.27K users / 6 months
  • 463 local subscribers
  • 33.5K subscribers
  • 1.53K Posts
  • 25.1K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code