Rust, sloppiness, and gatekeeping

Moderator note: split from

Gatekeeping (even that not strictly in bad faith, just implicit) isn't something to promote. We want to encourage people to spend the effort to learn and benefit from Rust, not to put down those who fell short on their first attempt.

15 Likes

This looks like a strawman and projection. Can you please quote which part of the my original quote suggests 'put down those who fell short on their first attempt' ?

By the same logic, 'requiring open source contribution' == 'put down those who quit at the first compiler error'

1 Like

I think "filters out sloppy thinkers" does that. It suggests, to my mind, that if one is a sloppy thinker then one should not even think about using Rust.

I guess what you are trying to say is that "Rust firms up the minds of sloppy thinkers making them precision tools of programming".

Or something like that.

6 Likes

People who try Rust converge into two halves:

  1. those who think rigorously enough to pass the type/borrow checker
  2. those who use a different language

There are people in group 2 who think rigorously, who I highly respect, and who are far better programmers than I ever will be.

Now, if we look at
A = % of Group 1 that are "lazy/sloppy thinkers"
B = % of Group 2 that are "lazy/sloppy thinkers"

I think we would agree that A < B because rustc compiler errors are infuriating for "lazy/sloppy thinker" and drives them out.

To me, this is a good thing. The quality of code on crates.io is higher (say, compared to npm). The technical answers I get tend to be well thought out.

This has nothing to do with 'put down those who fell short on their first attempt'.

2 Likes

...or, to put the onus on the product, rather than the person, that Rust encourages a certain minimum level of considered clarity in code.

So could we say then that:

Rust is exactly the language that sloppy thinkers need. Those poor souls have a hard time keeping in mind all the many and varied ways their programs can misuse memory or suffer from race conditions. Rust's memory safety rules sets them straight every time.

This sloppy thinker finds that a Godsend. I'm sure we are all sloppy thinkers sometimes.

:slight_smile:

16 Likes

I just want to clarify one more thing on this in case it gets misunderstood.

By "lazy/sloppy thinker":

  1. I am NOT referring to the person who writes some Rust code, makes a typo, and gets a compile error.
  2. I am NOT referring to the person who writes some Rust code, gets a compile error, and realizes: oh %*$#, I need to redesign this thing.
  3. I am referring to the response of : F-it, I'll go write it in a different (EDIT: less rigorous) language.

If you are willing to wrestle with the compiler until you win, you are not 'lazy thinker.'
If you get eventually converge to a rigorous solution, you are not a 'sloppy thinker.'

What I'm referring to is, in the end, when the dust has settled, do you have a rigorous + obviously correct solution that the compiler accepts ... or have you run to a less strict language.

4 Likes

The only downside to Rust in that respect is that "F-it, I'll (ab)use unsafe" is a much more dangerous potential that people might choose.

3 Likes

Perhaps that is the case if the developer's alternative language is a mostly memory safe language like C# or Java (although they are worse off in those languages with regard to data races). If their alternative is C or C++, then abusing unsafe is no worse than what they'd end up with anyway. At least with Rust everyone else will be able to audit and/or avoid their code easier.

It depend on perspective.

As someone who came from Python, my perspective is "You expect me to take responsibility for choosing the right dependencies when I came to Rust to get more compile-time guarantees and know just enough C and C++ to know I'm not qualified to audit memory-unsafe code? OK, with a handful of foundational exceptions, I'll choose a subprocess from the side of the APT repositories that Ubuntu borrows from Debian over a crate containing unsafe every time, because I know that's the responsible thing to do in my case".

I personally have "fear" to use the word "unsafe" in my code. I don't feel smart enough to use "unsafe". I imagine if I worked in a shop that did something like coding my boss would grep for the word and question me for using it. Nobody wants to be questioned by the boss, so it is kind of a deterrent?

1 Like

Whether Rust is or isn't for sloppy thinkers is not relevant. I could argue the other way: Rust is the best language for lazy/sloppy thinkers! In languages like C upholding of safety invariants is all programmer's responsibility, so programmers have to be diligent and vigilant. OTOH with Rust, programmers can afford to let their guard down, lazily write sloppy code, and rely on the compiler to ensure it's safe.

