this post was submitted on 02 Sep 2024
882 points (99.2% liked)

Programmer Humor

32031 readers
1624 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

Incase it doesn't show up:

you are viewing a single comment's thread
view the rest of the comments
[–] CptBread@lemmy.world 14 points 2 weeks ago* (last edited 2 weeks ago) (6 children)

I'm a gameplay programmer who have worked with Unity and Unreal and I've experiment with Rust for gamedev(though only for hobby projects) and for regular code. My conclusions so far is that Rust sucks for gameplay code, for most other things it's kinda nice.

The biggest reason is that it's much harder to write prototype code to test out an idea to see if it's feasible and feels/looks good enough. I don't want to be forced to fully plan out my code and deal with borrowing issues before I even have an idea of if this is a good path or not.

I would say though that because you are using ECS stuff it is at least plausible to do in Rust but at least for my coding/development style it still isn't a good fit.

[–] rhombus@sh.itjust.works 3 points 2 weeks ago (4 children)

The biggest reason is that it's much harder to write prototype code to test out an idea to see if it's feasible and feels/looks good enough. I don't want to be forced to fully plan out my code and deal with borrowing issues before I even have an idea of if this is a good path or not.

There are options for this with Rust. If you wanted to use pure Rust you could always use unsafe to do prototyping and then come back and refactor if you like it. Alternatively you could write bindings for C/C++ and do prototyping that way.

Though, I will say that this process gets easier as you gain more experience with Rust memory management.

[–] CameronDev@programming.dev 3 points 2 weeks ago (1 children)

Unsafe doesn't let you just ignore the borrow checker, which is what generally tripped me up when learning to write rust.

[–] rhombus@sh.itjust.works 3 points 2 weeks ago

That’s fair, I honestly haven’t used it in a while and forgot the real usage of unsafe code. As I said to another comment, it is a really rough language for game dev as it necessitates very different patterns from other languages. Definitely better to learn game dev itself pretty well first in something like C++, then to learn Rust separately before trying game dev in Rust.

load more comments (2 replies)
load more comments (3 replies)