He uses one letter variable names

>He uses one letter variable names
Outside of a temp variable for incrementing (i++) why the would you ever do this?

c for a character

The meaning of code comes from understanding the purpose, not the implementation.

all of my functions are very small, so it's easy to discern the variable names

because i cant be bothered typing out kCMSampleBufferConduitNotificationParameter_UpcomingOutputPTSRangeMayOverlapQueuedOutputPTSRange

you want to focus on the abstract form... not the concrete things. terse notation is a powerful thing
(~R∊R∘.×R)/R←1↓ιR

Because real men have only 26 variables or less and also they must all be global.

int subtract(int minuend, int subtrahend) {
return minuend - subtrahend;
}

or you could use a and b like a normal person

That is fantastic if you're an Elder Greybeard. But what about the rest of us who have to work on your code? At least if you are still working we can ask you questions if we don't understand something. But if are retired then we are screwed (by screwed I mean we have to take even more time de-scrambling your elegant and terse code).

Surely there can be some sort of compromise. Something between stupidly long and one character...along with adequate comments.

>But what about the rest of us who have to work on your code?

Why should I teach bad habits?

You type the first 2-3 letters and autocomplete the rest.
Small functions like makes sense though. One letter variables might be easier to understand than something longer.
Another example would be
struct point {
int x;
int y;
};

This makes a lot more sense to use pos.x than post.first().

ha detec
he subtrac

my editor doesnt have autocompletion

Then add it or switch editor.
Programmers shouldn't type.

this is so true. i cant use an editor without a somewhat smart auto-complete.
i want to think about abstract constructs, not typos

compiles faster

I don't even type out for loops anymore.
I have transcended syntax with my use of snippets

the extra ms (or even sn) wont be distinguishable from random noise, so no significance

Same reason I occasionally omit parameter names in function declarations. Namely, the purpose of a variable is sometimes implied by its type.

Consider the following C function:
int tree_size(struct tree const *);

I would then begin the implementation as follows:
int tree_size(struct tree const *t) {


There's no good reason to call the parameter anything more verbose in the definition, for the same reason there's no good reason to call it anything at all in the declaration: it would be redundant. The function is called tree_size, so if there's a parameter of type struct tree const *, that already tells us everything we need to know. What's the parameter? It says right there in the type: it's the tree. And what do I mean "the" tree? Well, the tree in question, obviously. The tree in question of what, you might ask? Of tree size, of course--that should have been obvious from the fact that the function is called "tree_size".

So, as you can see, using an uninformative variable name is the most reasonable course of action in such a case, because there's no missing contextual information left for the variable name to hypothetically inform us *of*.

Saving hard drive space, compiles faster, and makes the code more readable as it's shorter. If you're too much of a brainlet to remember a few hundred 1-2 letter variable names you shouldn't be writing software.

sarkasm doesnt work on the internet, friendo :^)

I feel guilty giving any name at all to variables in cases like this. Languages should support de Bruijn indices for arguments.

subtract = λ λ (- 2 1)

>implying you'd notice a difference in compile speed
>implying people don't use 1TB+ hard drives

People do this?

Every bit helps. Same reason I don't use comments.

I feel you bro, that's why I wrote all my programs directly to binary

I don't even use an operating system. Takes up too much HDD space.

Maybe you're writing one of those obfuscated Java diarrheas that downloads even more diarrhea

in hasklel you could use eta reduction to write it like subtract = (-)
using that pointfree style is not always that simple unfortunately

If that is how you actually code I would not want to be your colleague. I would rather someone write code with descriptive names than preface every function with a 10 line block comment explaining what their shitty function is supposed to do.

apart from that guy being definately a troll

don't compilers convert the variable names to some numeric representation like de brujin indexes anyway, so this has no influence at compile speed at all?

anyway for me it greatly depends on how i name things, local variables usually get shorter names or just derived names (in java eclipse completes the variable name to the class name anyway), temp variables are always something like tmp or some one letter code, and in functional languages i often just use the first letter of the type i'm throwing around

The variable names still have to be read in.
So it does technically make it "slower".

q for queues , x or y for whatever for math functions. There are plenty of reasons.

fat mess. jeb is a fat. mess.

you fucking nigger
i can't be bothered READING a variable name like that

BECAUSE YOU WANT YOUR CODE TO BE MAINTAINABLE BY ONLY YOU AND PEOPLE WHO HATE THEMSELVES

x,y,z,w,a,b,l,r use them all the time

Long variable names fuck with the structure of your code. Short variable names make mathematical formulas easy to recognize. Why do you think mathematicians use single characters for everything? It's to preserve STRUCTURE, since your brain is made to recognize PATTERNS. In small scopes, short variable names are best practice.

Job security?
If it's so inane and impossible to decipher what it's doing and variable names are retarded but it's key to some dumb part of work, you'll be the only one able to maintain it.

You'd be a bad person though.

t. smug Perl dev

>not coding in Hungarian Notation

Get off my board.

I use one letter functions for prototypes in JS because uglifiers don't touch those, only if the function is used a lot.

local f = CreateFrame("Frame")
f:RegisterEvent("EVENT")
function f.EVENT()
--do stuff on event
end

if i use a frame only for handling events, f is enough.

Yes. Job security through obscurity.

How do I implement a subtract function without calling - operator?

void _updateLabel(){
int i = 0;
int ii = 5;
int iii = 0;

while(i < ii){
Label.GetComponent().text = iii.ToString();
i = i + 1;
iii = iii + 1;}
iii = 0;}

Yeah, a bad person with a job.

N for maximum count
n for current count
i for iterator
c for character

Add the complement

stop it right fucking now you pajeet

If you can type only 2 or 3 letters and autocomplete the rest, then the variable name can get away with being only 2 or 3 letters long.

Leave a comment by the first occurrence explaining the variable in detail if it would otherwise need a long name. Later references can have a comment to the line and file of the proper explanation. If the variable is used frequently enough, these extra comments shouldn't be necessary because the variable is so critical to the function/program it should be intuitive for the reader.

That being said, the name should still be short but readable. xyz serves no value as a name, even if is constantly used.

x, y, and z are acceptable for spatial coordinates
u and v or s and t are acceptable for texture coordinates
r, g, b, and a are acceptable for colors

inline assembly

If the shannon entropy of your codebase/language is such that autocomplete is routinely producing helpful results, your program isn't concise enough and your language isn't expressive enough. Stop vomiting up autogenerated diarrhea, someone might have to read it eventually.

To bad no one wants to be reasonable (or considerate).

>he doesnt use just one variable in the whole system changing the dataype as you progress through the code
more variables=more system ram consumed. this is basic shit Sup Forums