itch.io is community of indie game creators and players

Devlogs

Learning from chatGpt

Power of the world and mind
A browser game made in HTML5

The biggest help from chatGPT has been in the form of discovering how to write what i already know, differently. 

Lets take a list of items that holds multiple components

later in the code, i have a single imageComponent and need to find a matching list item. Usually I would loop through the list with foreach and match the list item with an if statement. like this

But if i ask chatGPT to do it, i get this

I've never heard of the function FirstOrDefault. Also never had the privilege or the need to use the default return type.

Using Lambda callback as your function parameter makes it unnecessary hard to read in my opinon. But it's sure is nice to discover new ways to code. 

Leave a comment