• argv_minus_one@beehaw.org
    link
    fedilink
    arrow-up
    4
    ·
    10 months 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
      ·
      10 months 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.

  • AdmiralShat@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    10 months 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.

      • Carol2852@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        Sure try to replace the one or two people that hold the whole team together. I’ve seen it a couple times, a good team disintegrates right after one or two key people leave.

        Also, if you replace half the team, prepare for some major learning time whenever the next change is being made. Or after the next deployment. 🤷‍♂️

  • million@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months 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.

      • FlumPHP@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        Today I removed code from a codebase that was added in 2021 and never ever used. Sadly, some people are as content to litter in their repo as they are in the woods.

  • asyncrosaurus@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    SPAs are mostly garbage, and the internet has been irreparably damaged by lazy devs chasing trends just to building simple sites with overly complicated fe frameworks.

    90% of the internet actually should just be rendered server side with a bit of js for interactivity. JQuery was fine at the time, Javascript is better now and Alpinejs is actually awesome. Nowadays, REST w/HTMX and HATEOAS is the most productive, painless and enjoyable web development can get. Minimal dependencies, tiny file sizes, fast and simple.

    Unless your web site needs to work offline (it probably doesn’t), or it has to manage client state for dozen/hundreds of data points (e.g. Google Maps), you don’t need a SPA. If your site only needs to track minimal state, just use a good SSR web framework (Rails, asp.net, Django, whatever).

  • bidenicecream [none/use name]@hexbear.net
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    10 months ago

    Computer hardware has been getting faster and faster for decades at this point, but my computer still slows down. Like WTF. The dumbass programmers take the extra power given to them and squander it instead of optimizing their code. Microsoft word could run pretty well on a windows 98 PC, but the new Word can slow down PCs that are 5-10 years old. Programmers are complete idiots sometimes…

  • BrotherL0v3@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 months 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.

  • words_number@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    10 months 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.

    • Alien Nathan Edward@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      10 months ago

      Idk anything about web assembly but I 100% agree that JS is absurd and feels like it was created in a weekend by some schmuck who just wanted to be able to edit html on the fly because it was.

  • phoenixz@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    10 months ago

    Go with what works

    Error messages should contain the information that caused the error. Your average Microsoft error “error 37253” is worthless to me

    Keep functions or methods short. Anything longer than 20 - 50 lines is likely too long

    Comment why is happening, not what

    PHP is actually a really nice language to work with both for web and command line utils

    Don’t over engineer, KISS. Keep It Simple Stupid

    SOLID is quite okay but sometimes there are solid reasons to break those rules

    MVC is a PITA in practice, avoid it when possible

    • r1veRRR@feddit.de
      link
      fedilink
      arrow-up
      0
      ·
      10 months ago

      PHP the language has become pretty nice, but I recently had to work with a PHP CMS deployment, and it was an absolute pain to do. PHP frameworks seem to still exist in a world where you manually upload code to a manually configured server running apache. Dockerizing the CMS (uses Symfony) is/was an absolute pain.

      • phoenixz@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        I know that there are loads of solutions out there that can do this for you, though I don’t have much experience with it myself directly. Not a great fan of docker, still, as it’s not a requirement and in many cases that extra piece that fails and then is a PITA to fix.

        I’ll look to include it in my own framework, though

    • Omgpwnies@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      edit-2
      10 months ago

      Your average Microsoft error “error 37253” is worthless to me

      This is a security thing. A descriptive error message is useful for troubleshooting, but an error message that is useful enough can also give away information about architecture (especially if the application uses remote resources). Instead, provide an error code and have the user contact support to look up what the error means, and support can walk the user through troubleshooting without revealing architecture info.

      Another reason can be i18n/l10n: Instead of keeping translations for thousands of error messages, you just need to translate “An Error Has Occurred: {errnum}”

      • BatmanAoD@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        10 months ago

        Those benefits both make sense, but are those really the original motivation for Microsoft designing the Blue Screen of Death this way? They sound more like retroactive justifications, especially since BSODs were around well before security and internationalization were common concerns.

        • phoenixz@lemmy.ca
          link
          fedilink
          arrow-up
          1
          ·
          10 months ago

          Linux has something similar, kernel panics. However, with Linux you get useful information dumped on your screen.

          Nothing gets logged on Linux either, just like windows and that makes sense. The kernel itself messed up and can’t trust its own memory anymore. Writing to disk may cause you to fuck up your disk, so you simply stop everything.

          Still though, Linux dumps useful info whereas windows just gives you this dumb useless code.

    • jvisick@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      Mostly agree. I’m ok with single characters in a one line / single expression lambda, but that’s the only time I’m ok with it.

  • fubo@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    10 months ago

    Until you know a few very different languages, you don’t know what a good language is, so just relax on having opinions about which languages are better. You don’t need those opinions. They just get in your way.

    Don’t even worry about what your first language is. The CS snobs used to say BASIC causes brain damage and that us '80s microcomputer kids were permanently ruined … but that was wrong. JavaScript is fine, C# is fine … as long as you don’t stop there.

    (One of my first programming languages after BASIC was ZZT-OOP, the scripting language for Tim Sweeney’s first published game, back when Epic Games was called Potomac Computer Systems. It doesn’t have numbers. If you want to count something, you can move objects around on the game board to count it. If ZZT-OOP doesn’t cause brain damage, no language will.)


    Please don’t say the new language you’re being asked to learn is “unintuitive”. That’s just a rude word for “not yet familiar to me”. So what if the first language you used required curly braces, and the next one you learn doesn’t? So what if type inference means that you don’t have to write int on your ints? You’ll get used to it.

    You learned how to use curly braces, and you’ll learn how to use something else too. You’re smart. You can cope with indentation rules or significant capitalization or funny punctuation. The idea that some features are “unintuitive” rather than merely temporarily unfamiliar is just getting in your way.

    • Walnut356@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      10 months ago

      Please don’t say the new language you’re being asked to learn is “unintuitive”. That’s just a rude word for “not yet familiar to me”…The idea that some features are “unintuitive” rather than merely temporarily unfamiliar is just getting in your way.

      Well i mean… that’s kinda what “unintuitive” means. Intuitive, i.e. natural/obvious/without effort. Having to gain familiarity sorta literally means it’s not that, thus unintuitive.

      I dont disagree with your sentiment, but these people are using the correct term. For example, python len(object) instead of obj.len() trips me up to this day because 99% of the time i think [thing] -> [action], and most language constructs encourage that. If I still regularly type an object name, and then have to scroll the cursor back over and type “len(”, i cant possibly be using my intuition. It’s not the language’s “fault” - because it’s not really “wrong” - but it is unintuitive.

      • fubo@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        10 months ago

        If you only know C and you’re looking at Python, the absence of curly braces on code blocks is temporarily unfamiliar to you.

        But if you only know Python and you’re looking at C, the fact that indentation doesn’t matter is temporarily unfamiliar to you.

        Once you learn the new language, it’s not unfamiliar to you anymore.

        “Unintuitive” often suggests that there’s something wrong with the language in a global sense, just because it doesn’t look like the last one you used — as if the choice to use (or not use) curly braces is natural and anything else is willfully perverse on the part of the language designer.