3 ms·
Their C API is so much cleaner looking than the C++ one, imo. I avoided it so far thinking that once I want to use something not covered in the C API, I don’t
by valleyer 12y ago
Their C API is so much cleaner looking than the C++ one, imo. I avoided it so far thinking that once I want to use something not covered in the C API, I don’t want to do a big refactor. Is that a rational fear?
- adrianm 12y agoI think that is still a valid concern. Features first hit the C++ API and then slowly migrate to a C expressible subset.
- rubiquity 12y agoThis seems to happen a lot to projects that are written in C++ but have C APIs. Another good example of this would be ZeroMQ. I wonder why this happens.
- zw 12y agoIf I remember correctly from an article many years ago, they want the C++ API to be high-level and fast-moving; the C API exists so that they can support low-level use and almost all clients while only maintaining one API well.
- alexchamberlain 12y agoC++ is an awesome languages for writing algorithms and low level memory manipulation, such as network protocols. The big problem is the ABI sucks, although on Linux the story is better than elsewhere. Even on Linux mangling is just confusing.
- faragon 12y ago"The big problem is the ABI sucks" The problem is that there is no standard ABI call for C++, as implentation is vendor-specific (it may change even for same vendor between different compiler versions (!)). It would be hard to "fix" that, e.g. virtual function tables, exceptions, etc. For standard bindings, C is the only sane option.
- kozlinov 12y agoThis is a psychological effect caused by some deficiencies in human thinking. People feel obliged to use OOP in full once it is available and shit all over the place with classes, interfaces and inheritance. In a more limited language it is harder to multiply entities, so they just do not do it. So it may make sense to add some artificially crafted pain into a language to force people to write less code.
- Guthur 12y agoInterestingly Martin Sustrik, one of the original ZeroMQ authors, expressed regret for having chosen C++ for ZeroMQ. http://250bpm.com/blog:4 http://250bpm.com/blog:4 http://250bpm.com/blog:8 http://250bpm.com/blog:8
- sclangdon 12y agoAnd as some of the comments on his blog point out, he uses C++ in a C style. "If you insist on sticking to a conventional C style of C++ code, you’ll get conventional C-style problems" - Bjarne Stroustrup (http://www.informit.com/articles/article.aspx?p=2080042 http://www.informit.com/articles/article.aspx?p=2080042)