If only some sort of newfangled technology could come along

  • funkless_eck@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    7
    ·
    19 hours ago

    hey now but what if I want my code to be like

     if gun.is_valid and not gun == null and gun.id != null:
            shoot()
    
      func shoot():
             fire(gun):
    
    
        func fire(gun):
              if gun.is_valid and not gun == null and gun.id != null:
                       weapon_activate(gun)
    
    • sp3ctr4l@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      9 hours ago

      Why… why are these nested… owwww my brain.

      Oh my god. Its soo bad, it keeps getting worse the more I look at it…

      I hate you but also, well done.

      • funkless_eck@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        8 hours ago

        haha, it’s actually from experience of trying to undo what AI did to my code. And I’m just a casual hobbyist in scripting languages.

        I still have a to-do to unstick how it is using a lambda to set a bool value inside a dict with only one key, when any normal human would just do

          bool_var = my_func()
        
          def my_func()
               [code goes here]
                if x:
                     return true
                else:
                      return false 
        

        it’s really been a lesson in how I can’t even use AI to learn, let alone actually produce.