• Aux@feddit.uk
    link
    fedilink
    English
    arrow-up
    2
    ·
    14 hours ago

    What kind of code are you writing that your CPU goes to sleep? If you follow any good practices like TDD, atomic commits, etc, and your code base is larger than hello world, your PC will be running at its peak quite a lot.

    Example: linting on every commit + TDD. You’ll be making loads of commits every day, linting a decent code base will definitely push your CPU to 100% for a few seconds. Running tests, even with caches, will push CPU to 100% for a few minutes. Plus compilation for running the app, some apps take hours to compile.

    In general, text editing is a small part of the developer workflow. Only junior devs spend a lot of time typing stuff.

    • xthexder@l.sw0.com
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      6 hours ago

      Anything that’s per-commit is part of the “build” in my opinion.

      But if you’re running a language server and have stuff like format-on-save enabled, it’s going to use a lot more power as you’re coding.

      But like you said, text editing is a small part of the workflow, and looking up docs and browsing code should barely require any CPU, a phone can do it with fractions of a Watt, and a PC should be underclocking when the CPU is underused.

      • Aux@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        What do you mean “build”? It’s part of the development process.