r/programming • • Sep 26 '09

Ask Proggit: What are the most elegantly coded C/C++ open source projects?

I've recently been reading (parts of) the source for sqlite3 and found it to be a revelation in good programming practise.

What other C/C++ open source projects (of any size) would you recommend that I look at, in order to get an idea of current good practise?

141 Upvotes

292 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Sep 26 '09

I dunno, can you find me some C++ code worse than procmail.c?

2

u/racergr Sep 27 '09

I guess all the code that my C++ professor was giving us at uni.

1

u/tryx Oct 18 '09 edited Oct 18 '09
Deliverymode=!!strncmp(lastdirsep(argv0=argv[0]),procmailn,
 STRLEN(procmailn));

Is that a.. did he just put a double negative in his condition?

0

u/Poltras Sep 26 '09

boost.Lambda?

4

u/[deleted] Sep 27 '09

That's extremely well written C++ code actually. It's well commented and follows a very clean and consistent style. It's mind-bendingly difficult to understand if you aren't familiar with the intricacies of template metaprogramming and the other components it's built on, but there's a pretty big difference between being complicated and poorly written.