I once worked with a senior dev who wrote all his array iteration for loops with no condition e.g “for int i = 0 ;; i++” and added an “if i == array.length then break” type condition to the end of every block… And he genuinely didn’t see this as a problem at all.
This was something I did in school to fuck with the teacher. He said all he cared about was output so as long as the code all worked, we could make it as stupid as we want. He taught us really good basics though. Really encouraged us to learn more about coding ourselves so that we could make the next best shitpost for the class. My favorite was creating stupid arithmetic functions. What the fuck is i++? I only know the function increaseIByOne
That’s also why i love the rust ecosystem. If you have rust installed and have your local dependencies (or only use the standard library), the docs can be generated locally (cargo doc). I certainly remember local manuals helping me out more than once over the years :)
The neat thing is, you can add stuff like range checks and logging for getters and setters without changing every call. Separation of concerns is also vital in larger projects.
programmerhumor
Active
This magazine is from a federated server and may be incomplete. Browse more on the original instance.