←back to thread

451 points birdculture | 2 comments | | HN request time: 0.002s | source
Show context
GenshoTikamura ◴[] No.43982864[source]
> Stop resisting. That’s the most important lesson

> Accept that learning Rust requires...

> Leave your hubris at home

> Declare defeat

> Resistance is futile. The longer you refuse to learn, the longer you will suffer

> Forget what you think you knew...

Now it finally clicked to me that Orwell's telescreen OS was written in Rust

replies(1): >>43983002 #
atoav ◴[] No.43983002[source]
But it is true. My own biggest mistake when learning Rust was that I tried to torce Object Oriented paradigms on it. That went.. poorly. As soon as I went "fuck it, I just do it like you want" things went smoothly.
replies(2): >>43984144 #>>43987271 #
rikafurude21 ◴[] No.43984144[source]
Sounds like an abusive relationship if im being honest. Your programming language shouldnt constrict you in those ways.
replies(5): >>43984486 #>>43984523 #>>43984615 #>>43984649 #>>43993404 #
jplusequalt ◴[] No.43984523[source]
>Your programming language shouldn't constrict you in those ways

Says who? Programming languages come in all shapes and sizes, and each has their tradeoffs. Rust's tradeoff is that the compiler is very opinionated about what constitutes a valid program. But in turn it provides comparable performance to C/C++ without many of the same bugs/security vulnerabilities.

replies(1): >>43987603 #
1. atoav ◴[] No.43987603{3}[source]
Also: everybody can write a program that does the thing it is intended to do. That is the easy part. The hard part is writing a program that does not do things it isn't intended to do while existing in a ever changing environment and even be subjected to changes of its own source code.

So the hard part isn't getting code to work, it is ensuring it is only working in the intended ways, even when your co-worker (or your future self) acts like an unhinged, unristricted idiot. And that means using enforced type systems, validation, strict rules.

If you are a beginner cobbling hobby programs an anything-goes approach to software may feel nice and like freedom, but beyond a certain level of complexity it will land you in a world of pain.

Any great C programmer whose code I ever had the pleasure of reading has a plethora of unwritten rules they enforce through their heads. And these rules exist there for a reason. When you have a language that enforces these rules for you, that gives you the freedom to dare more, not less, as certain things would be very risky with manual checking.

It is like the foam pit in extreme sports. While it is certainly more manly to break your neck in ten consecutive tripple-backflip tries, you are going to get there faster with a foam pit where you can try out things. And the foam pit transforms the whole scene, becaus people can now write code that before would crash and burn without feeling restricted. Funny how that goes.

replies(1): >>43993395 #
2. freilanzer ◴[] No.43993395[source]
Restrictions foster creativity, and also free up mindspace to think about your actual problem in more detail.