General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
p11
Fireship
comments
Comments by "p11" (@porky1118) on "" video.
5:20 Recently when I used AI to generate code for me, it only worked partially. It was a program which turned hierarchical And-Or-Expressions into a normal form (A list of lists). After I defined both data structures, the AI just created the code, and it was short and seemed correct. I wrote the tests and everything worked as expected. But I also wanted a parser for these expressions. I wanted "A&B&C" to be turned into a single And-List. But it turned it into three And-Lists which had two elements. And it used a way too complicated parsing approach. It didn't even work at first. But after refactoring for half an hour, I just gave up and wrote it myself in less than a hour. Waste of time.
2
4:00 I only write tests when I have a good idea of what to test for. Like if it's some kind of list, I push and pop and insert and remove stuff, iterate and index it, and check if I get the expected results. If I write collision detection, I try collisions bewteen all shape combinations, and try to get all edge cases, like two spheres barely touching, or two speheres barely not touching, or collision with a sphere of radius 0. If I create some struct which represents some color and has a few constructors, I don't write any tests. And I only write tests if I put some of my code into a library.
1