• Bogus007@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    12 days ago

    Thank you for your explanation and I understand it well, as well the advantage to find bugs quicker (which however does not mean that a safe code cannot be also a bad code). However, I do think that writing safe code without being guided by a compiler is indeed a skill. And the question how safe the code written with the help of the compiler will be is another interesting one. Perhaps we will find out in the future.

    In my opinion, Rust is a language dictated by the compiler rather than one that allows you to use your brain, knowledge, and skills to deepen your understanding. Rust is essentially a programming language with training wheels. Unfortunately, the preference to finish tasks quickly is nowadays the mainstream. The understanding of the deeper stuff falls behind.

    A related example from real life: bike tyres that have a flat. Less and less people can change the tyres on their own, and even do not understand the construction and characteristics of different tyres, only believing what the vendor in the shop is telling them. Bad surprises then happen.

    • Flipper@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      12 days ago

      Yes, writing safe code is a skill. But for most skills you need someone to teach you. My suggestion is, think about it differently:

      The compiler isn’t training wheels, but rather a senior dev, that quickly looks over your shoulder and tells you, hey you might have missed something here. You can at any point tell them, trust me bro for this part. They need at some points a comment in the form of lifetime annotations. They are pretty good, but not perfect.

      To pick up your example. They don’t tell you, you need a new wheel. They tell you, you’re bike has disc brakes, but your new wheel is missing the disk. When you later hit a wall, because you couldn’t break, you can check where you just said trust me.

      • Bogus007@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        12 days ago

        @Flipper, if you just learn from one master, you cannot become a master in the field. As I said above: relying heavily on the compiler, even when this may be the best „teacher“, does not make you - I do not speak about you personally, but you in general, so all programmers - a good programmer. This is my major critic about Rust, while I do also understand its advantages.