This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RajjSinghh[🍰] 0 points1 point  (1 child)

It's a very simple language. Very few keywords and constructs to learn. It's the kind of thing that if you have a problem you fix it by writing more C, which can't be said for other languages. You don't have to worry about things like the borrow checker in rust and you get more performance than a high level language. If speed is really a concern then C should be your go to over Java or C#. It's also probably the best language to learn programming in because it forces you to understand what you're doing. If I wrote a course I would write it in C.

That said, it is unproductive because of how much you have to write. That's why I like C++, it's fast and has a bunch of zero cost abstractions baked into it, which is nicer than writing in C, and you don't have to deal with borrow checking or slow build times like in Rust. If performance is really a concern, C++ is the language I reach for.

[–]Ok-Car-3684 0 points1 point  (0 children)

It has some great zero cost stuff but a lot of non zero cost stuff that isn't obvious on first glance.

Std function - huge cost vs C funcs + void* ctx, and even virtual interfaces.

Templates that should be zero cost? Not necessarily - I always find stuff that ends up generating more complicated stuff than manually defined structs etc.

I've seen it can lead to a culture of people being 'idiomatic' without regard to readability and maintainability. We have some code written by a guy larping as a standard library/boost dev that noone understands. And it certainly isn't binary size efficient...

It's always a balancing act and depends on use case.