Show newer

@wallhackio @vaporeon_ the equality check on strings in most languages with a string type is an implicit strcmp, yeah. python does this

@vaporeon_ @wallhackio you wanna see some real fucked up shit? switch (true):

  // the navbar links to every chunk of the gallery.
// the current page does not get a link.
// index 0 links to `/`.
/** @type {Node[]} */
const linksByIndex = [];
for (let i = 0; i < chunkedImages.length; i++) {
switch (true) {
case i === chunkIndex:
linksByIndex.push(li({ class: "active" }, `${i + 1}`));
break;
case i === 0:
linksByIndex.push(li({}, a({ href: "/" }, `${i + 1}`)));
break;
default:
linksByIndex.push(li({}, a({ href: `/${i + 1}.html` }, `${i + 1}`)));
}
}

not a serious take 

@wallhackio @vaporeon_

:blobmeow_sadafterreach:​ if else

:blobmeow_sadafterreach:​ switch

:blobmeow_forereach:​ map whose values are the corresponding handler to run

@wallhackio not an undergrad but purrsonally i just despise how if-elseif chains look

@vaporeon_ feels like this shouldn’t be too hard to implement and i’m kinda surpurrised it doesn’t seem to exist yet

@coriander i just reread and misread this toot as saying “piss merchant” and i am now amused at the concept

the thing about @wallhackio showing me gone as my furst hyperpop-era charli xcx song is that she might not have ever topped it

Show older
📟🐱 GlitchCat

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