this post was submitted on 03 Oct 2024
40 points (87.0% liked)
Programming
17423 readers
25 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Honestly C is the future. I don't know why people would move from C to any other language. It does the job well enough that there's no reason not to use it.
Think about it. Every modern application depends on a piece of code written in C, not Rust or Zig or any other language (except assembly). It can be used to solve any problem, and works in more places than any other language.
These arguments about "security" and "memory safety" are all pointless anyway in the face of modern code scanning tools. Cross-platform dev can be done trivially with preprocessors. If that's not enough, I don't know what to say. Get better at writing C obviously.
Lifetimes and UB should all be kept in mind at all times. You can explicitly mark lifetimes in your C code if you want using comments. Any index-out-of-bounds bugs, use-after-free, etc are just signs that your team needs more training and better code scanning utils. Write more tests!
Anything more complex than a simple
typedef
is just a sign that you're over-engineering your solution.#include
is both simple, and does exactly what you'd expect any reasonable language to do - paste your referenced code inline. It's genius, and doesn't require any complicated explanations on namespaces and classes and subclasses and so on.So which will be the future? C obviously.
/s
The number of people that genuinely believe this ( I saw the /s) .. Tells me that they haven't written any useful C or C++ code
... or worked in a large team with juniors and members coming and going over a long period of time.
Or worked on a similar team where the C & C++ was mostly written over a decade ago by dudes in another country who loved multi threading, and some of the “new” features were half-completed about 5 years ago, and nothing is documented, and oh yeah not a single person who did any of that still works at the company. Team is made of great people but all have been here for 0-3 years.
The idea of Rust being roughly as fast and low level as C++ but with improvements to memory safety and concurrency sounds heavenly. I know it’s in the back of most of our minds to look into it for the next big project.