RustyNova

@[email protected]

This profile is from a federated server and may be incomplete. View on remote instance

RustyNova ,

To whoever does that, I hope that there is a special place in hell where they force you to do type safe API bindings for a JSON API, and every time you use the wrong type for a value, they cave your skull in.

Sincerely, a frustrated Rust dev

RustyNova ,

Sadly it doesn't fix the bad documentation problem. I often don't care that a field is special and either give a string or number. This is fine.

What is not fine, and which should sentence you to eternal punishment, is to not clearly document it.

Don't you love when you publish a crate, have tested it on thousands of returned objects, only for the first issue be "field is sometimes null/other type?". You really start questioning everything about the API, and sometimes you'd rather parse it as serde::Value and call it a day.

RustyNova ,

You guys have docs?

RustyNova ,

If a item can have different type, those label fields are actually quite useful. So I don't see the problem

RustyNova ,

NGL I 'm a bit like that. I often do "work" commits so that my working tree is a bit more clean/I can go from working state to working state easily.

But before a PR, I always squash it, and most times it's just a single commit

RustyNova ,

I do push often as I'm often switching between two devices. And I do make draft PR so I got an easy git diff that I can live reference with

RustyNova ,

My attempt to explain was squashed by this comment

RustyNova ,

Or as would Dearrow put it: "Explaining the Effects and Treatment of M. Tuberculosis"

Or as I would put it: "Big space cum monster is a threat to earth"

RustyNova ,

Virgin toddler squasher Vs chad adult compressor

RustyNova ,

I think I get it but explain nonetheless?

RustyNova ,

They created it.
The compiler says the jump function is in src/main.rs

RustyNova , (edited )

It's not that bad. It definitely helps in long functions.

I'm an advocate for code commenting itself, but sometimes it's just better to comment on what you're doing, and in those cases it helps to over commentate.

Instead of letting the reader interweave code reading and comment reading, I think it's better to do either. Either you go full self describing code, letting the reader parse it as code,m, or you abstract everything, making it more of an explanation of your reasoning, and abstract lines that may look too complicated.

Not every comment needs to be useful, but I still write them to not have this switch between reasoning and thinking in code.
It can also double as rubber duck debugging too!

RustyNova ,

No one diss the gaming demon summoning circle! Sacrifice him!

RustyNova ,

Same, and I'm trying to fight against it. I've noticed that when coming home I am not just procrastinating, but actually exhausted. Idk if it's due to concentrating all day, or something with me, but I do know that I am tired.

I've started to actually embrace it, and for the time until I get dinner, I just rest. Might sleep even. There's no point in fighting, as I aren't in the mental space to do things.
Then after dinner I'm back to do stuff, maybe even later in the night as I am more rested from my nap.

Although another take on it is that things are lot more enticed to do things when you can't/don't have them.

I am not a doctor, nor claim what I do is healthy, but that's just my experience. If anyone got tips I'm listening

RustyNova , (edited )

ROG spending all the points in style again

... And it's working

RustyNova ,

I don't know and that's the problem :(

I keep asking myself what to choose, only for changing it a day after cursing myself to choose a stupid name.

Big endiant is great for intellisense to quickly browse possibilities, since it groups it all in the same place. But that's also a detriment when you know what you want. You can start typing without the prefix but you'll have to go through the better suggestions of intellisense first.

Little endiant is the same thing, but in reverse. Great when needed, but bad for browsing.

Although I do have some fix I'm starting to use. But it's not applicable everywhere, and not in every language.

What I do is use module as prefix. Instead of dialogue_file_open, I create a file_open in the dialogue module, allowing either directly calling file_open, or dialogue::file_open. Using intellisense on the module allow for easy browsing too!

Although in OP's post I'd rather have file_open_dialogue as it convey the more significant meaning, being to open a file, first. Then "dialogue" is just the flavour on top

RustyNova ,

The worse part, you enter the blog, it looks legitimate enough at a glance, go straight to the code, then find out it's bullshit.

We need ai blog blockers now...

RustyNova ,

Inb4 normies force us to change well established terminology just to appease their fragile souls

Like git's main and master

RustyNova ,

Dang. I didn't knew that 🧡 was so popular. I thought it would be ♥️ but alright

RustyNova , (edited )

While I totally agree with that philosophy, it heavily depends on the language.

For Rust, my philosophy is more like this:

  • Impl + fn body don't count, as well as async blocks if they span the whole function
  • do not nest more than one if statement. You probably better using guard clauses or matches
  • do not put loops into an if statement.
  • do not nest loops unless clearly shown to be (X, Y) indexing
  • method chaining is free
  • do not nest closures, unless the nested closure doesn't have a {} block
  • do not use mod unless it's test for the current module. No I don't want to Star Wars scroll your 1000 line file. Split it.
RustyNova ,

Those async blocks exist when doing async in traits.

And I never said I respected the 4 level of indentations. That's exactly the point of those rules. Keep it lowly indented but still readable

RustyNova ,

It's a lot less readable imo. As well than a cargo fmt later and it's gone (unless there's a nightly setting for it)

RustyNova ,

Use a match? Unless it's for guard clauses, a match is fine enough

RustyNova ,

Oh, then you use and_then() or something similar.

There's also the possibility to use the guard clauses patern and do let <...> = <...> else {}.

And finally, you can always split into another function.

It's not straight rules. It depends on what makes it more readable for your case.

RustyNova ,

I don't know what's the brand neW meta pick, but at least BTRFS over Ext4. BTRFS is just more stable and less corruptable than Ext4. Heck, fedora changed to it as default

RustyNova ,

To be fair, a moron got full control of aperture so...

RustyNova ,

Fuck those that use main. If you're working on a library fork that has main and a project that has master you're bound to invert the two.

"What do you mean I can't checkout main? Oh right, here it's master..."

For once that we had a standard, it had to be ruined.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • kbinchat
  • All magazines