Reading through code that looks like this[0] is so much nicer than reading through code that looks like this[1].
[0] https://www.sqlite.org/src/artifact/9711a7575036f0d3
[1] https://github.com/mysql/mysql-server/blob/b93c1661d689c8b7d...
Reading through code that looks like this[0] is so much nicer than reading through code that looks like this[1].
[0] https://www.sqlite.org/src/artifact/9711a7575036f0d3
[1] https://github.com/mysql/mysql-server/blob/b93c1661d689c8b7d...
I find both of your examples readable to about the same level; MySQL one because the naming is helpful (`number_of_bytes_read_from_buffer`) and SQLite one because of the comments - I would be lost without them. For example, why is a function that does "Release the STATIC_MASTER mutex" called "leaveMutex"? On the other hand, SQLite comments explain much more about how the code is used, what assumptions are made, so this is really a bonus.
I would suggest to use commenting as soon as you're doing something that's not immediately obvious to the reader, which can be all of the time or almost never depending on what you're doing. If would like to see some examples of Rails or JS code that needs comments according to you to have a better discussion about it.