Redis is my favorite example of a very clean and beautiful example of C code, just the right amount of comments, good variable names. It is great work. You can tell Salvatore cares and has passion for what he does just by looking at his work. https://github.com/antirez/redis/tree/unstable/src
A quick look at the Redis source code
11–20 of 34 posts
Re: A quick look at the Redis source code
#12It's actually a quick tutorial describing how to add a new command to Redis, not an actual analysis of the source code as I expected.
Yeah, it's a pretty shallow introduction. I'd like to write more articles on the Redis code. The sorted set skiplist stuff is really interesting.
I've got a couple of general articles on adding a command and adding a datatype to Redis at http://starkiller.net, but I don't get too into existing code. I'd be interested in writing a bit more about the other data structures as well as the multiple strategies used for EXPIRE (which recently changed I believe).
Re: A quick look at the Redis source code
#13Redis is my favorite example of a very clean and beautiful example of C code, just the right amount of comments, good variable names. It is great work. You can tell Salvatore cares and has passion for what he does just by looking at his work. https://github.com/antirez/redis/tree/unstable/src
Wow it's awesome, comparing to the most of the C code that I saw it's beautiful. I like the long method names, because I can actually understand what they are doing.
Re: A quick look at the Redis source code
#14Re: A quick look at the Redis source code
#15It's actually a quick tutorial describing how to add a new command to Redis, not an actual analysis of the source code as I expected.
You might be interested in one of these articles: http://pauladamsmith.com/articles/redis-under-the-hood.html http://blog.togo.io/how-to/adding-interval-sets-to-redis They have both been discussed before though.
Re: A quick look at the Redis source code
#16Re: A quick look at the Redis source code
#17Earlier quoted context omitted.
Wow it's awesome, comparing to the most of the C code that I saw it's beautiful. I like the long method names, because I can actually understand what they are doing.
Maybe you haven't looked very often but nice code is out there for quite some time. Take a look at anything related to the GNOME stack (GLib, GTK+, all the applications) or the Linux kernel for example. And quite frankly, I stumble upon badly written Python way more often than C.
Re: A quick look at the Redis source code
#18Earlier quoted context omitted.
Wow it's awesome, comparing to the most of the C code that I saw it's beautiful. I like the long method names, because I can actually understand what they are doing.
Maybe you haven't looked very often but nice code is out there for quite some time. Take a look at anything related to the GNOME stack (GLib, GTK+, all the applications) or the Linux kernel for example. And quite frankly, I stumble upon badly written Python way more often than C.
Re: A quick look at the Redis source code
#19Earlier quoted context omitted.
Maybe you haven't looked very often but nice code is out there for quite some time. Take a look at anything related to the GNOME stack (GLib, GTK+, all the applications) or the Linux kernel for example. And quite frankly, I stumble upon badly written Python way more often than C.
IMO, OpenBSD and tarsnap are other notable samples of clean C code.