Which do you like better: Rust or C

I’m curious as to how the community feels about Rust. Personally, I love it. It’s fast and safe. It’s faster than C (based on tons of benchmarks I’ve seen), and it’s also safer in terms of concurrency and memory safety. I also think it’s easier to learn compared to C. Does anybody else agree, or have different opinions? I’m kinda curious (as I said).

3 Likes

I’d rather use Rust, although it’s complicated.
Anything but C, C++, C#, and any C variants.

2 Likes

I like C cuz it easily become vulnerable if you’re not careful enough when coding it. and then I can “ethically” make it execute codes when it shouldn’t

jk I like rust bc its much safer, just in exchange, makes it complicated

2 Likes

I know a bit of Rust, since I know Kotlin too.

Java’s way of printing strings is too complicated, and the main class must match the file name:

public class Main {
  public static void main(String[] args) {
    System.out.println("Hello world!");
  }
}

C and C++ rely on libraries way too much:

#include <stdio.h>

int main(void) {
  printf("Hello World\n");
  return 0;
}

Any derivative of C is complicated.

3 Likes

C isn’t even memory-safe, and it’s complicated anyways.

1 Like

Rust is less complicated, memory-safe, and faster. Also, Zig, I’ve tried a bit, it’s faster than C as well, and I’m pretty sure it’s safer.

1 Like

Might sound like a strange opinion, but I write neither. I prefer modern C++. Not the old style of C++ taught in most schools and universities aka C++98. C++17 and those after are better versions to work with in my opinion…

A larger standard library so I don’t need to recode data structures from scratch, etc.

  • There are also smart pointers which use RAII to ensure a resource is “cleaned up” when it falls out of scope. This leads to better memory safety. However, no language can stop a programmer who deliberately tries to do something terrible e.g not validating a user-given SQL command.

Template metaprogramming so I can transform types and make them more flexible.

Even std::print since C++23! No more weird std::cout << foo << ... stuff.

And C++ is still popular for the foreseeable future. It is currently 3rd on the TIOBE ranking of programming languages this year. It is a big, powerful, and successful language haunted by the crusty bits of C. Despite all of its flaws, it has staying power and strives to improve itself. Work on imports and modules began in C++20 as a move away from ugly macros, etc. Overall, I like this language.

2 Likes