schmonz.com is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Search results for tag #refactoring

#refactoring boosted

[?]Leanpub » 🌐
@leanpub@mastodon.social

Welcome to the Leanpub Launch video for Craft Your Code: Mastering the Foundations of Code Quality in the Era of AI Assistants, Second Edition by Srihari Sridharan!

Watch & read on the Leanpub blog here:

leanpub.com/blog/leanpub-book-

    #refactoring boosted

    [?]Leanpub » 🌐
    @leanpub@mastodon.social

    Leanpub Book LAUNCH 🚀 Craft Your Code: Mastering the Foundations of Code Quality in the Era of AI Assistants, Second Edition by Srihari Sridharan

    Watch here:

    youtu.be/WjWRbaaXtF0

      #refactoring boosted

      [?]Dev Leader » 🌐
      @devleader@hachyderm.io

      #refactoring boosted

      [?]Jack Linke 🦄 » 🌐
      @jack@social.jacklinke.com

      These models are used in literally thousands of places in the project - they're truly the heart of the system. And this weekend I am attempting a major heart surgery to rewire them.

      This includes standard migrations, data migrations, and lots and lots of refactoring throughout the project.

      Terrifying stuff.

      Wish me luck 😬

      3/3

        #refactoring boosted

        [?]richard » 🌐
        @admin-richard@www.main-vision.com

        Refactoring and (A)I

        Reading Time: 3 minutes

        Table of Contents

        1. Scope Windows and AI
        2. Gemini and Git
          1. Why Entrust Git rather than AI?
          2. The AI Negative Feedback Loop
        3. Git and a Fresh Chat
        4. AI driven Refactoring Lessons Learned
          1. If Logic Works, Embed It
        5. And Finally

        For two days I have been migrating my blog from Hugo to Eleventy via the markdown pages, and the photos via Ghost Export for WordPress. In the process I achieved a goal, and then AI broke things, so I achieved them again, and then AI broke them again.

        The favourite thing for Ai, and Gemini, in particular to break was the logic that took the markdown titles, matched them to a json file, and then helped 11ty marry the photo with the correct post. When it worked it was brilliant, but when it broke I would spend half a day trying to fix it. By the third time this happened I decided to ask Gemini to help me write a script to hard code the image path straight into markdown pages.

        That step was a resounding success. The logic is simple. AI is great for a simple question, but as soon as you start a russian doll/inception of steps the context window, or scope window, to use a programming term gets confused.

        Scope Windows and AI

        I saw the term context window used, but I'd like to experiment with scope and AI. Specifically I'd like to document how it behaved when I saw that the eleventy.js file was getting too long, and I asked Gemini to refactor it. The first mistake was to accept that Gemini could do this in just two steps. Step 1, filters.js, and then step 2 for another set of logic.

        Now, in an ideal world, AI would know what it did, see the code, determine what each part does, and tidy everything up into neat refactored niches. It didn't do that. Remember that mention of the image logic being lost three times? The third time was due to refactoring.

        To be specific, Gemini took the complex logic for matching thumbnails to posts and replaced it with two lines of irrelevant code, that I noticed eventually, as I tried to debug why the refactoring had failed.

        Gemini and Git

        When I noticed that Gemini has issues with keeping within the scope of a question I decided to use git. Every time Gemini provided me with a solution that worked I'd commit it. The logic is that if it breaks something I can tell it "This is how things were, and this is how they are now. I'd like to fix things".

        Why Entrust Git rather than AI?

        In my experience AI is fantastic as spitting out code, and muddling contexts, but very bad at answering "Can you remind me which command we used to do that", whereas git is fantastic at that, if you're efficient about git commit comments that mean something to you.

        The AI Negative Feedback Loop

        If AI makes a mistake, either because your instructions were not clear or because it got confused, asking another question will muddle it even further. Imagine an AI chat as a sand pit by the sea. The more you chat, the deeper the hole you dig. Eventually you make a mistake, and the tidal waters begin to flow into your sandpit. Within seconds that chat is swamped and unusable. With AI it's good to have a bug out bag ready. "Now that this context is hallucinating let's move to a new one".

        Git and a Fresh Chat

        If you're working on an eleventy blog and you're adding functionality, one step at a time, it's good to add bookmarks in the form of git commits. You use Gemini, or your favourite LLM to write the function, and once it works you bookmark it. You then write the next, and bookmark that. Eventually, when the LLM, or you, makes a mistake, and the LLM hallucinates or starts muddling scopes, you just start with a clean slate, helped by git, and continue moving forward, with a minimum of hassle.

        AI driven Refactoring Lessons Learned

        Next time I refactor I won't ask "can you refactor this long eleventy.js file?" I will break into stages. I like that Gemini refactored the functions into two files based on function type. I made the mistake of not checking that it preserves the logic of the function while refactoring. Be explicit.

        If Logic Works, Embed It

        With the thumbnails and featured images logic I assumed that once the logic worked, it would be permanent. It isn't. It can easily change. When I told Gemini to use the logic, and move the image paths directly into the markdown files I simplified my life. Complex logic could be removed from eleventy, and posts could go with a standardised approach to displaying images. Simplification works.

        And Finally

        Use git to help you keep track of changes. AI is not a search engine, so don't rely on it to remember a solution it provided for you. It will come up with a new one. Be as concise as possible and keep the context window small. The larger it is, the more room there is for mistakes.

        And finally, AI might be logical and rational but it doesn't have an understanding of what it is doing. To use the Short Circuit analogy "A machine doesn't have emotions, or feel, it only runs as programmed". AI is Not Number five. AI is a tool. That's why it's good to practice with using it properly.

          #refactoring boosted

          [?]Otto Rask » 🌐
          @ojrask@piipitin.fi

          #refactoring boosted

          [?]sroccaserra » 🌐
          @sroccaserra@pouet.chapril.org

          I've been training many teams around coding, design, and refactoring this past year, and here are three things I repeat often:

          Fix the small things, particularly during training. Learning to be super fast at fixing the small things prepare you for when the big things will come. In that, when big things arrive, the small things will never be an issue, you can deal with them on autopilot and save your energy for the big things.

          1/3

            #refactoring boosted

            [?]sroccaserra » 🌐
            @sroccaserra@pouet.chapril.org

            Refactoring : If you run the tests often: everytime it breaks, it has to be what you just did. Diagnostic is super easy. If you run the tests at the end only: if it’s broken, you have no idea why and you have to look everywhere. Check early, check often.

            2/3

              #refactoring boosted

              [?]sroccaserra » 🌐
              @sroccaserra@pouet.chapril.org

              My preference: start slow, finish fast with confidence. Rather than start fast, finish slow with a lot of things to fix.

              Bonus:

              Refactoring is also knowing when to stop.

              3/3

                #refactoring boosted

                [?]Dev Leader » 🌐
                @devleader@hachyderm.io

                #refactoring boosted

                [?]Kevlin Henney » 🌐
                @kevlin@mastodon.social

                You know you're old when... someone cites a concept and both cites and shows the book that is influential in this space... this is good... but the book they show is the second edition, when your point of reference for the same concept is the same book... but the first edition... that is (personally) not so good 🙄

                  #refactoring boosted

                  [?]Clare Sudbery » 🌐
                  @claresudbery@mastodon.social

                  We organise in the open, and you're very welcome to chat with the organisers to help, ask questions, give feedback, or simply to watch. You can reach us on the slack channel (slack.softwarecrafters.org/), or on mastodon, LinkedIn, BlueSky, or by emailing organisers at socratesuk dot org.





                    #refactoring boosted

                    [?]SoCraTes UK » 🌐
                    @SoCraTes_UK@discuss.systems

                    We organise in the open, and you're very welcome to chat with the organisers to help, ask questions, give feedback, or simply to watch. You can reach us on the slack channel (slack.softwarecrafters.org/), or on mastodon, LinkedIn, BlueSky, or by emailing organisers at socratesuk dot org.





                      #refactoring boosted

                      [?]Ted M. Young » 🌐
                      @jitterted@sfba.social

                      Thanks to all the folks who attended my talk on in (mostly) without AI.

                      Slides are available here: ted.dev/talks/#past-talks

                      Want this talk (or other ones) at your group event or conference, let me know!

                        #refactoring boosted

                        [?]Alvin Ashcraft 🐿️ » 🌐
                        @alvinashcraft@hachyderm.io

                        Nat Pryce boosted

                        [?]Ted M. Young » 🌐
                        @jitterted@sfba.social

                        Ted M. Young boosted

                        [?]SoCraTes UK » 🌐
                        @SoCraTes_UK@discuss.systems

                        We organise in the open, and you're very welcome to chat with the organisers to help, ask questions, give feedback, or simply to watch. You can reach us on the slack channel (slack.softwarecrafters.org/), or on mastodon, LinkedIn, BlueSky, or by emailing organisers at socratesuk dot org.





                          #refactoring boosted

                          [?]Clare Sudbery » 🌐
                          @claresudbery@mastodon.social

                          We organise in the open, and you're very welcome to chat with the organisers to help, ask questions, give feedback, or simply to watch. You can reach us on the slack channel (slack.softwarecrafters.org/), or on mastodon, LinkedIn, BlueSky, or by emailing organisers at socratesuk dot org.





                            #refactoring boosted

                            [?]Dev Leader » 🌐
                            @devleader@hachyderm.io

                            #refactoring boosted

                            [?]Jon Fazzaro » 🌐
                            @fazzaro@hachyderm.io

                            "Always be refactoring. If you touch the code, and you can improve it, improve it, but never optimise early."

                            levelup.gitconnected.com/marti

                              #refactoring boosted

                              [?]Clare Sudbery » 🌐
                              @claresudbery@mastodon.social

                              We organise in the open, and you're very welcome to chat with the organisers to help, ask questions, give feedback, or simply to watch. You can reach us on the slack channel (slack.softwarecrafters.org/), or on mastodon, LinkedIn, BlueSky, or by emailing organisers at socratesuk dot org.





                                Ted M. Young boosted

                                [?]SoCraTes UK » 🌐
                                @SoCraTes_UK@discuss.systems

                                We organise in the open, and you're very welcome to chat with the organisers to help, ask questions, give feedback, or simply to watch. You can reach us on the slack channel (slack.softwarecrafters.org/), or on mastodon, LinkedIn, BlueSky, or by emailing organisers at socratesuk dot org.





                                  #refactoring boosted

                                  [?]Leanpub » 🌐
                                  @leanpub@mastodon.social

                                  Leanpub Book LAUNCH 🚀 The Other Half of Coding: What they Didn't Teach You by Max Guernsey, III

                                  This is our second launch video for this now-completed book!

                                  Watch here:

                                  youtu.be/4W1KGptucBg

                                    #refactoring boosted

                                    [?]Leanpub » 🌐
                                    @leanpub@mastodon.social

                                    Leanpub book LAUNCH 🚀 The Other Half of Coding: What they Didn't Teach You by Max Guernsey, III

                                    Watch here: youtu.be/lDwuiSwaCf4

                                      #refactoring boosted

                                      [?]Habr » 🤖 🌐
                                      @habr@zhub.link

                                      Три агента, один репозиторий, ноль менеджеров. Как я построил конвейер, где ИИ пишет, ревьюит и деплоит код

                                      Месяц назад я закинул задачу на рефакторинг модуля авторизации и пошёл варить кофе. Кофе я допить не успел. Через двадцать минут пришло уведомление в ТГ: «staging обновлён, 94 теста пройдено, 0 упало». Открыл репозиторий. Ветка, diff на два экрана. Code review от второго агента. Три замечания, два по делу. Третий агент прогнал тесты и задеплоил. Код был чище, чем я обычно пишу по пятницам. Но до этого момента были три месяца граблей, упавший продакшен, и одна ночь, когда агенты сделали десятки бесполезных коммитов. Обо всём по порядку.

                                      habr.com/ru/articles/995430/

                                        #refactoring boosted

                                        [?]Dev Leader » 🌐
                                        @devleader@hachyderm.io

                                        #refactoring boosted

                                        [?]Nicolas Fränkel 🇪🇺🇺🇦🇬🇪 » 🌐
                                        @frankel@mastodon.top

                                        #refactoring boosted

                                        [?]Dev Leader » 🌐
                                        @devleader@hachyderm.io

                                        Back to top - More...