• @[email protected]
      link
      fedilink
      391 year ago

      I genuinely believe something like this is what some of my professors wanted me to submit back in school. I once got a couple points off a project for not having a clarifying comment on every single line of code. I got points off once for not comment-clarifying a fucking iterator variable. I wish I could see what they would have said if I turned in something like this. I have a weird feeling that this file would have received full marks.

      • @[email protected]
        link
        fedilink
        121 year ago

        Did you have my professor for intro to C? This guy was well known for failing people for plagiarism on projects where the task was basically “hello world”. And he disallowed using if/else for the first month of class.

        • @[email protected]
          link
          fedilink
          English
          61 year ago

          Reminds me of an early Uni project where we had to operate on data in an array of 5 elements, but because “I didn’t teach it to everyone yet” we couldn’t use loops. It was going to be a tedious amount of copy-paste.

          I think I got around it by making a function called “not_loop” that applied a functor argument to each element of the array in serial. Professor forgot to ban that.

          • @[email protected]
            link
            fedilink
            51 year ago

            but because “I didn’t teach it to everyone yet” we couldn’t use loops.

            That is aggravating. “I didn’t teach the class the proper way to do this task, so you have to use the tedious way.” What is the logic behind that other than wasting everyone’s time?

            • @[email protected]
              link
              fedilink
              11 year ago

              Teaching someone the wrong way to do something frequently makes the right way make way more sense. Someone who just copy/pasted 99 near identical if statements understands on a fundamental level when, why, and where you use a for loop much more than someone who just read in the textbook “a for loop is used to iterate elements in a collection”.

              • I Cast Fist
                link
                fedilink
                31 year ago

                Reminds me of a dude that wrote the equivalent of this in Visualg (a brazilian pseudocode language and program, meant solely for teaching programming)

                if
                  if
                    if
                      if
                        if (x < 10) then
                          print(x)
                        else
                      else
                    else
                  else
                else
                

                That the thing ran and didn’t complain about the amount of loose/needless if’s checking fuck all baffles my mind to this day.

              • @[email protected]
                link
                fedilink
                11 year ago

                And if I know the right way of doing it I already understand why it’s better because I want to use it in this situation. Making the students who already understand the lesson do it the wrong way is just a waste of their time.

  • @[email protected]
    link
    fedilink
    6
    edit-2
    1 year ago

    Hot take, but the main problem with this is that you have to type variables or use them in larger expressions. Otherwise I like it.

    These would make a great mouseover text. I don’t know if there’s any standard way to support that. Actually, how come coding in non-plaintext formats never took off?

    • Einar
      link
      fedilink
      English
      21 year ago

      snake_case_might_be_better_for_that

    • @[email protected]
      link
      fedilink
      51 year ago

      In pretty much any language I’ve used there is some standard for doc comments that would show up as mouseover text in the IDE.

      • @[email protected]
        link
        fedilink
        1
        edit-2
        1 year ago

        I need like a tutorial on IDEs, because clearly I’m using them wrong. Or I tend to work on things that are poorly documented and just haven’t been able to take advantage, I guess that’s possible.

  • Cosmic Cleric
    link
    fedilink
    3
    edit-2
    1 year ago

    I don’t (brain processes the photons bouncing off the object and colliding with the cones and rods in the retina) a problem with this.

    (See what I did there?)

    (I think I met my dad joke quota for the month.)

  • Anna
    link
    fedilink
    21 year ago

    Aah… Like reading a novel. But with a lot of weird punctuation… Or maybe just like a novel then.

  • @[email protected]
    link
    fedilink
    31 year ago

    I’m already annoyed by the end of public static final string that the variable name doesn’t even bother me in these sorts of langauages. All things should be public, static, & final, by default so they aren’t necessary to write. You should only have to write what unsafeties you are opting into.

    • @[email protected]
      link
      fedilink
      41 year ago

      You may enjoy having a look at F#. It says that it’s “functional first”, but I think a better description would be “an opinionated version of C#”.

      For example it doesn’t have a “const”-keyword. Instead it has a “mutable”-keyword, because everything is const by default.

      • @[email protected]
        link
        fedilink
        11 year ago

        Being attached to the CLR isn’t my cup of tea, but I have been learning its older cousin OCaml off & on the last 1½ years

  • @[email protected]
    link
    fedilink
    11 year ago

    When the variable name is the description that should be in the comments.

    Idea: Comments that automattically populate the end of any line a given variable is invoked on, including spelling out formulas from that line. ie: float y=mx+b // (cartesian y value)=(slope)(cartesian x value)+(cartisian y-intercept)

    “Duplicated” coments not actually in the file, but specified witt the creation of such variables and spread around by the code editor /IDE.

    • @[email protected]
      link
      fedilink
      English
      41 year ago

      Then, you could take those comments, and have the compiler use them to ensure you’re using the right variable in the right place. Oh wait, we just invented a type system.

  • @[email protected]
    link
    fedilink
    171 year ago

    Looks ugly until you need to implement something and realize you’ve been blessed with a description of business logic.

    • @[email protected]
      link
      fedilink
      51 year ago

      Until they find out that the way to descriptive variables or functions needs to be extended with new business logic requiring renaming of functions again and again.

      I think maintaining code with this level of verbose naming, will be a pain over time. If they don’t let the naming slip, and then they could as well use cryptic 3 letter names.

    • FlumPHP
      link
      fedilink
      171 year ago

      Strong names are great, but (sometimes) mentioning the type of variable in the name is redundant.

  • @[email protected]
    link
    fedilink
    English
    231 year ago

    I’ll take this over the more “classic” styles, when people seed to believe they were paying the compiler by the character.