doing things that make me feel gross

(it's

let i = 0;
for (; i<matches[0].length; i++) {
const idx = i + currentSignal.length;
if (matches[0][idx] !== matches[matches.length-1][idx]) break;
}

)

@monorail I think a while loop would be better but I'm not sure I would give enough of a shit in a code review because either way would look Weird

@wallhackio ??? Iterating i over a range of numbers is a very typical use for a for loop, why are you saying that a while loop would be better?!

@alas @wallhackio Oh. Something like this?

[removed because it's full of mistakes and I'm ashamed]

This does make sense from a control flow perspective, sorry for not seeing it immediately

@aescling @alas @wallhackio Oops. I'm stupid. And that's a much easier mistake to make in a while-loop than in a do-loop where for (i=0; /* something */, i++) is the most common idiom

@vaporeon_ @alas @wallhackio but anyway, if you wrote a loop ending in i++ in the body, my furst thought would be “this is a for loop”

@aescling @alas @wallhackio Yes, exactly, I think the thing I typed up with do { ... } while ( ... ); is just worse in this case. Curious how Clodsire would do it differently if he prefers a while loop.

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.