this post was submitted on 05 Sep 2023
18 points (100.0% liked)

Programmer Humor

20683 readers
1583 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] phorq@lemmy.ml 2 points 1 year ago (1 children)

I count 13 steps, so it just means you're gonna trip up on 3 of them...

[–] db2@sopuli.xyz 2 points 1 year ago* (last edited 1 year ago) (2 children)

15 steps. You're not counting the top, and the bottom is step 0 and we all know counting starts there.

[–] jerome@kbin.social 2 points 1 year ago (1 children)
[–] GuybrushThreepwo0d@programming.dev 1 points 1 year ago (1 children)

We are on a programming sub of a federated and open source reddit clone. We are all nerds.

[–] ripcord@kbin.social 1 points 1 year ago (1 children)

I assume it was meant as a compliment.

[–] jerome@kbin.social 2 points 1 year ago

(i said it with love)

[–] UnRelatedBurner@sh.itjust.works 1 points 1 year ago (2 children)

sometimes i start my iterator with = -1. As I only +=1 it with a condition and I know that it will return true on the first cycle. I'll chuck array[iterator] and need it to be 0 to start with ofc.

I just have no idea how to not do this, but it looks so bad, i need a i8 instead of a u8 at least because of this

[–] darcy@sh.itjust.works 2 points 1 year ago* (last edited 1 year ago)

thats great unless you want i to be an unsigned integer

edit: oops u already mentioned that

[–] Kache@lemm.ee 1 points 1 year ago

What? My intuition is there's always gotta be some equivalent nicer refactor that could do away with such an awkward construct.

In what kind of situation would that be totally unavoidable?