Hacker News new | ask | show | jobs
by holoduke 1255 days ago
Same here. Worked on a lazy list in js for mobile. The component had a nasty array lookup every scroll event. I asked chatgpt if it could optimize the lookup algorithm. I suggested me to implement a binary search solution including the code itself. It worked immediately. I would have taken me probably a day to come up with something similar. I also asked chatgpt to minimize my code including all method names , variables etc. Unfortunately the output of chatgpt is limited to x characters. 200kb of text isnt possible. But it is able to minimize. You can even ask to uglify the code by using animal names or street names in London.
1 comments

type "continue" after the initial output and chatgpt should continue printing out the answer