Threads for pulsoste

  1. 1

    Never realized that global can’t be constants. Is there a simple reason for that I’m missing?

    1. 1

      I honestly don’t know what they mean, you can export constants, and you can have package level constants. Is there some global scope above that which can only be variable and not constant?

      1. 2

        In the two common ways to do enums that he mentions, the custom types used for FlagID are just strings and ints, which can be constants, but in the new way he’s suggesting making FlagID a struct type, which cannot be a constant. This means your global/package-level enums can be overwritten by whatever code imports your package, whereas the “common” ways are using constants which can’t be overwritten.

        1. 1

          Right, I knew that there were numeric and string contants, and that more complex types (structs, etc) couldn’t be constants. Rereading the paragraph in the article, I had misinterpreted it the first time as stating that any global thing had to be variable, which is obviously wrong. Hence my confusion.

    1. 5

      I think clarity of communication is one of the most underrated skills as a developer. If the ratio of reading code to writing code is 10:1 then the ratio of talking about code to writing code must be 100:1

      So, barring overtime, a truly senior developer must average no more than 24 minutes a week coding? Possible, for some people who have the title “architect”, but I doubt it’s true of that many developers. I hope that if I ever reach that point, it’s because my title is manager/consultant/whatever else.

      1. 3

        I interpret these ratios as applying to time over the life of code, possibly including many people.

        Also, I am not aware of empirical studies that justify the stated ratios. I interpret them mostly as placeholders used to make a (useful) point.

        1. 2

          I definitely know multiple people for whom this is true.

          I hope to avoid such a fate myself but it absolutely happens.

          1. 2

            The majority of my time is doing operational stuff nowadays, and I frequently read code but am not an “official” developer on any of the projects whose code I’m reading. The ratio of loc read / loc written is > 10 for me for many projects.