Can you tell us about how you use these engines to perform refactoring? Maybe give an example?
I usually paste my code with the prefix “Can the following Python code be improved?”.
Here is an example:
https://www.gnod.com/search/ai#q=Can%20the%20following%20Python%20function%20be%20improved%3F%0A%0Afor%20member%20in%20data%5B'members'%5D%3A%0A%20%20%20%20if%20not%20member%5B'tags'%5D%3A%20continue%3B%0A%20%20%20%20if%20not%20any(tag%5B'name'%5D%3D%3D'joe'%20for%20tag%20in%20member%5B'tags'%5D)%3A%20continue%0A%20%20%20%20print(member)%0A
Something like 25% of the time, the AI comes up with a good idea.
What about when you have a non-trivial amount of code?
I break it into smaller pieces.
I am pretty extreme in this regard.
The Gnod codebase has been growing for well over a decade, and the typical function is about 10 lines. There barely are any functions longer than 20 lines.
Can you tell us about how you use these engines to perform refactoring? Maybe give an example?
I usually paste my code with the prefix “Can the following Python code be improved?”.
Here is an example:
https://www.gnod.com/search/ai#q=Can%20the%20following%20Python%20function%20be%20improved%3F%0A%0Afor%20member%20in%20data%5B'members'%5D%3A%0A%20%20%20%20if%20not%20member%5B'tags'%5D%3A%20continue%3B%0A%20%20%20%20if%20not%20any(tag%5B'name'%5D%3D%3D'joe'%20for%20tag%20in%20member%5B'tags'%5D)%3A%20continue%0A%20%20%20%20print(member)%0A
Something like 25% of the time, the AI comes up with a good idea.
What about when you have a non-trivial amount of code?
I break it into smaller pieces.
I am pretty extreme in this regard.
The Gnod codebase has been growing for well over a decade, and the typical function is about 10 lines. There barely are any functions longer than 20 lines.