当前位置:网站首页>Some views on libco

Some views on libco

2022-07-01 00:42:00 51CTO

I don't know when to start , I often think about a problem , That is, what is a good code ? Let's take a look at this description :

‘Good code’ is code that works, is bug free, and is readable and maintainable. Some organizations have coding ‘standards’ that all developers are supposed to adhere to, but everyone has different ideas about what’s best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. ‘Peer reviews’, ‘buddy checks’ code analysis tools, etc. can be used to check for problems and enforce standards.

Good code is that the code works normally 、bug Very few 、 And it has readability and maintainability . Some enterprises have their own coding specifications that all developers must abide by , But everyone has their own standards for what code is the best 、 Or there are too many or too few coding rules . There are many principles and Standards , for example ,McCable Complexity measure . Indeed, using too many coding standards and rules can reduce productivity and creativity .“ Peer review ” or “ Colleague inspection ” Code analysis tools, etc , Can be used to check problems or adhere to standards .

Yes , This passage answered my question , But in my opinion, this is still one-sided . My view on this issue is : Code that solves practical problems is good code . Whether it's redis,nginx Are benchmarks in this regard , They are all created by the author to solve practical problems due to his dissatisfaction with the current situation , And it does solve the problem . Not to say how difficult these two projects are , Find a willing college student , In the case of willing to study , I'm sure he can understand the codes of those two masterpieces . In this respect , In my submission libco It's a good project , Because it really perfectly undertakes the transformation of wechat background from semi synchronous and semi asynchronous to asynchronous , And the implementation of the code is commendable , The exquisite design of many places is really beyond the ordinary people's ability to complete .

But I think from the perspective of an open source project libco Not a good project . Because its official documents can almost be understood as 0, That is, nothing . I even suspect that libco The night before it was open source TX Our engineers are deleting comments line by line . Maybe the whole libco The comments of don't add up to a hundred lines . Secondly, actually libco Our community is at least github It's not very active , I mentioned a few issue, Handed in a few patch,issue Your answer is not what you asked ,patch I haven't received any reply after so long . You can see that the earliest update was half a year ago .

Of course, these are understandable , After all, the company may not pay more for doing this .

Reference resources :


原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010032341663.html