Follow

Can you see the incredibly simple 101 in this code? Because I just spent the better part of a Sunday banging my head before figuring it out 🤦‍♂️

alone and having full control over your codebase is great most of the time, but sometimes you just need a second set of eyes to reveal your blind spots.

@LouisIngenthron it breaks at least 2 of my rules: USE INTERMEDIATE VARIABLES and ONLY USE INT FOR INT THINGS. I suspect the bug is from the former but I’d advise using an enum for rot if it can only have 4 values. I might even make a Rot type that encapsulates each case as a method and remove the switch by just calling a method in Rot ‘cos REDUCE CONDITIONAL CODE. And write tests. Lots of tests.

@LouisIngenthron

AI assistants can be surprisingly helpful with this actually... I had one catch that I misspelled a variable (yay python) that I just didn't see.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.