5 ms·
Proper naming of variables/functions is important, but would only tell a part of the story. In the example you'd loose the context why that port might be alread
by Dunedan 4y ago
Proper naming of variables/functions is important, but would only tell a part of the story. In the example you'd loose the context why that port might be already in use.
Using comments instead of commit messages is of course always possible, but if you'd note all relevant information you'd otherwise put into comment messages in comments, you might end up with more comments than actual code, which IMO hinders readability significantly. Take the Linux kernel for example. git commit messages there are very informative and often pretty long. Putting this information into comments would make the code pretty hard to read. Also sometimes there isn't a clear place where you'd put such a comment at, as it only makes sense when looking at multiple changes in different locations (= a git commit) at once.
I believe having the explanation why certain aspects of the code are as they are in the metadata in form of the git commit messages with an occasional comment in the code for important information is a good compromise between readability/verbosity of the code and having all relevant context available.