• dariusj18@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    6 months ago

    The number one thing that gets in my way of refactoring to function is figuring out what to name the functions takes too long.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      6 months ago

      Then perhaps the code you are trying to extract doesn’t make a clear and cohesive procedure. Maybe include more or less of the code, or rework the code into logical pieces or steps. Write the algorithm in human language first, then implement the steps using functions.

      🤷‍♂️ Or fnck it.

    • zea@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      6 months ago

      Pick something and change it when inspiration strikes. Sometimes you need a big picture view of something to get the right abstractions or even just name things.