this post was submitted on 26 Feb 2024
169 points (97.2% liked)

Programming

17492 readers
49 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
 

On the one side I really like c and c++ because they’re fun and have great performance; they don’t feel like your fighting the language and let me feel sort of creative in the way I do things(compared with something like Rust or Swift).

On the other hand, when weighing one’s feelings against the common good, I guess it’s not really a contest. Plus I suspect a lot of my annoyance with languages like rust stems from not being as familiar with the paradigm. What do you all think?

(page 3) 34 comments
sorted by: hot top controversial new old
[–] crittecol@lemmy.world 1 points 8 months ago (1 children)

I'm learning c++ via exercism because I'd like to use it for game development and other high performance use cases, and because it's a good pip for the resume.

In fact, I mostly did this because so many job listings mention it, haven't even come up with a high-scale game dev problem to solve.

I'll probably continue because I find it interesting and no amount of practice is bad, but my question is how is everyone letting this affect their outlook on c++ in their career vs side projects, etc. Really, I'm having a hard time imagining why it was important for this to be said in this way instead of just changing internal policies and job listings.

load more comments (1 replies)
[–] xmunk@sh.itjust.works 0 points 9 months ago (10 children)

C++ can have excellent performance without ever using a single pointer and avoiding unsafe functions like gets() - this isn't necessarily a judgment on language - it's a judgement on bad programming habits.

Pointers fucking suck, in a modern C++ codebase everything should be pass by value or const/mutable ref. To my preference I'd rather drop mutable refs to force everything to be more functional but whatever.

[–] calcopiritus@lemmy.world 1 points 9 months ago

A big difference between rust and C++ is that in C++ you say "everyone should passing by value or const ref (mutable ref if needed)".

In rust, the default is passing by value. The default refs are consts, you have to explicitly make them mut, and the compiler will warn you if you don't mutate a mut parameter.

load more comments (9 replies)
[–] Adanisi@lemmy.zip -1 points 9 months ago* (last edited 9 months ago) (14 children)

I'm going to advocate for C here: the sheer simplicity, fast compile times, and power it gives you means it's not a bad language, even after all these years. Couple that with the fact that everything supports it.

Rust, while I don't actually know how to write it, seems much more difficult to learn, slower to compile, and if you want to do anything with memory, you have to fight the compiler.

And memory bugs are only a subset of bugs that can be exploited in a program. Pretending Rust means no more exploitation is stupid.

[–] arisunz@lemmy.blahaj.zone 0 points 9 months ago

Bait used to be believable 🚬

load more comments (13 replies)
[–] dohpaz42@lemmy.world -5 points 9 months ago (9 children)

I’m going to probably be downvoted to Hell, but I disagree wholly that it’s the language’s fault that people can exploit their programs. I’d say it’s experience by the programmer that is at fault, and that’s due to this bootcamp nature of learning programming.

I’d also blame businesses that emphasize quantity over quality, which then gets reflected in academia because schools are teaching to what they believe business wants in a programmer. So they’re just churning out lazy programmers who don’t know any better.

There needs to be an earnest revival of good programming as a whole; regardless of language, but also specifically to language. We also need to stop trying to churn out programmers in the shortest time possible. That’s doing no one any good.

That’s my two cents.

[–] nomadjoanne@lemmy.world -5 points 9 months ago (8 children)

Absolutely. The problem is, most programmers are mediocre. So sadly the protection of stupid people tends to take cultural precedence.

load more comments (8 replies)
load more comments (8 replies)
load more comments
view more: ‹ prev next ›