this post was submitted on 28 Feb 2025
8 points (64.3% liked)

Rust Programming

8521 readers
7 users here now

founded 5 years ago
MODERATORS
 

I came from Java, so it kind of makes sense.

I'm glad the Rust devs thought to allow disabling non-snake_case warnings.

This language is actually really great and versatile. (I also use tabs instead of spaces)

top 13 comments
sorted by: hot top controversial new old
[–] RustyNova@lemmy.world 16 points 1 week ago* (last edited 1 week ago)

Sorry, but we'll have to cargo clippy --fix you

[–] rumschlumpel@feddit.org 6 points 1 week ago (2 children)

(I also use tabs instead of spaces)

Your editor automatically converts tabs into spaces, right?

... right?

[–] commander@lemmings.world 10 points 1 week ago (1 children)

Nope! I make sure set it to tabs only!

[–] rumschlumpel@feddit.org 3 points 1 week ago (1 children)

🔥 burn the heretic 🔥

[–] lnxtx@feddit.nl 2 points 1 week ago

[insert Linus' rant]

[–] 0ops@lemm.ee 3 points 1 week ago

Wait hold up I thought that yours was converting spaces into tabs?

[–] eldavi@lemmy.ml 6 points 1 week ago

java was my first language and now every time i changed contracts from java to something else like python, or ruby, or c++, i still keep using camelcase out of habit and it drives the other devs mad. fortunately, i mostly refactor legacy work so i almost never work on new stuff that would let me use camelcase. lol

[–] kia@lemmy.ca 3 points 1 week ago (2 children)

Tabs > spaces for sure, but camel case is blasphemy.

[–] syklemil@discuss.tchncs.de 4 points 1 week ago (1 children)

I do like the idea of having an intent level character. And once we have that, we don't need AltGr7 etc (curly braces) to denote which level we're at either, the whitespace has all the information we need.

But ultimately I just use whatever is default for the language formatter these days. My own personal preferences on that isn't actually that important, and I find that's a common feeling once someone just works with the default for a while.

[–] Ephera@lemmy.ml 2 points 1 week ago

I feel like the downfall of such an indent-level character is that it's whitespace. If it was somehow visible by default, you'd run into a lot less situations where folks accidentally add spaces-indentation into a tabs-only codebase and it would also help make indentation changes properly visible.

Last week, I had to look at an Ansible codebase (i.e. YAML), where a colleague had introduced a block: statement, where then everything indented below that will have its errors caught. It took me about a minute to understand how the hell this construct works, because I did not see that the deeper indentation had stopped at some point. That's just a waste of time for no good reason.

[–] commander@lemmings.world 1 points 1 week ago

Ahh, one fewer key to hit, mi amigo!

It doesn't look as "computer nerdy" as snake case, but I also prefer the readability of it.

[–] Mechaguana@programming.dev 1 points 1 week ago

I like to program using sarcastic spongebob case. Gives me more time to think, the variables and functions look different to other library methods.

[–] VarosBounska@lemmy.ml 1 points 1 week ago

You like, but you shouldn't: there are conventions we should respect as a community.