Show newer

@vaporeon_ @Lady @aescling JavaScript will auto insert semicolons if you don't add them

There are camps on whether or not you should manually add them

I think ignoring them makes more sense but it was a style convention at my old job to use them and the Deno autoformatter inserts semicolons so I just write them now out of habit

@Lady @vaporeon_ @aescling I only do that if I start declaring variables in the switchies

@aescling @vaporeon_ I'm sure our elastic search can't break any more often than it already does

@vaporeon_ @aescling I with vaporeon on this, I'm going to ask our admin to ban you

@vaporeon_ @aescling
It's "more performant" to use ++i*

*It really doesn't matter and even if this does give a teeny, marginal performance boost it's the kind of thing a modern compiler will catch for you anyway

@aescling @vaporeon_ I guess I understand the undergrads now because the i++ just made my eye twitch even though it literally doesn't matter

@aschmitz @aescling I like switch statements I just don't understand why undergrad cs students seem to think they're the pinnacle of software design

Everyone used else if at my old job and it was fine.

@vaporeon_ @aescling I would always do it like

switch(gorp) {
case 'norp':
console.log('norp');
break;
case 'sorp':
console.log('sorp');
break;
default:
console.log(' what the gorp???');
break;
}

@vaporeon_ I'll never forget the video when an infamous kickstarter game's source code released and some guy made a 20 minute video critiquing the 4000-line file that managed the entire game state

The YouTubers main criticism was that the file didn't use switch statements

Talk about missing the forest for the trees

@aescling but switch statements add a bunch of indentation so for me it's picking your poison

@vaporeon_ I've seen multiple times where some YouTuber in their first year of their undergraduate CS program is doing some code review and their primary concern is using if else when you could have used switch statements

Like, I like switch statements but who cares

why are undergrads in compsci so obsessed with switch statements

Show older
📟🐱 GlitchCat

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