当前位置:网站首页>AI 从代码中自动生成注释文档
AI 从代码中自动生成注释文档
2022-07-06 17:36:00 【小盒子的技术分享】
程序员最讨厌的两件事:
自己写注释 别人不写注释
Mintlify 的插件终于可以把我们从痛苦的死循环中解救出来了。
Mintlify 利用 AI 技术从代码中自动生成注释文档
注意 it's free
但谁知道呢,也许过一阵子就像 github 的 Copilot 一样开始收费了也说不定。
来个Demo
比如我这段简单的二分查找 程序片段:
分别看下 Mintlify 为它生成的注释,注意:它可以生成多语言的,有英文的也有中文的
上面这些都是自动生成的,从结果看是基于程序进行的翻译,比较罗嗦,但还算准确。
应用
好啦,那剩下的事情就是把你写完的程序一键生成注释,然后一份带有良好(啰嗦)注释的代码就编写完成了,如果你的团队统计代码和注释行数(哪个团队这么SB,告诉我,避个坑),那么又愉快地完成了KPI。
开个玩笑 ,良好的代码注释,不但有利于别人阅读,更有利于维护,有时候时间长了,我们自己都不知道写的是什么玩意,我有时候看到一大段程序没有注释还写的特别绕的时候就开始骂娘了:“这TM写的什么玩意儿”,讽刺的是,有些时候,那程序是我自己写的。哈哈。
都说优秀的代码可以做到自解释,不用写注释也看得懂,对,那是优秀的代码,在你还不能写成那样的代码之前,写注释吧孩子,先保证你不会被团队的同学骂娘再说。
提示
如安装插件或使用过程中遇到网络问题,请通过科学上网自行解决。如这玩意(https://www.mintlify.com/)开始收费了,当我没说。
本文由 mdnice 多平台发布
边栏推荐
- golang中的atomic,以及CAS操作
- 系统休眠文件可以删除吗 系统休眠文件怎么删除
- NEON优化:log10函数的优化案例
- table表格设置圆角
- from .cv2 import * ImportError: libGL.so.1: cannot open shared object file: No such file or direc
- Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
- 云呐|工单管理办法,如何开展工单管理
- The MySQL database in Alibaba cloud was attacked, and finally the data was found
- Gazebo的安装&与ROS的连接
- 从零开始匹配vim(0)——vimscript 简介
猜你喜欢

Come on, don't spread it out. Fashion cloud secretly takes you to collect "cloud" wool, and then secretly builds a personal website to be the king of scrolls, hehe

资产安全问题或制约加密行业发展 风控+合规成为平台破局关键

Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which

Byte P7 professional level explanation: common tools and test methods for interface testing, Freeman

LLDP兼容CDP功能配置

Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
![[batch dos-cmd command - summary and summary] - string search, search, and filter commands (find, findstr), and the difference and discrimination between find and findstr](/img/4a/0dcc28f76ce99982f930c21d0d76c3.png)
[batch dos-cmd command - summary and summary] - string search, search, and filter commands (find, findstr), and the difference and discrimination between find and findstr

ClickHouse字段分组聚合、按照任意时间段粒度查询SQL

golang中的Mutex原理解析

动态规划思想《从入门到放弃》
随机推荐
Neon Optimization: summary of performance optimization experience
系统休眠文件可以删除吗 系统休眠文件怎么删除
Supersocket 1.6 creates a simple socket server with message length in the header
Return to blowing marshland -- travel notes of zhailidong, founder of duanzhitang
MySQL中回表的代价
Informatics Orsay Ibn YBT 1172: find the factorial of n within 10000 | 1.6 14: find the factorial of n within 10000
UI控件Telerik UI for WinForms新主题——VS2022启发式主题
Niuke cold training camp 6B (Freund has no green name level)
Build your own website (17)
golang中的Mutex原理解析
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
免费白嫖的图床对比
负载均衡性能参数如何测评?
Come on, don't spread it out. Fashion cloud secretly takes you to collect "cloud" wool, and then secretly builds a personal website to be the king of scrolls, hehe
Dynamic planning idea "from getting started to giving up"
windows安装mysql8(5分钟)
2022 Google CTF segfault Labyrinth WP
[HFCTF2020]BabyUpload session解析引擎
BFS realizes breadth first traversal of adjacency matrix (with examples)
[牛客] B-完全平方数




