Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. Programmer meme

Programmer meme

Scheduled Pinned Locked Moved Programmer Humor
7 Posts 7 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C This user is from outside of this forum
    C This user is from outside of this forum
    [email protected]
    wrote last edited by
    #1
    This post did not contain any content.
    G johnnycanuck@lemmy.caJ M shady_shiroe@lemmy.worldS H 5 Replies Last reply
    107
    • C [email protected]
      This post did not contain any content.
      G This user is from outside of this forum
      G This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      I'm not surprised by anything at this point

      1 Reply Last reply
      1
      • C [email protected]
        This post did not contain any content.
        johnnycanuck@lemmy.caJ This user is from outside of this forum
        johnnycanuck@lemmy.caJ This user is from outside of this forum
        [email protected]
        wrote last edited by [email protected]
        #3
        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")
        
        P 1 Reply Last reply
        13
        • C [email protected]
          This post did not contain any content.
          M This user is from outside of this forum
          M This user is from outside of this forum
          [email protected]
          wrote last edited by
          #4

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

          1 Reply Last reply
          2
          • johnnycanuck@lemmy.caJ [email protected]
            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")
            
            P This user is from outside of this forum
            P This user is from outside of this forum
            [email protected]
            wrote last edited by
            #5

            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.

            1 Reply Last reply
            2
            • C [email protected]
              This post did not contain any content.
              shady_shiroe@lemmy.worldS This user is from outside of this forum
              shady_shiroe@lemmy.worldS This user is from outside of this forum
              [email protected]
              wrote last edited by
              #6

              Well well well, how the turned have tables, they have

              1 Reply Last reply
              0
              • C [email protected]
                This post did not contain any content.
                H This user is from outside of this forum
                H This user is from outside of this forum
                [email protected]
                wrote last edited by
                #7

                Why Yoda switched his major from CS to Jedi Studies

                1 Reply Last reply
                2
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups