Nixers Advent of Code Leaderboard - Community & Forums Related Discussions

Users browsing this thread: 2 Guest(s)
movq
Long time nixers
Well, my goal was to learn more about Rust, but so far, there’s mainly one thing I’ve learned: Rust is not the best tool for simple programs like the AoC. :-)

The reason is that Rust doesn’t have exceptions.

I actually like this about Rust, because it means there are no (or at least fewer) surprises during runtime. For example, consider getting the minimum element of a vector/list. This function is undefined if the vector is empty, so it returns an “Option”, meaning it can fail. To be completely honest, I hadn’t considered this case when I wrote my code. It’s obvious in hindsight, but I really just wanted to get the minimum element and be done with it. You often don’t think about these corner cases, if we’re being honest. Maybe you use an IDE that warns you about uncaught exceptions (which isn’t even possible for all languages). Still, in general, it’s tempting to ignore exceptions or just let them bubble up. Everybody knows that you shouldn’t do that, but well. So, Rust makes it harder for you to be lazy, you’re pretty much forced to deal with these error cases in some way.

But for a tiny 20-line program, this just adds a ton of noise to your code without any real benefit.

So I guess unless the AoC programs need to be longer, I’ll be switching to Python for now.


Messages In This Thread
Nixers Advent of Code Leaderboard - by seninha - 05-12-2020, 12:14 PM
RE: Nixers Advent of Code Leaderbord - by s0kx - 06-12-2020, 11:29 AM
RE: Nixers Advent of Code Leaderbord - by seninha - 06-12-2020, 06:09 PM
RE: Nixers Advent of Code Leaderbord - by eye - 07-12-2020, 07:08 AM
RE: Nixers Advent of Code Leaderbord - by eye - 07-12-2020, 07:09 AM
RE: Nixers Advent of Code Leaderbord - by s0kx - 07-12-2020, 08:48 AM
RE: Nixers Advent of Code Leaderbord - by s0kx - 07-12-2020, 12:26 PM
RE: Nixers Advent of Code Leaderbord - by eye - 08-12-2020, 04:11 AM
RE: Nixers Advent of Code Leaderbord - by s0kx - 08-12-2020, 04:37 PM
RE: Nixers Advent of Code Leaderbord - by eye - 09-12-2020, 07:31 PM
RE: Nixers Advent of Code Leaderbord - by venam - 30-11-2021, 03:10 AM
RE: Nixers Advent of Code Leaderboard - by ols - 01-12-2021, 08:22 AM
RE: Nixers Advent of Code Leaderboard - by movq - 01-12-2021, 11:54 AM
RE: Nixers Advent of Code Leaderboard - by movq - 01-12-2021, 05:30 PM
RE: Nixers Advent of Code Leaderboard - by Dworin - 03-12-2021, 10:00 AM
RE: Nixers Advent of Code Leaderboard - by movq - 05-12-2021, 05:54 AM
RE: Nixers Advent of Code Leaderboard - by venam - 05-12-2021, 06:11 AM
RE: Nixers Advent of Code Leaderboard - by Dworin - 05-12-2021, 08:03 AM
RE: Nixers Advent of Code Leaderboard - by movq - 06-12-2021, 06:09 PM
RE: Nixers Advent of Code Leaderboard - by venam - 07-12-2021, 02:44 AM
RE: Nixers Advent of Code Leaderboard - by Dworin - 07-12-2021, 04:58 AM
RE: Nixers Advent of Code Leaderboard - by movq - 08-12-2021, 03:07 PM
RE: Nixers Advent of Code Leaderboard - by movq - 11-12-2021, 04:55 AM
RE: Nixers Advent of Code Leaderboard - by venam - 11-12-2021, 06:43 AM
RE: Nixers Advent of Code Leaderboard - by movq - 16-12-2021, 12:26 PM