• million@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 years ago

    Refactoring is something that should be constantly done in a code base, for every story. As soon as people get scared about changing things the codebase is on the road to being legacy.

    • NoXzema@lemmynsfw.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 years ago

      Been with a lot of codebases that had no unit tests at all and everyone was afraid to change anything because the QA process could take weeks to months.

      The result is you have a codebase that ages like milk.

  • argv_minus_one@beehaw.org
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    Dynamic typing is insane. You have to keep track of the type of absolutely everything, in your head. It’s like the assembly of type systems, except it makes your program slower instead of faster.

    • Cratermaker@discuss.tchncs.de
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      Nothing like trying to make sense of code you come across and all the function parameters have unhelpful names, are not primitive types, and have no type information whatsoever. Then you get to crawl through the entire thing to make sense of it.

  • OADINC@feddit.nl
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    This is the only way;

    if (condition) {
        code
    }
    

    Not

    if (condition)
    {
        code
    }
    

    Also because of my dyslexia I prefer variable & function names like this; ‘File_Acces’ I find it easier to read than ‘fileAcces’

  • MrTallyman@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    My take is that no matter which language you are using, and no matter the field you work in, you will always have something to learn.

    After 4 years of professional development, I rated my knowledge of C++ at 7/10. After 8 years, I rated it 4/10. After 15 years, I can confidently say 6.5/10.

    • whoisearth@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      The JavaScript ecosystem is made worse by the legions of “developers” in it which amount to bro-velopers that put no thought into if something is needed before they create it. There’s a strong overlap between the idiots in crypto and JavaScript developers that needs to be decoupled drastically.

  • IcecreamMelts@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    Microsoft has not made a good product. Ever. Every program has issues that should not be there if you’re selling it. Yet they get away with it

  • AdmiralShat@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 years ago

    If you don’t add comments, even rudimentary ones, or you don’t use a naming convention that accurately describes the variables or the functions, you’re a bad programmer. It doesn’t matter if you know what it does now, just wait until you need to know what it does in 6 months and you have to stop what you’re doing an decipher it.

    • fkn@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      Self documenting code is infinitely more valuable than comments because then code spreads with it’s use, whereas the comments stay behind.

      I got roasted at my company when I first joined because my naming conventions are a little extra. That lasted for about 2 months before people started to see the difference in legibility as the code started to change.

      One of the things I tell my juniors is, “this isn’t the 80s. There isn’t an 80 character line limit. The computer doesn’t benefit from your short variable names. I should be able to read most lines of code as a single non-compound sentence in English with only minor tweaks and the English sentence should be what is happening in most of those lines of code.”

      • MajorHavoc@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        There’s no such thing as self documenting code, unless every method and variable name has the word “because” in it.

        Anyone can read what the code does. The comments are there to answer why it does what it does the way it does.

        Why is invariably lost to time, if it’s not committed to a comment here and there.

        • fkn@lemmy.world
          link
          fedilink
          arrow-up
          0
          arrow-down
          1
          ·
          2 years ago

          This is a pretty ridiculous position to take but if you believe it then I’m glad you write the comments you do.

          There is an argument that commenting on the lack of expected code is valuable for this reason, but it certainly isn’t true in all situations.

  • gpopides@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    Not everything should be beginner friendly. Trying to nerf things because they are not beginner friendly should not be how tools/patterns of languages are designed.

    Its ok to have more advanced topic that require more knowledge and that people don’t understand from the first moment they see them.

  • Kushan@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 years ago

    That the entire industry is cyclical and the current trends are yesterday’s anarcisms. Oop Vs functional, separating concerns Vs vertical slices, there’s examples all over the place.

    All of this has happened before and all of this will happen again.

  • lysdexic@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    Duplicate code can be a code smell, but it’s far better to have the same function definition or code block appear twice in the code than extracting a function that tightly couples two components that should not be coupled at all.

    See Write Everything Twice (WET) principle.

  • Masterkraft0r@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    2 years ago

    As an embedded firmware guy for 10ish years:

    C can die in a fire. It’s “simplicity” hides the emergent complexity by using it as it has nearly no compile time checks for anything and nearly no potential for sensible abstraction. It’s like walking on an infinite tight rope in fog while an earth quake is happening.

    For completely different reasons: The same is true for C++ but to a far lesser extent.

  • lefixxx@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 years ago

    I like 1-index because its what I learned first, and you like 0-index because that’s what you learned first

  • words_number@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 years ago

    JS is horse shit. Instead of trying to improve it or using that high level scripting language as a compilation target (wtf?!), we should deprecate it entirely and put all efforts into web assembly.

  • BrotherL0v3@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    Tools that use a GUI are just as good (if not better) than their CLI equivalents in most cases. There’s a certain kind of dev that just gets a superiority complex about using CLI stuff.

    • bouh@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      Just no. CLI can be automated, which makes it superior. It’s not a superiority complex, it’s a fact. I’m not a minimal wage worker pushing buttons I don’t understand. I’m not a technician who learnt your shitty software to do the most basic tasks.

    • stilgar [he/him] @infosec.pub
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 years ago

      There are some massive intrinsic advantages of the CLI though, that apply for everyone, not just leetcoders:

      • The terminal can remember everything you ever did. Forgotten the command you wrote 2 months ago? You can do a search for it with a tool like fzfand run the exact same command again.
      • Communicating with others. GUI programs require step by step instructions, often accompanied by screenshots while CLI may be copy/pasted.
      • Combining programs together. There are a few different techniques for combining CLI programs to search/format output, use secrets without ever having them in the clipboard or on disk, monitor something frequently/constantly etc etc

      So while I agree with you that there’s plently of elitism around the CLI, you do yourself a disservice if you try to avoid it.