Hi! I hope all is well. I am loving this instance and all the communities so far! As I am a new grad software engineer who is gonna start working in the next month, I was wondering if there are some tips, advice and some nuggets of wisdom you want to pass to this clueless person making this post lmao.

  • kiku123@feddit.de
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 year ago

    Make your code as simple and brainless as possible.

    The vast majority of time spent working with code will be debugging or reading other people’s code, so if you write something incredibly clever, you’re just making the next person’s job (who could be you in 6 months) harder.

        • HamsterRage@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          Har!

          On a serious note, it’s not about remembering the code as much as it is about how much you learn and change over time. If you’re progressing as a programmer, then you’re going to be constantly humbled every time you look at your old code.

          I don’t know how many times I’ve opened up a program and thought, “What idiot wrote this shit? Oh…it was me.”. And then you realize that your probably gonna think the same thing about the code you wrote yesterday in another 6 months.

          So the least you can do today is to take the time to learn and follow the basics of “clean” coding. That way, your shit code will at least easy (easier, easyish maybe) to follow.

          • msage@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            Since we’re serious now, I remember my code all too well, even stuff I’ve written 15 years ago. Specially my thinking process behind the structure of the project.

            Throughout the years I learned to always solve everything in the most simple and direct way possible. That way no one should guess what was the intention behind it. And if the code isn’t obvious to the beginner, it gets comments with explanation on why is it necessary.

            I had a colleague who knew too much about Perl, and enjoyed the most ridiculous and convoluted shorthands possible. And he was a team lead. It was not fun explaining every time that almost no one else is going to be able to read that, and he pushed it regardless.

    • epyon22@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      To add to this is it’s harder to read code than it is to write so write simple code so that when you come back to it you can understand.

    • Barns@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      so so true… I would highlight that simple & brainless is almost never short or concise. Put it another way - If just condensed 5 lines of code into one without fundamentally changing the way it works, well just ended up with a single line with a complexity of 5…

      and yes, I’m looking at you Scala devs, with 20 functions chained in one row 👀