johnofthesea,

reducers

PeterPoopshit,

Segmentation fault (core dumped) is fun guys

nothendev,

try-while block

devious,

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.

LeylaaLovee,
@LeylaaLovee@lemmy.fmhy.ml avatar

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

mcherm,
@mcherm@lemmy.world avatar

It really needs a fourth block that just says “Python”.

(For those who don’t get the joke, in Python the way that one exits a loop over an iterator is to keep going until the iterator throws an exception. It sounds dumb at first, but in truth, that’s only if you think that exceptions are incredibly heavyweight compared to other operations.)

stilgar,
@stilgar@infosec.pub avatar

EAFP vs LBYL

aidan,

If you think about it, while-true is just goto

humbodungo,

So, python ?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • oklahoma
  • feritale
  • SuperSentai
  • KamenRider
  • All magazines