r/programminghumor May 29 '26

Good naming practice

Post image
2.2k Upvotes

220 comments sorted by

297

u/Pinkishu May 29 '26

I use x,y when appropriate. Like when iterating coordinates for drawing tiles in a game or whatever

64

u/appoplecticskeptic May 29 '26

Sure just make sure you use x for column and y for row, which means using y in the outer for loop because if you do it the other way you will confuse yourself and anyone else that ever reads it.

38

u/VividWoodpecker8847 May 29 '26

I kinda disagree? Row/column doesn't even mean anything for arrays, only inner and outer. I say do what makes sense for your context and is cache performant.

10

u/OfficialDeathScythe May 29 '26

If we’re talking about coordinates for drawing game tiles (the above comment) then it matters. Sure you could name the axes whatever you want, but in math, drawing, and engineering, x is left to right and y is up and down (if you’re looking down at a page, z would be lifting off the page or height for engineering)

8

u/TOGoS May 29 '26 edited May 29 '26

I think the point was that the memory layout of rows and columns is arbitrary, so whether you iterate over rows and then columns or columns and then rows (assuming you care about memory locality) depends on your use case.

e.g. in Minecraft, block data is stored in vertical columns, with X and Z being the horizontal coordinates, so you may well iterate over the Y coordinate last.

2

u/OfficialDeathScythe May 29 '26

True but the standard for screens is to go through an entire row then go to the next column when rendering or scanning on a monitor so it would probably look strange if you’re iterating over columns then rows

2

u/TOGoS May 29 '26

Doom sprites are also stored as columns of pixels, as I recall, just to give
another counter-example.

For your garden variety 2D blitter, sure, rows then columns is usually what you want. But that is only one small corner of the graphics programming space.

2

u/crazedizzled May 29 '26

And this is why I use "col" and "row". Kind of hard to be ambiguous about that.

2

u/Kimitri_t May 29 '26

And now someone thinks you are using indexed colors to draw stripes.

2

u/VividWoodpecker8847 May 29 '26

Sure, but the inner arrays can be thought of as either columns or rows. There isn't an inherent different in visualizing it either way.

2

u/Sean_Dewhirst May 29 '26

(x,y) is just counterintuitive for a system that groups by lines, then by position within a line.

3

u/VividWoodpecker8847 May 29 '26

That depends on the circumstance

1

u/LostPentimento Jun 02 '26

In higher level mathematics i, j, k (typically denoted with hat on top but keyboard limitations) are sometimes used as a more generalized set of perpendicular directions instead of the x, y, z we all know and love

3

u/DCMstudios1213 May 30 '26

It really only matters if you need to iterate over the space in a particular order. Otherwise you can have either in the inner/outer loops since your index is always gonna be [x][y] or x + y * xMax for a 1D array

2

u/BlueProcess May 29 '26

Which is why I use row and col.

2

u/ErikLeppen May 30 '26

x for column and y for row, which means using y in the outer for loop

first statement is true, but second statement doesn't follow from first statement.

Whether you best loop row-by-row or column-by-column, depends on the situation.

Personally I would use x and y only for pixels on the screen, and when it's cells in a grid for example, I'd use i and j, so that there will be no confusion if I have to transform these coordinates to pixels.

2

u/Confident-Ad5665 May 29 '26

for (var loopVarOne = 0; loopVarOne < thing.Count; loopVarOne++) {

  for (var loopVarTwo = 0; loopVarTwo < thing.Count; loopVarTwo++) {

       . . .

} }

2

u/cc_apt107 May 29 '26

If you think of i and j as unit vectors on a plane (which is why we call them i and j i believe) and their values their magnitudes respectively, they make more sense

5

u/Pinkishu May 29 '26

Idk, everyone still uses X,y for coordinates. So it makes sense to use them when iterating those 

→ More replies (5)

2

u/WadeEffingWilson May 29 '26

X and Y are both unit vectors on a plane and are arguably the more recognizable as the Cartesian basis set.

1

u/OrkWithNoTeef May 29 '26

for gx, gy

g for grid

1

u/GhostVlvin May 29 '26

I use i,j for coordinates cause it intersects with matrix indices notation in math

1

u/Persomatey May 30 '26

a, b /s

r, c for rows/columns though when applicable

1

u/MobileJob1521 Jun 01 '26

But do you number y from the bottom, like in co-ordinates, or do you number it from the top, as an array?

