• BombOmOm@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      3 months ago

      I’m still annoyed with how verbose Objective-C is. Just check out what one has to do to create and concatenate a string. Madness:

          NSString * test = [[NSString alloc] initWithString:@"This is a test string."];
          NSString * test2 = [test stringByAppendingString:@" This value is appended."];
      

      And god forbid you want to concatenate two things to a string:

          NSString * test3 = [test1 stringByAppendingString:[test2 stringByAppendingString:@" Adding a third value."]];
      
  • zaphod@feddit.de
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    ThisCommentsMakeItSoThatYouHateMeForWritingLikeThisSeriouslyICanNotStopPleaseSendHelp

    • JohnEdwa@sopuli.xyz
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      I can read that without any issues whatsoever.

      But. If. You. Put. Periods. Between. Each. Word. My brain will force a pause between every single one and I can’t override it.

        • MostlyBlindGamer@rblind.com
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          3 months ago

          I decided to be wrong because the correct joke would be too convoluted. I’ll work on that implementation and then you can inject it at runtime via reflection.

          • F04118F@feddit.nl
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            Thanks for preparing your comment for my dependency injection! I agree that refactorability of comments is preferable over prematurely optimizing for performance.

            • MostlyBlindGamer@rblind.com
              link
              fedilink
              English
              arrow-up
              0
              ·
              3 months ago

              First it needs to work, then it needs to work well, and finally it may or may not work quickly. Along the way, it should also be humorously weird.

  • Enoril@jlai.lu
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I don’t see the benefit of this long naming convention…

    It still allow bug to exist… like the fact that, with this code, the player can still play with 0 Hp.

    Sould have been better to put a “if(health <= 0)” instead of “< 0”

    • stockRot@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      It sounds like the only concern you have with code is its bugginess, which is short sights. This is unfortunately better documented code than stuff I’ve seen in production. Obviously no one should do this, but let’s not act like there’s no benefit

    • joshfaulkner@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      I asked this question on this post on a different instance, but would there be issues being that the code compares a float to integer zero “0”?

      • BombOmOm@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        3 months ago

        Since the health is a float, yeah, it can create issues. A health of 0.000000001 is greater than zero, but that would almost assuredly be displayed to the user as simply 0, causing player confusion. The easiest solution is to have health and damage always be integers. A less great solution is to use a non-floating point decimal format. If such doesn’t exist in your language, you can emulate one by having health and damage both always be integers, but move the decimal point over, say two points, when displaying to the user.

      • hardkorebob@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        3 months ago

        No regrets. Its shorthand python written in shell and tkinter. Allows me to type up gui apps or any python script with less effort, for my fingers and brain. The blocks of color are just tags with bg and fg same color to look like blocks but its all ASCII. Same as on the right, its an idle clicker toy in tkinter/py. Just me learning more ways to code faster in python but in shell but in neither. I have a repo. https://github.com/dislux-hapfyl/pynksh Dont be put off by ksh because bash also runs it. I have plans to use a Xbox controller to move away from building with the keyboard. I can do this by further abstracting away identifiers and other data we use and combine it into a coordinate system. I already made even further progress into shortening the cognitive load by using a basic row/col like chess as you see there on the left. a00 k12 and so on… take a closer look at my repo without dismissing it quickly. It could be somewhat unnecessary but maybe someone else can see what I have made as useful.

  • CCF_100@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    My ASDV professor has two moods: He either names variables like this post, Or he names variables pp (for pointer pointer)

    • robojeb@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Fuck for some reason pp is giving me flashbacks to having to write using Hungarian notation variable names.