There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmerhumor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Sam , in why not a,b or x,y?

When I’m doing coding interviews I always like to start off and say I’m a big fan of very long variable names. “As descriptive as you can be” I say. Then I get to my first for loop. Instead of i I use “iterator” and then when I start a nested loop I use “jiterator” and it always gets a laugh.

dandroid ,

I used to conduct coding interviews at my old job. If someone came in and had some humor like that, it would be big bonus points in my book. Being someone I would like to be on a team with is very important. Plus, I think it shows confidence and being comfortable in situations that make most people nervous.

Hazama ,

I’ve been at two start ups and they had me interview people. Honestly this is what I looked for. I’d ask basic questions to prove you had an idea about coding, but I can teach someone to code, I can’t teach someone to be someone I like working with.

KairuByte ,
@KairuByte@lemmy.world avatar

You can teach them to code if there is an underlying level of logic to build off. I’ve met a few people in life who I know for a fact will never code, no matter how smart they generally are.

tdawg ,

Honestly finding someone who can relax and intergrate into your team culture is arguably more important that anything

Sam ,

And even if it didn’t help my chances directly like that, even getting a small chuckle would help me be more comfortable and confident.

psysop , in why not a,b or x,y?

I’m honestly prefer short but (usually) complete words. Somewhere along the line I realized that being explicit really helps when you need to change it later.

jdaxe ,

due to convention everybody understands what i and j are, I don’t think they need longer names. If it’s something more complicated than a counter or index then maybe you should be using a foreach loop instead (if language supports it)

psysop ,

I generally use ‘count’ for a counter and ‘idx’ for index.

I’m not using C or Java languages though - if I were I would probably go with the more classic terse approach.

Also, if I’m reviewing a PR and I have to load more of the diff context to understand what a variable represents, then that variable has the wrong name.

LetsGOikz ,

Even as an embedded C developer I use “idx” and “count” instead of “i”. Not just because I’m a member of the “slightly longer but more descriptive names are better” gang, but also for searchability. If I’m trying to track down where an array is accessed in a loop, for example, “idx” is more likely to take me only to the results I’m looking for and not also the “i” in int8_t or whatever.

DScratch , in why not a,b or x,y?

Int index = 0 But you shorten the name to Int I = 0

throwsbooks , in why not a,b or x,y?
@throwsbooks@lemmy.world avatar

I always thought i for index when iterating through an array. Then you can’t use i again in a nested loop so j follows.

Tho sometimes x, y if the array represents coordinates.

Only a maniac would use a, b.

rarkgrames ,
@rarkgrames@lemmy.world avatar

One of the very first lines of code I ever wrote was:

10 FOR a = 1 TO 70

In Spectrum Basic. I do tend to use I these days, I’ve calmed down since my childhood days 😀

dark_stang , in why not a,b or x,y?
@dark_stang@beehaw.org avatar

x is used for map, filter, etc. a and b are used for sorts, comparisons and merges. y might be used if I’m doing multiple lambda expressions (but that means I’m in a bad place already). I have no idea why, but these are firm rules in my brain.

russmatney ,
@russmatney@programming.dev avatar

Yes! I love using x (and xs) for functions over whatever the thing is (or things are).

DogMuffins ,

I’ve gotten used to using the singular form as in…

records.filter((record) => …)

Not saying this way is better but it works for me.

karbonkel ,

I do this too. I hate using just x, because it’s so non-descriptive.

Dirk , in why not a,b or x,y?
@Dirk@lemmy.ml avatar

People who name iterators with one letter have no soul.

lowleveldata ,

two letters it is then

catfish ,

And people who iterate over 3D space using firstDimensionIndex, secondDimensionIndex, and thirdDimensionIndex instead of x, y, z have no sense 😜

Dirk ,
@Dirk@lemmy.ml avatar

x, y, and z are absolutely fine for spatial addressing.

Nausiyan , in Electron
@Nausiyan@lemmy.sdf.org avatar

Yes! Yes! Fricking yes!

Nausiyan , in Hacked together, nonsensical at times, used basically everywhere.
@Nausiyan@lemmy.sdf.org avatar

What is Japanese?

aidan , in Help, I am scared...

Or even worse… Asking for Typescript definitions

Tarzan9192 , in advise

He he he.

MonkCanatella , in Help, I am scared...

My worst nightmare lol

InternetUser2012 , in Companies: "Why do people hate our tech support bots?" The tech support bots:

Working as intended

lockhart , in Largest blue screen of death ever!

Blueballing

vicfic , in Help, I am scared...
@vicfic@iusearchlinux.fyi avatar

Can relate. Made a tiny script manage rendering queue, and some dude made a fully fledged app with GUI and proper integration with the rendering app.

tbh, he could’ve started fresh, but he still used my code. idk.

ICastFist , in thought you stood a chance?
@ICastFist@programming.dev avatar

Lesson learned: aim for the manager spot to order those folks around

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines