[-] FizzyOrange@programming.dev 16 points 5 months ago

Yeah I think the reputation was probably deserved early in Rust's life, but as time has gone on it has gotten a lot easier to write, especially with the non-lexical lifetimes update 3 years ago.

[-] FizzyOrange@programming.dev 16 points 8 months ago

OPAM (OCaml's package manager) had a bug where it couldn't find curl or wget to download stuff with (don't ask me why it shelled out to those in the first place) if you were in more than 32 Unix groups. Have fun thinking of a reasonable explanation for that!

[-] FizzyOrange@programming.dev 16 points 8 months ago

Yeah it's great for little scripts. There's even a cargo script feature that's being worked on so you can compile & run them using a shebang.

I'd use a shell script if it is literally just a list of commands with no control logic or piping. Anything more than that and you're pointing a loaded gun at your face, and should switch to a proper language, of which Rust is a great choice.

[-] FizzyOrange@programming.dev 16 points 1 year ago* (last edited 1 year ago)

Presumably because Forgejo didn't have CI support until extremely recently. And because Jenkins is trash.

[-] FizzyOrange@programming.dev 16 points 2 years ago

Yep, whenever they fix a bug it's added in a new flag that nobody knows about.

git --enable-sane-behaviour
[-] FizzyOrange@programming.dev 16 points 2 years ago

Very good points. A codebase that gets this VERY wrong is Gitlab. I think it might be a dumb characteristic of Ruby programs, but they generate identifiers all over the place. I once had to literally give up following some code because I could not find what it was calling anywhere. Insanity.

Another point: don't use - in names. Eventually you'll have to write them down in a programming language, at which point you have to change the name. CSS made this mistake. foo-bar in CSS maps to fooBar in Javascript. Rust also made this mistake with crate names. A crate called foo-bar magically becomes foo_bar in Rust code.

[-] FizzyOrange@programming.dev 16 points 2 years ago

Where's the code that doesn't quote this properly? I'm guessing it's Bash.

[-] FizzyOrange@programming.dev 16 points 2 years ago

The secret is just to do it anyway. I have yet to work in a job where anyone actively stopped me fixing technical debt, even if they never asked me to do it.

[-] FizzyOrange@programming.dev 16 points 2 years ago

Its definitely best to try and avoid raw pointers, but even if you try really hard I found it's not really possible to get a Rust-like experience with no UB.

Even something as simple as std::optional - you can easily forget to check it has a value and then boom, UB.

The C++ committee still have the attitude that programmers are capable of avoiding UB if they simply document it, and therefore they can omit all sanity checks. std::optional could easily have thrown an exception rather than UB but they think programmers are perfect and will never make that mistake. There are similar wild decisions with more recent features like coroutines.

They somehow haven't even learnt the very old lesson "safe by default".

If I wanted memory unsafety I think I would consider Zig instead of C++ at this point.

[-] FizzyOrange@programming.dev 16 points 2 years ago

Yeah I kind of agree but I also think when it gets to that point we'll have much bigger problems than programmers losing their jobs. Like, most of society losing their jobs.

[-] FizzyOrange@programming.dev 16 points 2 years ago

Yeah I think it's trauma due to C/C++'s awful warning system, where you need a gazillion warnings for all the flaws in the language but because there are a gazillion of them and some are quite noisy and false positives prone, it's extremely common to ignore them. Even worse, even the deadly no-brainer ones (e.g. not returning something from a function that says it will) tend to be off by default, which means it is common to release code that triggers some warnings.

Finally C/C++ doesn't have a good packaging story so you'll pretty much always see warnings from third party code in your compilations, leading you to ignore warnings even more.

Based on that, it's very easy to see why the Go people said "no warnings!". An unused variable should definitely be at least a warning so they have no choice but to make it an error.

I think Rust has proven that it was the wrong decision though. When you have proper packaging support (as Go does), it's trivial to suppress warnings in third party code, and so people don't ignore warnings. Also it's a modern language so you don't need to warn for the mistakes the language made (like case fall through, octal literals) because hopefully you didn't make any (or at least as many).

[-] FizzyOrange@programming.dev 16 points 2 years ago

Are there any videos of this sort of editing, because honestly every single person I've watched use Vim has just been like "oh wait that's the wrong thing.. hold on." constantly. You're going to say "they aren't competent" but that's kind of the point - approximately nobody is competent in Vim because it isn't worth learning.

Even so, I'd be interested if there are any videos of pros doing real editing (not "look what I can do") on YouTube. Anyone know of any?

view more: ‹ prev next ›

FizzyOrange

0 post score
0 comment score
joined 2 years ago