But either way, classifying programmers like that is a version of the "Real Programmer" rhetoric, which does put people down and puts blame on the programmer, rather than the language (sometimes that's true, but generalizations of such statements are unhelpful).

29 Likes

Exactly.

As I said "Rust is exactly the language that sloppy thinkers need.". And, we are all sloppy thinkers at some time. Which must be true else programs would never have bugs, especially when written by the best of programmers. But they do have bugs.

4 Likes

As a Rust programmer who's been using Rust for a few years now, I can say, without a doubt -- no, indubitably -- that Rust has made me a far better programmer. I can read C code and think about whether its safe in the context of what I know about what the Rust compiler might say if it looked at the code I was reading. The ironic thing about my transition to Rust is that its actually harder for me to write C/C++ properly now because I feel like its almost... Alien if you will. When I write the code, I think a lot about its safety and correctness and I'm always looking for ways I can make it better. If there is any language that shows you the major flaws in languages like C/C++, it is undoubtedly Rust. Sometimes I go back and look at old code and I wonder "What the hell was I thinking?".
So yes, I can definitely see how Rust would melt the brain of a programmer coming from C/C++ when they don't know the underlying concepts behind it all that well or are used to programming in C/C++. Rust forces you to be a better programmer, without exception. It rains on your parade and can definitely make someone look stupid/arrogant (you know, that "I'll just write this code and it'll work on the first try, they compile it and Rust wines because they did something wrong" kind of mindset that we all get once and a while).
Hope I didn't go off-topic or derail this one.

4 Likes

I still do this with pretty much everything I've ever written...

2 Likes

Not just sloppy thinkers. I need Rust because I'm a sleepy thinker.

8 Likes

Yes, and far too hot. My brain does not work at elevated temperatures. But must keep going, must keep going... deadline coming... must keep going...

Rust compiler - BAM! another borrow checker error.

OK, rustc, you win. It really is time for me to take time out. Wait for the cool of night. If that ever comes.

1 Like

I think we have different definitions of "lazy/sloppy thinker"

Consider someone who regularly formalizes math proofs in Lean / Coq. Can they be a "lazy/sloppy thinker"?

In my definition, no. Anyone that daily battles Lean / Coq to submission is thinking very rigorously and clearly.

If I understand your / @ZiCog's definitions correctly, under your definition, yes -- in fact Lean / Coq is great for lazy/sloppy thinkers because one can be lazy/sloppy, and the compiler will catch all the errors.

If we replace Lean/Coq with rustc, this seems to be the two sides of the argument.

I don't think either of us will convince the other of the "correct" definition, but it seems our disagreement stems from having different axioms / definitions.

It's not about the definition of what a sloppy thinker is (I unnecessarily argued about this in my previous comment).

It's about promoting a generalization that divides programmers into those who are and aren't good enough for a programming language.

Rust doesn't want to tell people they aren't good enough for it. It's fine that Rust isn't appropriate for every use case. It's fine that Rust isn't interesting or worth learning for everyone. But it's not fair to label people with derogative terms when they haven't managed to please the borrow checker.

Even if you go by a definition that makes "sloppy thinker won't pass the borrow checker" 100% true, it's still not a great thing to say. People often misunderstand negation of p=>q statements, and could think "I can't make the borrow checker happy, therefore I'm a sloppy thinker", and we don't want to people to think that. People more often get stuck because Rust is different from other languages, and has a steeper learning curve. Not everyone invests enough energy into learning it, and there are many rational reasons for it that aren't caused by someone's way of thinking.

16 Likes

I think we are on the same page. Perhaps looking at it from a different perspective.

I take my understanding of "sloppy thinking" from the definitions of "sloppy":

messy or lacking care or attention

careless and unsystematic; excessively casual.

As in: "careless", "slapdash", "slipshod", "lackadaisical", "disorganized" etc.

The sloppy thinker does not ensure his assumptions are true, does not take the trouble to think things through to their ultimate conclusion.

Rust of course won't let one get away with any of that when it comes down to memory use safety.

1 Like