• Jayjader@jlai.lu
    link
    fedilink
    arrow-up
    16
    ·
    2 days ago

    I find it much easier to find the function definitions when the word function is a different color than most of the surrounding text.

    if the author meant “find a specific function def according to it’s name or role” then I could at least appreciate the perspective. As it stands, I can’t help but notice that their supposed “better highlighting for finding defs” example is not using the same source code: the preceding anonymous immediately-invoked function that englobes the entire first code block/sample is now off-screen and the code blurb itself is different…

    • ignirtoq@fedia.io
      link
      fedilink
      arrow-up
      10
      ·
      2 days ago

      the preceding anonymous immediately-invoked function that englobes the entire first code block/sample is now off-screen and the code blurb itself is different…

      That bothered me a lot. Then I noticed in his second snippet, only function names were highlighted. What if I’m reviewing someone else’s code and I’m looking for magic strings/numbers that should be factored out as constants or parameters? The first block already has literal values a distinct color; does he expect me to change the syntax highlighting settings on my IDE for every task?

      • Jayjader@jlai.lu
        link
        fedilink
        arrow-up
        4
        ·
        2 days ago

        For what it’s worth, the second snippet is just to demonstrate their point about looking for function defs names. Reading the article until the end, they propose a bit more than just coloring function names where they are defined.

        I still don’t think the example proves their point, but let’s not misconstrue it either.

        • ignirtoq@fedia.io
          link
          fedilink
          arrow-up
          6
          ·
          2 days ago

          I honestly couldn’t get very far because his points were not as clear-cut as he was trying to imply and the tone was confrontational. I have a hard time being told I’m wrong on a matter of personal preference that is individually configurable , and where my choices have no impact on others’ experience.

          If he’s venting about his own experience, because the most common choices, which are defaults, don’t match his preferences, go right ahead. But don’t phrase it like anyone who disagrees with you can be demonstrated as objectively wrong with a few simple examples.