| Fully agree with the principle but maybe let's not call Redis "well-written" :) Redis is a great piece of software because of how much it impacted the "evolution" of Internet not because of the code quality, Redis's code resemble spaghetti code, a lot. I will push myself and say that nowadays people would get fired for writing code like that! And before someone start to throw stones (just for the sake of it), here a few examples:
- Redis source code is FULL of GIANT files with thousands and thousands of lines of code, decoupling and separation of concerns are basic things! A few examples
-- https://github.com/redis/redis/blob/unstable/src/module.c
-- https://github.com/redis/redis/blob/unstable/src/cluster.c
-- https://github.com/redis/redis/blob/unstable/src/redis-cli.c
-- https://github.com/redis/redis/blob/unstable/src/networking.... - talking about auto generated, the repo contains commited auto generated code, a valid reason though really slips my mind (yes, of course I can think of a few, but ... really? :))) - https://github.com/redis/redis/blob/9c7c6924a019b902996fc4b6... ... that struct feels like an "Italian minestrone", basically a kind of soup where you throw in, literally, all the vegetables you have around and it's great for a soup, a bit less for software engineering though :) - the naming structure is a bit random at times, there is a mix of camel case, camel case mixed with underscores from time to time, pascal case This kind of staff might be alright for a 0.3 or 0.4, maybe even for a 1.0, definitely not for a 7.x that has had 15 years to evolve :/
Even in cachegrand, that hasn't got to a v0.2 yet, I tried to avoid these kinda of dramas, in C is quick and easy to get there if you are not careful. There are plenty of other small things but most of the big dramas should be there. |