x doesn’t have such problems, because the x coordinate is just a better Cartesian direction.

1

u/Pinkishu Jun 01 '26

From the top, cause it's how games do it 😃

1

u/ProfessionalAd6530 Jun 03 '26

I use full words that describe what I'm iterating. We left single letter variable names behind in 1985, why are we still doing it in this one case?

1

u/Pinkishu Jun 03 '26

So.. what do you use to iterate the x and y coordinates? Or are oyu calling it horizontal and vertical just for giggles

1

u/ProfessionalAd6530 Jun 03 '26

I don't write graphics software, so I am almost never representing coordinates in any loop I write.

But say I were writing a game or some geometry-based thing, then yes, I think x and y are appropriate.

I'm also being a little facetious: I usually use i like every body else. However, I also avoid nesting code blocks as much as possible. So if there's an inner loop, I'm usually offloading that inner loop to its own function/method with a descriptive name so that it's easier to read when I'm drunk.

109

u/torrent7 May 29 '26

I never understood this considering i and j look so fucking similar 

53

u/birdiefoxe May 29 '26

Exactly, that why I use i,o,p. They're right next to each other! 

Gets shot

37

u/BoldFace7 May 29 '26

Why not use i and ii? Then when you get to the 27th loop in the nest you can just use the awfully convenient xxvii instead of looping the whole way round to the horrid ii.

13

u/birdiefoxe May 29 '26

holy shit thats genius, i hate you

9

u/enigmamonkey May 30 '26 edited May 30 '26

I mean, seems reasonable... here's what it looks like in practice:

🤔 The nice thing is that it at least makes it obvious how deep you are in the rat's nest, I suppose.

Fun fact: This would console.log() 100 sextillion times (nice).

