Earlier quoted context omitted.
Keep in mind that when boost features are eventually adopted into the C++ standard library, it is often only after their implementation has been strictly defined in ways that diverge from the boost implementations, which are often inefficient. Boost contains a lot of full-featured but inefficient code; for example, some Boost tools allow for arbitrary memory allocation which is often undesirable and their standard li…
Of course, but aside from standardisation defined details, it also depends on your compiler's standard library implementation, and those are not all made equal, especially if you've got to build something both for Windows and Linux.
A header-only C implementation of C++
31–40 of 94 posts
Re: A header-only C implementation of C++ <algorithm>
#32Earlier quoted context omitted.
God I wish everything was done in this way. Even the C standards committee moves too fast and adds features that have no place in the standard.
Well, there are people who choose to stay away from social and technical progress. I totally respect that desire.
Re: A header-only C implementation of C++ <algorithm>
#33Ah, one of those "generic" libraries back from MS-DOS days.
> Ah, one of those "generic" libraries back from MS-DOS days. Nothing about this screams "MS-DOS".[1] Why the disparagement? [1] I know, I was programming at that time.
Re: A header-only C implementation of C++ <algorithm>
#34Well, I do like mine better, which is closer to the STL, and for all containers. https://github.com/rurban/ctl/
On a more constructive side, I think adding some value by giving the poster some feedback or engaging in a conversation about the topic would be nice, otherwise it just sounds as an attempt to show off.
I'm not a fan of these "header only" projects nor am I a fan of overly clever code because even though it's fun and rewarding to write it's not a great fit for larger or collaborative projects where consistently adhering to a coding style (hopefully one of the secure ones) and favoring readability over "coolness" are the way to go.
People love to blame C for all of its footguns but not a lot of people like to write "boring" code which kinda sucks...
Please don't take this personally, even though I have to admit that I felt somewhat irritated upon reading your comment it is my no means my intention to attack you with this rant.
Re: A header-only C implementation of C++ <algorithm>
#35Well, I do like mine better, which is closer to the STL, and for all containers. https://github.com/rurban/ctl/
Re: A header-only C implementation of C++ <algorithm>
#36Earlier quoted context omitted.
Well, there are people who choose to stay away from social and technical progress. I totally respect that desire.
"Social progress" got us the holocaust and tens of millions killed by communism, though. It's perfectly reasonable to be wary of it.
Re: A header-only C implementation of C++ <algorithm>
#37I feel sick everything time when I see C++ related stuff, simple & fun programming got so complicated just because some big name "committee members" who insist to spend 30 years to standardize networking/filesystem/reflection refuse to simplify their craps. yes, they haven't got that completed yet. I guess we can wait another 30 years and there will be a C implementation of the C++ reflection or networking?
You can always just use Boost. I don't think I've ever worked on a C++ project that didn't use it! std::filesystem = boost::filesystem - 1.30.0, 2003 std::optional = boost::optional - 1.30.0, 2003
Re: A header-only C implementation of C++ <algorithm>
#38Well, I do like mine better, which is closer to the STL, and for all containers. https://github.com/rurban/ctl/
I wonder why it's a so common pattern here that everytime someone shows their product, someone in the comments will show their own version in a not-so-implicit patronizing tone
Re: A header-only C implementation of C++ <algorithm>
#39Well, I do like mine better, which is closer to the STL, and for all containers. https://github.com/rurban/ctl/
1. You don't implement the most important algorithms. For example `stable_sort` for arrays. So right there, it's not even a substitute.
One of my motivations from the start was simply to have `stable_sort` in C (to implement database queries).
2. Yours is a clever implementation of C++ features using macros. But it's not idiomatic C. If someone (or their team) wants to use your system, they must learn your macro language.
My file can be included by someone who only knows C array, and will not intrude on any aspect of their C programming style.
3. Mine is intentionally not a data structure library, and avoids making allocations.
There are countless data structure libraries for C. Very few catch on. That's because C programmers tend to manage the life cycle of data themselves. Furthermore, data structures are inter-woven with their data, as opposed to being separate containers.
Besides that point, I see no advantage to yours over other data structure libraries. For example, the best C hash map implementations are written for uint64 keys. Fixing to a concrete type allows for tremendous optimization.
I applaud the efforts in your project and wish it success. Our projects happen to draw on similar source material, but that's about it.