3 ms·
I've been surprised and delighted by C recently myself; Being able to make a small change to a datatype, variable name, and so on, and then instantly seeing an
by Uptrenda 7y ago
I've been surprised and delighted by C recently myself; Being able to make a small change to a datatype, variable name, and so on, and then instantly seeing an IDE highlight errors relating to it is amazing for productivity. The language is incredibly simple. I mostly use structures to define my own 'types' and design functions to work on pointers to those types. That way you can control whether you want your data to live on the stack or heap and its fairly robust. I've rarely if ever had to use function pointers or macros, but they're there if you need more advanced features. I find just being able to manipulate memory and buffers as raw bytes with no bullshit wrappers helps you so much with actual programming (TM.)
As far as data types go, I haven't used much more than linked lists and basic hash maps so far. For everything else I use fixed-sized arrays. It helps you precisely control how much memory the program is using without worrying that some higher-level magic garbage collector will overflow. Despite having that level of control, I haven't been frustrated by it yet. Yes, the standard library is very basic, but you can add the types you need very easily. There's some beautiful C code out there that will give you exactly what you want without having to include hundreds of obscure futures you'll never need. Overall, I've been very happy with it, and I look forwards to trying to run my code on all kinds of weird and wonderful platforms. I see huge competitive benefits for C code bases, to be honest.