Welcome to Gaia! ::


Invisible Noob

I do this kind of stuff to screw with whoever is grading my code quite often, but never to this extent. Wow.
there's something really unwholesome about a random function that returns void.

Invisible Genius

It's beautiful, brings a tear to my eye.
Angdrana
It's beautiful, brings a tear to my eye.
Should have send a poet, eh?

Sparkly Vampire

7,400 Points
  • Invisibility 100
  • Risky Lifestyle 100
  • Brandisher 100
Reminds me of most code that I look at that is not mine.

There is a lot of code by a few people that isn't like this... but eh... after a while. It all starts to look like this.

But then, most people don't download the Links2 Source for the purpose of patching it to actually be able to not entirely suck on the modern internets.

Dapper Genius

I wonder what if I tried to code like this and submit it to the UVa Online Judge. lol

Disconsented
Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
My theory is that it's probably a practice carried over from learning algebra. I've never seen any algebra textbook use more than a single character to denote a variable.
The Deuteragonist
I wonder what if I tried to code like this and submit it to the UVa Online Judge. lol

Disconsented
Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
My theory is that it's probably a practice carried over from learning algebra. I've never seen any algebra textbook use more than a single character to denote a variable.

That actually makes sense!

Conservative Explorer

He was probably doing the same thing people who write terrible kids movies do.
Take a bunch of Quaaludes and start typing random crap.
The Deuteragonist
Disconsented
Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
My theory is that it's probably a practice carried over from learning algebra. I've never seen any algebra textbook use more than a single character to denote a variable.
In mathematics, there are conventions: For example, "𝑥" is typically used as a placeholder for a general unknown quantity. "𝑑𝑥" is not a variable, but rather denotation of a derivative, as in Calculus. "𝑖" is used to denote the constant √-1 or, along with "𝑗" and "𝑘", to denote a variable subscript. "𝐴" is almost always used to denote a set. And so on.

In programs, "i" is frequently used to denote an iterator of some kind. "x", "y", and "z" usually denote 3D spatial coordinates. ... But little else is common. When someone uses a single-character variable name in a context that is not purely mathematical, particularly in matching the values described by a well-known equation, they're being stupid and lazy.

Dapper Genius

psychic stalker
The Deuteragonist
Disconsented
Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
My theory is that it's probably a practice carried over from learning algebra. I've never seen any algebra textbook use more than a single character to denote a variable.
In mathematics, there are conventions: For example, "𝑥" is typically used as a placeholder for a general unknown quantity. "𝑑𝑥" is not a variable, but rather denotation of a derivative, as in Calculus. "𝑖" is used to denote the constant √-1 or, along with "𝑗" and "𝑘", to denote a variable subscript. "𝐴" is almost always used to denote a set. And so on.

In programs, "i" is frequently used to denote an iterator of some kind. "x", "y", and "z" usually denote 3D spatial coordinates. ... But little else is common. When someone uses a single-character variable name in a context that is not purely mathematical, particularly in matching the values described by a well-known equation, they're being stupid and lazy.
Well yeah. I guess I should've been clearer: I was referring specifically to middle/high-school algebra word problems found in textbooks, where the given solution would almost always use single letters to represent unknown variables. (Stupidly easy) Example: Alfred has twice as many marbles as Betty. Betty and Alfred together have 27 marbles. How many marbles does Alfred have? Solution: Let a (or x) denote the number of marbles Alfred has, and b (or y) denote the number of variables Betty has... a chosen, of course, because Alfred, and b, because Betty.

There is some purpose to it. After all, the concatenation of two variables is taken to denote multiplication, i.e. xy = x × y, and no one wants to use the times sign so familiar to arithmetic due to its resemblance to the commonly-used "x" and association with the vector cross product. You may see a subscript or two on occasion, but really, I think I've only seen those in Olympiad-level training materials and physics books, and there is usually no way to "legitimately" use a subscript in a programming context (i.e., a2 won't have the same effect).

Unfortunately, people who have been used to the idea of a variable being a single character in algebra may be a bit shocked at the use of multiple-character variable names in code, and may take a while to adjust fully. I wouldn't be so quick to write these people off as "stupid and lazy"; I'd rather think of them as victims of prevailing pedagogical/notational conventions.
psychic stalker
The Deuteragonist
Disconsented
Can somebody explain to me why people use single letters for variable names, I've always been under the impression that it is good practice the have the name relate to its purpose.
My theory is that it's probably a practice carried over from learning algebra. I've never seen any algebra textbook use more than a single character to denote a variable.
In mathematics, there are conventions: For example, "𝑥" is typically used as a placeholder for a general unknown quantity. "𝑑𝑥" is not a variable, but rather denotation of a derivative, as in Calculus. "𝑖" is used to denote the constant √-1 or, along with "𝑗" and "𝑘", to denote a variable subscript. "𝐴" is almost always used to denote a set. And so on.

In programs, "i" is frequently used to denote an iterator of some kind. "x", "y", and "z" usually denote 3D spatial coordinates. ... But little else is common. When someone uses a single-character variable name in a context that is not purely mathematical, particularly in matching the values described by a well-known equation, they're being stupid and lazy.
Lazy? Yes. But i strongly oppose stupid. Maybe we could settle for insane?

Quick Reply

Submit
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum