Fun Fact : Why do programmers love using "i j"... but not "p q" for loop ?
Image: canva

Fun Fact : Why do programmers love using "i j"... but not "p q" for loop ?

It's not just a keyboard coincidence! In the world of code, "i" and "j" are the dynamic duo of loop counters, while other keywords like "p" and "q" rarely get invited to the party.

Why the favoritism?

1. Old School Cool: "i" and "j" have been loop buddies since the early days of programming, building a strong tradition that sticks.

2. Brevity is Key: Short variable names mean faster typing and clearer code. Who wants to type "please" and "queue" when you can whiz through "i" and "j"?

3. Hidden Meaning: Sometimes, "i" whispers "index" and "j" murmurs "inner layer," giving programmers subtle hints about the loop's purpose. P and Q? Not so much.

4. Community Cues: Using "i" and "j" is like speaking the secret language of programmers. It shows you belong to the tribe and understand the code-talk.

So, next time you see some "i j" action in your feed, remember - it's more than just letters, it's a programmer's inside joke, a nod to history, and a symbol of efficiency. And who knows, maybe someday "p" and "q" will get their chance to shine in the loop spotlight!


要查看或添加评论,请登录

社区洞察

其他会员也浏览了