Hacker News new | ask | show | jobs
by gumballindie 1119 days ago
Cool idea, but for me the difficult part is understanding the author’s intention rather than the syntax. And thats is what needs solving. Not just at a high level but in detail.
1 comments

Fair enough, that is a problem that we are facing too but we have no idea how to solve it at this point to be honest. Perhaps connecting one's github repository and commit history into a vectorised database for additional context? Hmmm
My advice for developers has been to write comments before writing the code. That way they describe the intention followed by an implementation. Even if there was a bug somewhere or code was poorly written at least i knew what the intention was.

So maybe training a model against some really well documented codebases might help?

Perhaps unit tests are a also a must since proper unit tests force granularity, thus in theory you’d have a good description of what the intention was + small chunks of code to correlate with.

The issue tho is that most open source code is technical code and code that relies on it serves a business function.

Either way i think the key is finding well documented well tdd’d business function code. Even if what you wish to explain is not clean and tidy but certain bits may fit in patterns that make sense when individually fit against a model. If it makes sense.

"My advice for developers has been to write comments before writing the code." Haha yeah, however in our experience thus far, quite a number of developers really only explain their intentions verbally so nothing ever makes it into the codebase unfortunately. And after a few months, they themselves may not understand why the code was written in a particular manner.

"The issue tho is that most open source code is technical code and code that relies on it serves a business function." Wow yeah never thought about it in that way before!