Last Image You Saved - we all know it's hentai

Oh god. I remember being 8 or so and they had this book reading event for the weekend. I don't even recall, but they had a pop-quiz thing at the end over what they just read, which was basically a litmus test for who paid attention. Me, being hwite and possibly autistic, answered correctly and won tickets to a local WWF (now WWE) event.

Pic tax of my fine work.

uglyJ.jpg
 
View attachment 4659153
(I'm not a codemonkey so I don't quite get the joke. The code is more complex than need-be? Maybe an IT slave could clarify.)
Pretty much, yeah.
  • First is simple and readable.
  • Second is doing slightly more work than it needs to, but it's just as readable and not necessarily bad. The compiler will probably optimize this and number one down to the same thing. Some may even prefer it because it's more explicit.
  • Third is bad. It's more difficult to read and less efficient. String comparisons are way more performance heavy than simply checking if a condition is true or false.
  • Fourth is horrendously complex for the work that it's doing. It's performing a custom string comparison in the for loop in order to set an intermediary that it performs a second string comparison with in order to check if the conditional is true or not. What makes it even worse is that at first glance it seems like this code could be doing something. You have to actually walk yourself through it before you understand that most of the lines of code could be removed.
 
Back