Forum
    • Categories
    • Register
    • Login

    Claude's ugly code

    Scheduled Pinned Locked Moved AI discussion
    7 Posts 5 Posters 176 Views
    Loading More Posts
    • 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.
    • David HealeyD
      David Healey
      last edited by

      This is some code Claude gave me

      if (key == "midi" && isDefined(data.midi))
          ma.setAutomationDataFromObject(data.midi);
      else if (key == "macro" && isDefined(data.macro))
          mh.setMacroDataFromObject(data.macro);
      

      This is how I would write it

      if (!isDefined(data) || !isDefined(data[key]))
          return;
      
      if (key == "midi")
          ma.setAutomationDataFromObject(data[key]);
      else
          mh.setMacroDataFromObject(data[key]);
      

      Just sayin

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - HISE tutorials
      My Patreon - More HISE tutorials

      ChazroxC dannytaurusD HISEnbergH ustkU 4 Replies Last reply Reply Quote 3
      • ChazroxC
        Chazrox @David Healey
        last edited by

        @David-Healey said in Claude's ugly code:

        This is how I would write it

        scrape THAT! haha.

        1 Reply Last reply Reply Quote 1
        • dannytaurusD
          dannytaurus @David Healey
          last edited by

          @David-Healey Depends who (or what) is more likely to be reading the code in the future I guess.

          Meat Beats: https://meatbeats.com
          Klippr Video: https://klippr.video

          ChazroxC 1 Reply Last reply Reply Quote 0
          • ChazroxC
            Chazrox @dannytaurus
            last edited by Chazrox

            @dannytaurus the first time I heard the term 'human-readable' gave me the heebee geebeez. lol

            Who else is reading?...😨 lmaoo

            dannytaurusD 1 Reply Last reply Reply Quote 1
            • dannytaurusD
              dannytaurus @Chazrox
              last edited by

              @Chazrox 😂

              Meat Beats: https://meatbeats.com
              Klippr Video: https://klippr.video

              1 Reply Last reply Reply Quote 0
              • HISEnbergH
                HISEnberg @David Healey
                last edited by

                @David-Healey said in Claude's ugly code:

                This is some code Claude gave me

                if (key == "midi" && isDefined(data.midi))
                    ma.setAutomationDataFromObject(data.midi);
                else if (key == "macro" && isDefined(data.macro))
                    mh.setMacroDataFromObject(data.macro);
                

                This is how I would write it

                if (!isDefined(data) || !isDefined(data[key]))
                    return;
                
                if (key == "midi")
                    ma.setAutomationDataFromObject(data[key]);
                else
                    mh.setMacroDataFromObject(data[key]);
                

                Just sayin

                Hey Claude, please update your behaviour to script more like @David-Healey . Don't make any mistakes this time.

                Sonic Architect && Software Mercenary

                1 Reply Last reply Reply Quote 2
                • ustkU
                  ustk @David Healey
                  last edited by

                  @David-Healey You can ask Claude to analyse your previous project styles once for all so it automatically applies it next time

                  Hise made me an F5 dude, any other app just suffers...

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post

                  17

                  Online

                  2.4k

                  Users

                  13.8k

                  Topics

                  120.6k

                  Posts