There's Definitely Should Be An Easier Way For This

There's Definitely Should Be An Easier Way For This
generics-memes, code-smell-memes, repetitive-code-memes, csharp-memes, refactoring-memes | ProgrammerHumor.io

Someone discovered the hard way that generics exist for a reason. We're witnessing a developer manually calling GetFirst<T>() for TWENTY-FOUR different types and then passing each one to Unsafe.Add() individually. Like... bestie, have you heard of a loop? An array? A collection? Literally ANY data structure that doesn't require you to copy-paste the same line 24 times?

This is what happens when you're so deep in the trenches that you forget basic programming principles. The sheer audacity of typing t0FirstElement, t1FirstElement, t2FirstElement... all the way to t24FirstElement without once thinking "hmm, maybe I'm doing something wrong here" is truly breathtaking. Your keyboard is filing for workers' compensation as we speak.

Fun fact: This code probably took longer to write than it would've taken to learn about iterating through a collection of types. But hey, at least it's... consistent? πŸ’€

More Like This