Sidechat icon
Join communities on Sidechat Download
Cold take: no, your code will be full of boilerplate or it will be extremely unsafe. Pick one
Hot take: C can be the most readable language if you have good application architecture
upvote 11 downvote

default user profile icon
Anonymous 1w

No much boilerplate if you use it well, and the OP doesn’t argue it’s safe

upvote 6 downvote
default user profile icon
Anonymous replying to -> #1 1w

I'm the original OP. C is just verbose because it's explicit. It's not really "boilerplate". Also safety comes from good design. There are tons of good patterns to choose from. I think people that are so obsessed with C's safety don't know much about input sanitization and designing your own allocators. But yeah, it's not rigourosly verifiable it's safe unless you stick to like MISRA standards.

upvote 5 downvote
default user profile icon
Anonymous replying to -> #2 1w

Solution

post
upvote 2 downvote
default user profile icon
Anonymous replying to -> #2 1w

It's not explicit though. It doesn't make the same guarantees about memory safety that other languages do. You can pass the same pointer in to any function that accepts two pointers and does god knows what with them. To address this, compilers have special attributes you have to apply to arguments to let the compiler know they're supposed to be "distinct", etc. And this is just one example of a whole class of problems that other languages don't have. Don't even get me started on use-after-free

upvote 1 downvote