5C5C5C

joined 2 years ago
[–] 5C5C5C@programming.dev 34 points 5 days ago (7 children)

Honestly yes. If I need to manipulate the filesystem or manage processes with any amount of conditional logic or looping, I'd much rather do it with Rust than shell scripts.

The only thing I use shell scripts for anymore is completely trivial sequences of commands.

[–] 5C5C5C@programming.dev 13 points 6 days ago* (last edited 6 days ago) (1 children)

It's much easier to fight when you don't care about what kind of damage it'll do.

I'm not saying this to defend the Democrats, just to point out that Republicans have a massive natural advantage on this stage. I don't think their success comes as much from competence as it does from being naturally aligned with doing harm.

[–] 5C5C5C@programming.dev 9 points 1 week ago (1 children)

Something about the language promotes writing it using these kinds of idioms.

As someone who has used Rust professionally for 3 years, the idioms are good. I wouldn't want the idioms to go away, and I don't particularly want the style/aesthetics of the language to change unless it can be done without negatively affecting the idioms.

It's not a situation where the aesthetics are actually bad, it's just different than what most programmers are used to, but almost all of the differences are for pretty good reasons. With enough familiarity and practice you'll start to recognize those differences as benefits of the language rather than detriments.

But I think a lot of people have so much inertia about tweaking their way of thinking that they don't feel motivated to try long enough to make it over that hump, especially when their expectations get set by rabid Rust promoters like myself who insist that Rust is vastly superior to any other languages in almost all situations. The stark contrast between how good they're told the language is and how they feel when first exposed to it might be too much whiplash for some people.

[–] 5C5C5C@programming.dev 13 points 1 week ago

This is the most sober take in this thread. I was bothered by all these things you mentioned for the first two weeks of using the language. I begrudgingly accepted them for the following two months because I felt the benefits of the language were worth it. Now all of these things feel natural and I don't give them a second thought.

[–] 5C5C5C@programming.dev 9 points 1 week ago (1 children)

I get it there are people who want to play around and have language/compiler babysit them, but there are also people like me who want to see exactly what something is.

This is a false dichotomy when it comes to Rust. Despite everything I said and despite Lucy's complaint, there is nothing that actually stops someone from explicitly annotating the exact type when declaring a variable. It's just not required by the language, and most developers eventually realize that it's not actually useful.

You're right that these preferences are subjective, be although much of that subjectivity has more to do with how our past experiences have shaped what we're familiar with, rather than any intrinsic characteristics of person. By that I mean, someone who uses Rust enough will most likely come to like the way the general community styles its code, sooner or later. In the meantime you're welcome to do things in a way that suits your needs.

The only thing that Rust's type system is weak on is runtime reflection. There are ways to achieve it within Rust's type system, but it's considerably more work than what you get in Python and JavaScript. Imo the only reason to choose a language other than Rust for a greenfield project is if you have a strong need for runtime reflection all over the place and aren't very concerned about performance, threading, or avoiding entire categories of bugs that the Rust compiler protects you from.

[–] 5C5C5C@programming.dev 16 points 1 week ago

It's incredibly disingenuous to call this average Rust code and further erodes your credibility. I may as well point to hundreds of lines of preprocessor macros in a C++ header and call it average C++ code.

This is not what an average Rust developer is writing 99% of the time. If someone on my team submitted a PR with an implementation of sum that uses macro_rules! I would almost certainly reject it.

[–] 5C5C5C@programming.dev 17 points 1 week ago (12 children)

Types are not implicit, they're inferred by the compiler when there is no ambiguity about what the type needs to be. This is a huge benefit for refactoring code and reducing maintenance. I acknowledge that sometimes you might care to know the exact type of the variable, and sometimes that's not as easy for a human to infer as it is for the compiler, but every decent IDE will provide inline type hints for you. Interpreting code by reading it in plaintext is an exercise in masochism.

Python is actually the opposite on this, and it's one of Python's worst characteristics. The type is unknown until runtime unless you annotate it, and then the annotation isn't really enforced. It's the worst of every dimension.

C++11 introduced auto, and now the community is split between "almost always auto" and "never auto".

JavaScript needed a whole new compiled language (Typescript) to fix its type system problems, and Typescript is only an incremental improvement at best.

Rust has the best type system of any modern language by far. If you're tripped up by not always seeing the type declarations then you're either focusing on the wrong details in the code or you just need a little more practice. The key thing that needs to sink in for new Rust users is that the compiler is always providing safety rails. That means it's no longer your job to verify that every aspect of the code is correct. You can relax a little and actually have something akin to duck typing without all the pitfalls that usually come with it.

[–] 5C5C5C@programming.dev 11 points 1 week ago

It's hilarious to me that people talk about "ugly" as if their opinions are objective.

I found Rust unpleasant to look at for the first two weeks of learning it, and now that I've been using it professionally for three years I loathe when I need to read code in other languages.

No other language can rival Rust in showing the exact information needed to understand the code


never too much and never too little


while being concise, correct, and handling all edge cases.

You can be more concise in other languages, but it will come the loss of handling every little possible bug. You can be prettier in other languages, but it will come at the price of adding a lot of useless boilerplate.

Of course there are cases where Rust can be verbose or confusing, but that's when you're doing very esoteric things that would be just as confusing in other languages.

Like any opinion on aesthetics, how someone feels about the prettiness of a language will have far more to do with familiarity than with any objective metrics.

[–] 5C5C5C@programming.dev -2 points 1 week ago (17 children)

Being unable to give an actual example proves you're just a foaming-mouth hater with nothing to contribute.

[–] 5C5C5C@programming.dev 69 points 1 month ago (7 children)

I imagine this should count as illegal stock market manipulation, but the government would be too toothless to prosecute it.

[–] 5C5C5C@programming.dev 5 points 2 months ago (1 children)

Or would the band name be "Actual Dragons"?

[–] 5C5C5C@programming.dev 5 points 2 months ago

*Laughs in Calculus of Variations*

view more: next ›