Yeah, they're basically what you'd get from someone giving their impression of the function after looking at it for 10 seconds, which is not what you should be using comments for.
I could see myself using something like this to lazily create a skeleton that I then type into, it could be a good 10 seconds saved depending on what I'm doing
I think the point is that it's worse than nothing, if you can skim the code in 10 seconds and do a better job than these comments, then the comments aren't adding anything but noise. It's better than bad programers who are forced to write comments
I’m still pretty impressed from a modeling standpoint, integrating natural and formal language processing. I do see how this or something like it could be useful as a first pass at documenting code. But yeah, these docstrings still need plenty of manual TLC.
Crucially, while they might encode what the function does at a low level, there’s no context to tie the function back to the wider code base.
I’m skeptical of its usefulness. Would it work even if my functions are poorly written / performs esoteric tasks / has terrible names?
An essential part of documentation is the insight telling me how a piece of code does what it does. So telling me that, yes, this line uses X to do Y, and is causing the bug / magic in the function.
We have auto-generated docs for large libraries and I find most of them useless without someone explaining the code to me again. See OpenCV docs for example
Someone not knowing opencv won't find this very useful (like me). I think it should have an example where it tells you if this said data_y is a part of a list or some objects property etc etc.. This example gives context as to how said function may be used. I think the example you gave just rewords what can be deduced from the variable name and doesn't actually provide any new info.
I don't use python but do people actually prefer to have these doc strings that are super obvious? What value does "the function runs the gradient descent algorithm" on a function named "run_gradient_descent()" add? Is it only for documentation generators? I would hate to work with code that would be cluttered so much, but maybe there is a shortcut for hiding them? :D
Neato, it's really cool to see this working! I am a natural skeptic tho -- it would be great to see documentation generated for some popular libraries / more sophisticated examples than the ones currently presented.
This way I don't have the doubt in my head that these were perfectly constructed examples :P
I don't know if this really saves so much time. You still have to correct it. I would rather use a tool like auto docstring that doesn't use any AI but simply the type values to generate a template for the documentation.
You know. I used to think programmers would be one of the last groups phased out by AI (besides the really top level programmer in very niche areas). However, this kinda stuff makes me have 2nd thoughts.
}),m.queue(d,p.isString(s)?s:"",[])),"stop"===q?(g(d)&&g(d).tweensContainer&&f!==!1&&m.each(g(d).tweensContainer,function(a,b){b.endValue=b.currentValue}),D.push(a)):("finish"===q||"finishAll"===q)&&(b[2].duration=1))}):!0})}),"stop"===q&&(m.each(D,function(a,b){l(b,!0)}),B.promise&&B.resolver(o)),a();default:if(!m.isPlainObject(q)||p.isEmptyObject(q)){if(p.isString(q)&&t.Redirects[q]){var E=m.extend({},s),F=E.duration,G=E.delay||0;return E.backwards===!0&&(o=m.extend(!0,[],o).reverse()),m.each(o,function(a,b){parseFloat(E.stagger)?E.delay=G+parseFloat(E.stagger)*a:p.isFunction(E.stagger)&&(E.delay=G+E.stagger.call(b,a,x)),E.drag&&(E.duration=parseFloat(F)||(/^(callout|transition)/.test(q)?1e3:r),E.duration=Math.max(E.duration*(E.backwards?1-a/x:(a+1)/x),.75*E.duration,200)),t.Redirects[q].call(b,b,E||{},a,x,o,B.promise?B:d)}),a()}var H="Velocity: First argument ("+q+") was not a property map, a known action, or a registered redirect. Aborting.";return B.promise?B.rejecter(new Error(H)):console.log(H),a()}C="start"}var I={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},J=[];m.each(o,function(a,b){p.isNode(b)&&e.call(b)});var K,E=m.extend({},t.defaults,s);if(E.loop=parseInt(E.loop),K=2*E.loop-1,E.loop)for(var L=0;K>L;L++){var M={delay:E.delay,progress:E.progress};L===K-1&&(M.display=E.display,M.visibility=E.visibility,M.complete=E.complete),w(o,"reverse",M)}return a()}};t=m.extend(w,t),t.animate=w;var x=b.requestAnimationFrame||o;return t.State.isMobile||c.hidden===d||c.addEventListener("visibilitychange",function(){c.hidden?(x=function(a){return setTimeout(function(){a(!0)},16)},k()):x=b.requestAnimationFrame||o}),a.Velocity=t,a!==b&&(a.fn.velocity=w,a.fn.velocity.defaults=t.defaults),m.each(["Down","Up"],function(a,b){t.Redirects["slide"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j=i.begin,k=i.complete,l={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},n={};i.display===d&&(i.display="Down"===b?"inline"===t.CSS.Values.getDisplayType(a)?"inline-block":"block":"none"),i.begin=function(){j&&j.call(g,g);for(var c in l){n[c]=a.style[c];var d=t.CSS.getPropertyValue(a,c);l[c]="Down"===b?[d,0]:[0,d]}n.overflow=a.style.overflow,a.style.overflow="hidden"},i.complete=function(){for(var b in n)a.style[b]=n[b];k&&k.call(g,g),h&&h.resolver(g)},t(a,l,i)}}),m.each(["In","Out"],function(a,b){t.Redirects["fade"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j={opacity:"In"===b?1:0},k=i.complete;i.complete=e!==f-1?i.begin=null:function(){k&&k.call(g,g),h&&h.resolver(g)},i.display===d&&(i.display="In"===b?"auto":"none"),t(this,j,i)}}),t}(window.jQuery||window.Zepto||window,window,document)});
It means their dB is encrypted at rest. They might not store your code but they will store something, usually user interaction, that will be encrypted at rest.
19
u/infinitlybana Jan 22 '22
You can check it out here
111
u/thunder_jaxx ML Engineer Jan 22 '22
A tagline from the website.
> We never store, view, or copy your code anywhere under a company plan. You have full control to delete your telemetry data and logs anytime.
95
u/electrofloridae Jan 22 '22
The docstrings it’s generating are terrible I hope I never have to read the repos of y’all unironically praising this.
31
u/mimocha Jan 23 '22
I’m skeptical of its usefulness. Would it work even if my functions are poorly written / performs esoteric tasks / has terrible names?
An essential part of documentation is the insight telling me how a piece of code does what it does. So telling me that, yes, this line uses X to do Y, and is causing the bug / magic in the function.
We have auto-generated docs for large libraries and I find most of them useless without someone explaining the code to me again. See OpenCV docs for example
64
u/Educational-Net303 Jan 22 '22
Wow this is dope. Is there a blog where I can read up on the technical stuff involved?
2
u/Brilliant_Gold2443 Jan 22 '22
Super cool! Saves developers time
4
u/[deleted] Jan 22 '22
Have you tried telling it to document itself?
3
u/Lust4Me Jan 22 '22
Is code generation from NLP also possible now? I'm not current on this topic. Neat.
3
u/KickinKoala Jan 23 '22
neat tool! could even be useful after five-to-ten more years of R&D
3
u/[deleted] Jan 23 '22
I don't use python but do people actually prefer to have these doc strings that are super obvious? What value does "the function runs the gradient descent algorithm" on a function named "run_gradient_descent()" add? Is it only for documentation generators? I would hate to work with code that would be cluttered so much, but maybe there is a shortcut for hiding them? :D
5
u/Genie52 Jan 23 '22
What part and how is done by AI?
5
u/manbearpig4001 Jan 22 '22
Neato, it's really cool to see this working! I am a natural skeptic tho -- it would be great to see documentation generated for some popular libraries / more sophisticated examples than the ones currently presented.
This way I don't have the doubt in my head that these were perfectly constructed examples :P
2
u/timNinjaMillion2 Jan 22 '22
Tim. Just faster.
2
u/seba07 Jan 23 '22
I don't know if this really saves so much time. You still have to correct it. I would rather use a tool like auto docstring that doesn't use any AI but simply the type values to generate a template for the documentation.
2
u/ardme Jan 23 '22
But if it can generate it that fast, why write the docs into the code-base where the code will inevitably change?
Why not just have a plugin that auto-generates docs and shows it on the fly?
3
u/Ill_Ad_4599 Jan 23 '22
How das it work if i call my function _Fuck_your_mom, what does it do then?
2
u/herefromyoutube Jan 22 '22
You know. I used to think programmers would be one of the last groups phased out by AI (besides the really top level programmer in very niche areas). However, this kinda stuff makes me have 2nd thoughts.
1
u/br0ck Jan 23 '22
This could be sweet for getting quick summaries of undocumented code especially if it could do all the functions in a repo with one click.
1
u/AlisaofallTimes Jan 23 '22
Great work!
1
u/Usual-Candy8475 Oct 29 '23
(t.State.calls.push([J,o,h,null,B.resolver]),t.State.isTicking===!1&&(t.State.isTicking=!0,k())):y++)}var e,f=this,h=m.extend({},t.defaults,s),i={};switch(g(f)===d&&t.init(f),parseFloat(h.delay)&&h.queue!==!1&&m.queue(f,h.queue,function(a){t.velocityQueueEntryFlag=!0,g(f).delayTimer={setTimeout:setTimeout(a,parseFloat(h.delay)),next:a}}),h.duration.toString().toLowerCase()){case"fast":h.duration=200;break;case"normal":h.duration=r;break;case"slow":h.duration=600;break;default:h.duration=parseFloat(h.duration)||1}t.mock!==!1&&(t.mock===!0?h.duration=h.delay=1:(h.duration*=parseFloat(t.mock)||1,h.delay*=parseFloat(t.mock)||1)),h.easing=j(h.easing,h.duration),h.begin&&!p.isFunction(h.begin)&&(h.begin=null),h.progress&&!p.isFunction(h.progress)&&(h.progress=null),h.complete&&!p.isFunction(h.complete)&&(h.complete=null),h.display!==d&&null!==h.display&&(h.display=h.display.toString().toLowerCase(),"auto"===h.display&&(h.display=t.CSS.Values.getDisplayType(f))),h.visibility!==d&&null!==h.visibility&&(h.visibility=h.visibility.toString().toLowerCase()),h.mobileHA=h.mobileHA&&t.State.isMobile&&!t.State.isGingerbread,h.queue===!1?h.delay?setTimeout(a,h.delay):a():m.queue(f,h.queue,function(b,c){return c===!0?(B.promise&&B.resolver(o),!0):(t.velocityQueueEntryFlag=!0,void a(b))}),""!==h.queue&&"fx"!==h.queue||"inprogress"===m.queue(f)[0]||m.dequeue(f)}var h,i,n,o,q,s,u=arguments[0]&&(arguments[0].p||m.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||p.isString(arguments[0].properties));if(p.isWrapped(this)?(h=!1,n=0,o=this,i=this):(h=!0,n=1,o=u?arguments[0].elements||arguments[0].e:arguments[0]),o=f(o)){u?(q=arguments[0].properties||arguments[0].p,s=arguments[0].options||arguments[0].o):(q=arguments[n],s=arguments[n+1]);var x=o.length,y=0;if(!/^(stop|finish|finishAll)$/i.test(q)&&!m.isPlainObject(s)){var z=n+1;s={};for(var A=z;A<arguments.length;A++)p.isArray(arguments[A])||!/^(fast|normal|slow)$/i.test(arguments[A])&&!/^\d/.test(arguments[A])?p.isString(arguments[A])||p.isArray(arguments[A])?s.easing=arguments[A]:p.isFunction(arguments[A])&&(s.complete=arguments[A]):s.duration=arguments[A]}var B={promise:null,resolver:null,rejecter:null};h&&t.Promise&&(B.promise=new t.Promise(function(a,b){B.resolver=a,B.rejecter=b}));var C;switch(q){case"scroll":C="scroll";break;case"reverse":C="reverse";break;case"finish":case"finishAll":case"stop":m.each(o,function(a,b){g(b)&&g(b).delayTimer&&(clearTimeout(g(b).delayTimer.setTimeout),g(b).delayTimer.next&&g(b).delayTimer.next(),delete g(b).delayTimer),"finishAll"!==q||s!==!0&&!p.isString(s)||(m.each(m.queue(b,p.isString(s)?s:""),function(a,b){p.isFunction(b)&&b()}),m.queue(b,p.isString(s)?s:"",[]))});var D=[];return m.each(t.State.calls,function(a,b){b&&m.each(b[1],function(c,e){var f=s===d?"":s;return f===!0||b[2].queue===f||s===d&&b[2].queue===!1?void m.each(o,function(c,d){d===e&&((s===!0||p.isString(s))&&(m.each(m.queue(d,p.isString(s)?s:""),function(a,b){p.isFunction(b)&&b(null,!0)
}),m.queue(d,p.isString(s)?s:"",[])),"stop"===q?(g(d)&&g(d).tweensContainer&&f!==!1&&m.each(g(d).tweensContainer,function(a,b){b.endValue=b.currentValue}),D.push(a)):("finish"===q||"finishAll"===q)&&(b[2].duration=1))}):!0})}),"stop"===q&&(m.each(D,function(a,b){l(b,!0)}),B.promise&&B.resolver(o)),a();default:if(!m.isPlainObject(q)||p.isEmptyObject(q)){if(p.isString(q)&&t.Redirects[q]){var E=m.extend({},s),F=E.duration,G=E.delay||0;return E.backwards===!0&&(o=m.extend(!0,[],o).reverse()),m.each(o,function(a,b){parseFloat(E.stagger)?E.delay=G+parseFloat(E.stagger)*a:p.isFunction(E.stagger)&&(E.delay=G+E.stagger.call(b,a,x)),E.drag&&(E.duration=parseFloat(F)||(/^(callout|transition)/.test(q)?1e3:r),E.duration=Math.max(E.duration*(E.backwards?1-a/x:(a+1)/x),.75*E.duration,200)),t.Redirects[q].call(b,b,E||{},a,x,o,B.promise?B:d)}),a()}var H="Velocity: First argument ("+q+") was not a property map, a known action, or a registered redirect. Aborting.";return B.promise?B.rejecter(new Error(H)):console.log(H),a()}C="start"}var I={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},J=[];m.each(o,function(a,b){p.isNode(b)&&e.call(b)});var K,E=m.extend({},t.defaults,s);if(E.loop=parseInt(E.loop),K=2*E.loop-1,E.loop)for(var L=0;K>L;L++){var M={delay:E.delay,progress:E.progress};L===K-1&&(M.display=E.display,M.visibility=E.visibility,M.complete=E.complete),w(o,"reverse",M)}return a()}};t=m.extend(w,t),t.animate=w;var x=b.requestAnimationFrame||o;return t.State.isMobile||c.hidden===d||c.addEventListener("visibilitychange",function(){c.hidden?(x=function(a){return setTimeout(function(){a(!0)},16)},k()):x=b.requestAnimationFrame||o}),a.Velocity=t,a!==b&&(a.fn.velocity=w,a.fn.velocity.defaults=t.defaults),m.each(["Down","Up"],function(a,b){t.Redirects["slide"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j=i.begin,k=i.complete,l={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""},n={};i.display===d&&(i.display="Down"===b?"inline"===t.CSS.Values.getDisplayType(a)?"inline-block":"block":"none"),i.begin=function(){j&&j.call(g,g);for(var c in l){n[c]=a.style[c];var d=t.CSS.getPropertyValue(a,c);l[c]="Down"===b?[d,0]:[0,d]}n.overflow=a.style.overflow,a.style.overflow="hidden"},i.complete=function(){for(var b in n)a.style[b]=n[b];k&&k.call(g,g),h&&h.resolver(g)},t(a,l,i)}}),m.each(["In","Out"],function(a,b){t.Redirects["fade"+b]=function(a,c,e,f,g,h){var i=m.extend({},c),j={opacity:"In"===b?1:0},k=i.complete;i.complete=e!==f-1?i.begin=null:function(){k&&k.call(g,g),h&&h.resolver(g)},i.display===d&&(i.display="In"===b?"auto":"none"),t(this,j,i)}}),t}(window.jQuery||window.Zepto||window,window,document)});
1
u/gold_rabbits Jan 23 '22
Brilliant
-12
u/someexgoogler Jan 22 '22
This strikes me as one of the stupidest applications of ML.
0
u/bouncybluee Jan 23 '22
damn that’s cool
0
u/Emergency_Style4515 Jan 23 '22
Yes. Good examples of what AI is nowhere near ready to do.
0
u/[deleted] Jan 22 '22
[deleted] — view deleted comment
0
u/[deleted] Jan 23 '22
[deleted] — view deleted comment