3 ms·
It's more unfortunate a proper RPC library is not being used. People rolling their own buggy parsers in C is an endless source of bugs.
by charcircuit 2y ago
It's more unfortunate a proper RPC library is not being used. People rolling their own buggy parsers in C is an endless source of bugs.
- timcobb 2y ago> People rolling their own buggy parsers in C I'd like to believe this isn't common anymore for new projects?
- worthless-trash 2y agoI dont want to ruin your weekend.
- ahoka 2y agoThe whole code is horrible: https://github.com/Atoptool/atop/commit/542b7f7ac52926ca272129dba81d7db80279bb98 https://github.com/Atoptool/atop/commit/542b7f7ac52926ca2721... Inconsistent usage of braces, no clear memory ownership or life-cycles, zero tests.
- the-lazy-guy 2y agoCan you please provide an example of good C code? I agree that absence of tests isn't great, and is very common with many C-based projects. But the rest of your comments reads like "ooh, it's C, disgusting!". I hope, I'm wrong.
- woodruffw 2y agosqlite3 is the canonical example of a mature, well-structured, excellently tested C codebase. I would also submit cURL/libcURL as a strong example.
- the-lazy-guy 2y agoThank you. These 2 are well-known, as well as plenty others. But I wanted to see answer from the author of the comment to which I replied. Apart from tests (of which both sqlite and curl have plenty, and that is obviously good), I don't see any reasonable difference in sqlite or curl code in aspects which were mentioned in their comment (namely, style and ownership). I'd like to see what they think is reasonable C code.