gretchenleigh

middle-aged multimedia queer

Gretchen
The PlayStation Experiment | Game Mag Print Ads | Rando Chrontendo
software engineer @ Internet Archive
anarcho-left
trans lesbian πŸ³οΈβ€πŸŒˆπŸ³οΈβ€βš§οΈ


I had a live code interview last week where one of the engineers kept pushing me to use a try/except on out of bounds index access as flow control to break out of a for loop, and I cannot stop thinking about the brain that would consider that normal. He was a principal.


You must log in to comment.

in reply to @gretchenleigh's post:

Function that takes needle and haystack strings and returns a bool to indicate if the needle was found. Iterating through string slices to find a needle in a haystack and catching the exception when you're accessing an out of bounds slice, then return false out of the exception because you didn't find the needle in the haystack after iterating through the possible matching slices.