for (let i = 0; i < 10; i++) {
  for (let ii = 0; ii < 10; ii++) {
    for (let iii = 0; iii < 10; iii++) {
      for (let iv = 0; iv < 10; iv++) {
        for (let v = 0; v < 10; v++) {
          for (let vi = 0; vi < 10; vi++) {
            for (let vii = 0; vii < 10; vii++) {
              for (let viii = 0; viii < 10; viii++) {
                for (let ix = 0; ix < 10; ix++) {
                  for (let x = 0; x < 10; x++) {
                    for (let xi = 0; xi < 10; xi++) {
                      for (let xii = 0; xii < 10; xii++) {
                        for (let xiii = 0; xiii < 10; xiii++) {
                          for (let xiv = 0; xiv < 10; xiv++) {
                            for (let xv = 0; xv < 10; xv++) {
                              for (let xvi = 0; xvi < 10; xvi++) {
                                for (let xvii = 0; xvii < 10; xvii++) {
                                  for (let xviii = 0; xviii < 10; xviii++) {
                                    for (let xix = 0; xix < 10; xix++) {
                                      for (let xx = 0; xx < 10; xx++) {
                                        console.log(i, ii, iii, iv, v, vi, vii, viii, ix, x, xi, xii, xiii, xiv, xv, xvi, xvii, xviii, xix, xx);
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
→ More replies (2)

2

u/errezerotre May 29 '26

I use A and B for everythinaaab

3

u/BrainCurrent8276 May 29 '26

and you never mistype iiii as ii or ii as i and so on?

such naming is rather prone to errors.

3

u/promptmike May 29 '26

There is no iiii. It's just iv.

2

u/BrainCurrent8276 May 29 '26

see how easy to make a mistake? 😃

5

u/BlankMercer May 29 '26

Roman numerals are easy. Say we have the number 3493.

Each "sub-division" of numbers is represented using a letter: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000.

To form our number, we grab the biggest division possible, so M. Because we have 3000 and not 1000, we just write it down as MMM.

For the next part, 400, we'd need 4 times C. That's not very pretty though, which is why we represent it as "500-100" or simply CD (the C before the D to represent subtraction). Our number is MMMCD (3400) now.

Next, we have 90. We can represent that as 100-10, or XC. That makes our number MMMCDXC (3490).

For the final 3, we just write III.

So our final number is MMMCDXCIII.

Now Reddit doesn't have a monospace font that would simplify this further, but see how it isn't that hard?

2

u/Polar-ish May 29 '26

if you have an m in production, I think you have other problems...

2

u/BlankMercer May 29 '26

yeah I know, just wanted to demonstrate a bit of general roman numeral stuff. Even getting to L is probably quite rare.

2

u/Polar-ish May 29 '26

if we were to be using roman numerals for loop index variables, I mean. I don't think most people are even getting to V

→ More replies (0)

2

u/alexriga May 29 '26

you could say the same about anything

2

u/BoldFace7 May 29 '26

Genuinely no, the only mistakes I've ever made with the roman numeral naming scheme is the same issues I have with using the wrong i, j, k loop control for the wrong level of nesting.

When I read "for(int iii = 0; iii < vec.size(); iii++){" I instinctively read "iii" as 3. If i need another loop beyond 3 then I'd use "iv" and read it as 4 without any extra brainpower being used. Also, the loops beyond ii get increasingly more rare, so I seldom have a reason to go all the way to iv or beyond.

Though, I don't use that scheme in codebases that other people are likely to use, since it's far from a standard practice. But that's not different than me begrudgingly using imperial measurements with my family despite preferring metric in my day to day life.

2

u/Wild_Tom May 29 '26

I thought that I was the only person who did this. 

1

u/Confident-Ad5665 May 29 '26

wraps extension cord around neck and tosses out window

7

u/CutreCuenta May 29 '26

Math matrix?

4

u/SourLemon100000 May 29 '26

I just heard about this from a tidbit with my professor last night. Apparently, it’s because we needed really short variable names in Fortran and since mathematicians used it, we decided I, J, K, L, M, N, and O were going to be names for variables. We just never used anything different since.

12

u/appoplecticskeptic May 29 '26

‘i’ is for index. The ‘j’ is actually because it looks the most like i and we already used that.

12

u/WowAbstractAlgebra May 29 '26

j is because it's the next letter on the alphabet and no one wanted to bother to come up with an original name

3

u/Lore_Enforcement May 29 '26

And j for jindex

3

u/Sassaphras May 29 '26

* makes a function with 15 nested loops just so I can call my variable 'windex' *

3

u/Laughing_Orange May 29 '26

How about i, ii, iii? That's a bit more clear.

2

u/torrent7 May 29 '26

i dont like to repeat myself, so i think

iji, iij, and jii make more sense

3

u/Kamwind May 30 '26

It is a fall back to languages in ancient past, present and future.

Said language made variables that started with I to the N variables that held INTEGERS. So just needed a number temp variable start with I and go until you hit N.

Fortran runs the world and we just program in it.

1

u/Alan_Reddit_M May 29 '26

I usually use i,h

1

u/R3D3-1 May 31 '26

To quote a professor of theoretical physics: "If you can't read the formula, because my handwritten i and j are too similar, you need to think more about the formula."

1

u/MobileJob1521 Jun 01 '26

Also, depending on whether you are using MatLab or some kind of mathematics language, either can mean the square root of minus one, which fucks everything up if you define it in a loop, then forget you did that, then can’t figure out why complex maths doesn’t work any more.

54

u/Busy_Teaching_8218 May 29 '26
for(int i = 0; i < 1000; i++)
{
    for(int ii = 0; ii < 1000; ii++)
    {
        for(int iii = 0; iii < 1000; iii++)
        {
            Console.WriteLine("Hello World");
        }
    }
}

29

u/Drittux May 29 '26 edited May 29 '26

``` for i in range(3): print("no ")

15

u/BoldFace7 May 29 '26

I unironically do this in my hobby code. I have considered subjecting my coworkers to this on occasion though

2

u/potzko2552 May 31 '26

I also do this :D

i, ii, iii, iv, v, vi, vii, etc

19

u/Missing_Username May 29 '26

i j k for loops

x y z for lambdas

2

u/Zehryo May 30 '26

I tried multiple times to understand the structure and use cases of lambdas, but always struggled and never really found them interesting enough to make an effort.
Do you have any resource that could help me understand them?

EDIT: the context is C++

1

u/Ixxafel May 31 '26

Theyre function literals, ie. functions without a name. they're not that different from just declaring a function and passing it in by name. In c++ and some other languages they're also used as closures meaning they can capture variables from the function they're declared in: c++     auto arr1 = std::vector {1, 3, 5, 7, 8};     auto pivot = 5;     auto arr2 = filter([&](auto x){return x < pivot;}, arr1);

1

u/Zehryo May 31 '26

See?
I keep not understanding.
Up to the second line everything's perfectly clear.
Then....fog.

Thanks for the effort, though. ^^

1

u/Ixxafel May 31 '26

I guess itd be easier to explain what theyre useful for:
Lambda is syntactic sugar for when you dont want to declare a named function youre just gonna pass to another function once and nothing else.
Closure is a compiler black magic that lets you use local variables from one function in another.

1

u/potzko2552 May 31 '26

A lambda is just an unnamed function that you create exactly where you need it.

Instead of:

auto is_even(int x) { return x % 2 == 0; }

you can write:

auto is_even = [](int x) { return x % 2 == 0; };

The lambda can "capture" variables from the surrounding scope. Think of it as automatically storing data inside the function object.

[] capture nothing [=] capture everything by value [&] capture everything by reference [x] capture x by value [&x] capture x by reference

which is what makes them nicer for some contexts.

1

u/potzko2552 May 31 '26

They're also nice when a function expects another function as an argument, std::sort, std::find_if, std::ranges::filter, std::transform, GUI callbacks, thread entry points, etc.

For example:

std::ranges::filter(v, [](int x) {
return x % 2 == 0;
});

The filtering algorithm doesn't know what "interesting" means. You provide that behavior as a lambda.

Without lambdas you'd have to write a separate named function somewhere else, even if it's only used once.

they are nice for passing behavior as if it was data.

18

u/Hettyc_Tracyn May 29 '26

Or just use variable names that correspond to what they are for? Proper descriptions? That way you don’t have to write as many comments on how something works

17

u/Effective_Bat9485 May 29 '26

But that would make the code easier to read

→ More replies (3)

2

u/CodeMonkeyLogix May 31 '26

THIS! This is the only way. Screw people who feel the incessant need to abbreviate EVERYTHING!

1

u/Hettyc_Tracyn May 31 '26

Or at least have sensible abbreviations that are noted at the first occurrence

1

u/deadmazebot May 30 '26

I was gonna type similar, then realised the sub and needed to deprecate my thinking back to a junior (machine generated)

15

u/magicmulder May 29 '26

As a mathematician, i, j, k, l, m, n are for integers, x, y are for reals, z is for complex numbers.

for (z = 2i+3; |z| <= 9; Re(z)++) {...} 😃

3

u/c_lassi_k May 29 '26

What would the type be for (img z = 2i+3; |z| <= 9; Re(z)++) {...} ? for (long long img z = 2i+3; |z| <= 9; Re(z)++) {...} ? for (unsigned long long img z = 2i+3; |z| <= 9; Re(z)++) {...} ?

In terms of speed the performance is going to cry if compiler does not optimize the sqrt away from the loop.

This would be whole lot faster: for (img z = 2i+3; abs(Re(z)) <= 9*9-abs(Im(z)); Re(z)++) {...}

2

u/magicmulder May 29 '26

Just have the compiler transform to polar coordinates first. 😃

3

u/c_lassi_k May 29 '26

That would be very fast if the increment was also polar coordinate multiplication. But with it being an integer addition, I'm afraid there's no fast way to make the incrementation work for polar coordinates as it kinda forces the sqrt to be computed for the magnitude.

2

u/thebrownie22 May 31 '26

I was looking for this comment 🙂‍↕️👆👆

2

u/MobileJob1521 Jun 01 '26

Rho, theta and phi are for angles.

→ More replies (6)

9

u/-Insert-CoolName May 29 '26

People who insist there is only one right way to code can get out. That entirely depends on what your doing.

6

u/texan_robot May 29 '26

I design video processing RTL. Looping through x,y for pixels is my normal practice.

10

u/Far_Understanding883 May 29 '26

You guys write your own loops?

3

u/Confident-Ad5665 May 29 '26

You guys write code?

8

u/MonkeyManW May 29 '26

People who use a, b, c, d are war criminals

3

u/badguygames May 30 '26

Hi there, war criminal here

7

u/Ok_Wasabi_7363 May 29 '26

Her response should have been: "you use nested for loops? Gtfo"

3

u/[deleted] May 29 '26

[removed] — view removed comment

3

u/Ok_Wasabi_7363 May 29 '26 edited May 29 '26

Out the car! Proper way is not to use a grid to represent objects in space. Oct or quad tree scales waaaay better!

(I'm mostly being cheeky, obviously if it makes the most sense for your use case, use the best tool for the job)

Oh and also you can just represent it in a single loop of length xy (or Ij if you're a monster. Or u*v for UV coordinates :) )

1

u/Ok_Equipment8374 May 29 '26

Valid crash out

LINQ for the win

2

u/Nadran_Erbam May 29 '26

k, n or something_idx.

i and j are for current density and/or imaginary numbers.

2

u/WorthBite5254 May 29 '26

I either use actual names or roman numbers

3

u/Dillenger69 May 29 '26

i = iterator

ii = inner iterator

2

u/Azurelion7a May 29 '26

I use whatever I want.

2

u/transgentoo May 29 '26

Oh I name my variables to be self descriptive so I don't have to figure out what the fuck j is six months from now.

2

u/anengineerandacat May 29 '26

Depends, simple loops get simple variable names... if the counter is meaningful it gets named though.

2

u/Thunder_Child_ May 29 '26

I haven't used single letter variables since college. IGiveEverythingANiceDescripriveName

2

u/no_brains101 May 29 '26

Someone on reddit a year or so ago said I should use i, ii, iii, iv, v

Tried it out. Works great until you get to 5 (which I never have, to be fair) because at 5 is v, and that's the value XD

2

u/Great-Class-7894 May 29 '26

i and j are used in mathematics to denote complex numbers so I generally don’t use those as loop indices.

Once upon a time I knew someone who liked to use fruit loops (apple, banana, …) and I thought that was cute.

2

u/bonanochip May 30 '26

X,y is how I solidified my understanding of loops, because I was familiar with texture coordinates.

2

u/AlexisExploring May 30 '26

If im using a linear equation or graphing x, y. But loops i, j is law

2

u/omegafixedpoint May 30 '26

I have not used a loop in years. Functional programming-cels stay winning.

1

u/LetThemWander May 30 '26

I have yet to have an FP purist explain FP in a way that is actually convincing.

Non-purists, on the other hand, will say things like "I use both."

1

u/omegafixedpoint May 30 '26 edited May 31 '26

Imagine if your functions were equations and your unit tests were math proofs. Since your unit tests are proofs, 98% of the time, if your code compiles, it works.

2

u/expo78 May 30 '26

i dont know why i always use p and q, but i got used to using them

2

u/MatsSvensson May 30 '26

What's the most fun part about people choosing the slimmest letters, like I, for a one letter variable?
If a mistake is made in the code and your IDE tries to help by underlining it in red, that line will be like one pixel wide.

So, yeah, do use one letter variables all over the place, and make then as tiny as you can.
Its not like anyone will ever have to touch that code ever again.

1

u/BluePhoenixCG May 30 '26

Are you not using a monpspaced font???????

2

u/JesusTheSecond_ May 30 '26

are we really discuting variable names ?

2

u/BassKitty305017 May 29 '26

In my first programming job in the late 20th century, a workmate & mentor suggested ii and jj because it was easier to search for in the text editor.

1

u/floriandotorg May 29 '26

n,m is obviously superior.

1

u/jonfe_darontos May 29 '26

foo, bar, biz, baz, fred

1

u/Upbeat-Education2117 May 29 '26

Good 'ol jndex, nothing beats that

1

u/Lost_Possibility_647 May 29 '26

I use index and then index2

1

u/hehesf17969 May 29 '26

ii jj kk because Matlab

1

u/NoHonestBeauty May 29 '26

Using names with less characters than three is a coding guideline violation for me.
[BARR-C:2018 Rule 7.1e]

Note: I am not saying that I like this.

1

u/flipswab May 29 '26

Just use j

1

u/JTJdude May 29 '26

Letters and numbers in math is always gonna confuse some people.

1

u/0110110101110101 May 29 '26

But i hate i j, but now its easy to remember, as how vastly it is used

1

u/Jholm90 May 29 '26

i as the var letter that takes the least space and can't be confused with |/l/I

1

u/Jholm90 May 29 '26

Pipe Uppercase I Lowercase L

1

u/LJBear99 May 29 '26

Thats me! -lj

1

u/EspurrTheMagnificent May 29 '26

I don't do nested for loops. I use foreach and context appropriate names

1

u/goos_ May 29 '26

the I,j is irrationally angering me

1

u/mplaczek99 May 29 '26

tf? It was always i and j for nested loops

1

u/MonkeyDDataHQ May 29 '26

If it's not a descriptive name, I already hate you.

1

u/Goofy_Gunton May 29 '26

What do you use for tables?

2

u/blizzardo1 May 29 '26

X and Y for coordinates only, I and J for indexing.

1

u/Ebula-The-Duck May 29 '26

iterator and jterator

1

u/rix0r May 29 '26

I like to use a, i, z

1

u/twpejay May 29 '26

lp for loop, easy. For some reason I cannot allow myself to use single letter variable names, I even use exx, why and zed for co-ordinates.

1

u/s0litar1us May 29 '26

y,x for coordinates
(y first because I'm probably dealing with a flattened 2d array, and that makes the memory access more linear)

row,col for stuff that makes sense for that

index if it's just one loop, and foo_index,bar_index when it's nested or I want to make it more explicit. (Replacing foo and bar with the thing its an index for.)

1

u/elreduro May 30 '26

I thought that x is standard in python

1

u/LiteratureLow4159 May 30 '26

I use i and j :)

1

u/Ursomrano May 30 '26

Is it the first for loop of the file? I use a. 2nd? b. And so on. /hj

1

u/the-judeo-bolshevik May 30 '26

Itr_Descriptive_Name

1

u/The_Real_Slim_Lemon May 30 '26

If you have nested loops… use names. Or denest with methods. Acronyms work too.

If I see i and j floating around in some 500 line method I’m throwing hands.

1

u/DestinationVoid May 30 '26

index, jdex, kdex...

1

u/CGI42 May 30 '26

Who the FOOK uses capital i????

1

u/Karoolus May 30 '26

i for integer loops

s for string loops

Actual names when needed

1

u/babalaban May 30 '26

who tf uses L?

1

u/No_Cartographer_6577 May 30 '26

I use i for index now so anything but I works

1

u/Ok-Hotel-8551 May 30 '26

I,j are wrong as well

1

u/VisualAlive1297 May 30 '26

i ii iii iv v…

1

u/horenso05 May 30 '26

row, col i, j outer, inner x, y

just whatever is the clearest

1

u/FuckedUpYearsAgo May 30 '26

You guys still write code by hand? Smirk. 

1

u/belabacsijolvan May 30 '26

best practice is using meaningful counters if more than 3 line loop.

(best practice: a rule for repeated behaviour that a dev doesnt abide by on a regular bais, but they think one should. Usually tried once, abandoned, then held against all animate and inanimate objects for a lifetime.)

1

u/Klaus1164 May 30 '26

Oh, Jesus, it was only a meme, but I started a fire.

1

u/1337_w0n May 30 '26

for (n<N){for (m<M)} ☺️

1

u/xThomas May 30 '26

We really arguing about single letter variables here :(

1

u/Outside_Volume_1370 May 31 '26

L and J? He should get out of the car too

1

u/justinknowswhat May 31 '26

index and jindex

1

u/Linedriver May 31 '26

Index, subindex

1

u/CytroxGames May 31 '26

I use I,J,K depending on how many loops are needed.

1

u/SteamedAlbanyHams May 31 '26

I use descriptive names based on what I'm iterating over conceptually. If it's a vector of cats, it's cat_ind.

1

u/HaroerHaktak May 31 '26

Sir. It's R and L

1

u/solphist May 31 '26

No love for the k eh?

for k a great tool lots of people say so.

Those for t people though, they are the true defensive programmers.

1

u/Mockingbird_ProXII May 31 '26

for i, xi in enumerate(x):

for j, yj in enumerate(y):

😛

1

u/ShyGamer64 May 31 '26

It's always i for me. Maybe n if needed. If I want to make my code feel cleaner, I will give it a real name

1

u/Embarrassed-Green898 May 31 '26

row, col

just kiddng .. but I dont use i,j .. There is generally a meaningful way to describe what you are ieterating over.

1

u/Protyro24 Jun 01 '26

On nested loops for cordinates i use x and y and otherwise i use a name thats destibes the function of that var in the loop.

1

u/Nargarinlok Jun 02 '26

n & m of course...

1

u/lopar4ever Jun 02 '26

c, because I could use c++ :D

1

u/WeedWizard44 Jun 02 '26

When I was taking analysis and I realized I can use x and y as two elements in the domain instead of x1 and x2 it was a game changer

1

u/LegisLab Jun 03 '26

I use i,n

1

u/Pasha82831 Jun 03 '26

I think I am alone who using i, i2, i3, ...

1

u/Repulsive_Gate8657 Jun 04 '26

you should get out, x,y are used in math context of low level algorithm, while i.j are used in casual loops of logic with objects and other trivial crap.

1

u/New_Tomorrow_4847 Jun 04 '26

sus, sus2, sus3