Naming Variables
1
Name:
Anonymous
2011-04-06 21:07
I just name them as they come. For example the first one will be something like int one;, the second int two;, etc, etc...
I think it's a pretty good system.
2
Name:
Anonymous
2011-04-06 21:30
x y z w a b c d generic object
xs ys zs ws ls generic collection of objects
i j k l loop indexen
n m i j k l generic numbers
f g h fn fun proc generic procedures
p predicate
r result return value
z generic symbol, used for dispatching
a args generic rest arguments (to be used with apply)
rest xs generic rest
obj generic object
v v1 v2 ... vn generic vector
h generic hash
3
Name:
Anonymous
2011-04-06 21:31
4
Name:
Anonymous
2011-04-06 21:33
spawnMissile m o src dst pl
-> u:[@(newUnit o m) "owner"=0 "tile"=src "disp"=32src "payload"=pl]
v:(dst-src)*32 s:3*u."speed" ttl:v.abs%%s
-> u."anim"=:['missile ttl]
-> u."dir"=:v%%(max ttl 1)
-> order "die" u."id"
-> unitSay "shot" u -> u.placeUnit -> [u@!newUnits]
5
Name:
Anonymous
2011-04-06 21:52
>>2
I think I'm going to use this. Thanks.
6
Name:
Anonymous
2011-04-06 22:29
int a;
char fff;
float asd;
long tits;
7
Name:
Anonymous
2011-04-06 22:46
char mander; float zel;
8
Name:
Anonymous
2011-04-06 22:55
too bad
>>4 is a huge faggot
9
Name:
Anonymous
2011-04-07 0:58
all my variable names are 1 character long because i need to save some bytes
10
Name:
VIPPER
2011-04-07 4:17
>>2
You have solved my biggest problem for me.
Suck my cock.
11
Name:
Anonymous
2011-04-07 9:03
You should use short names for local variables and longer meaningful names for function arguments, global variables and fields of classes.
Method's body should be short, so you may understand meaning of short variable's name easily.
12
Name:
Anonymous
2011-04-07 9:13
>>11
Stop taking it seriously
13
Name:
Anonymous
2011-04-07 9:31
>>12
Stop misunderstanding autists
I'm sure in his mind his comment was a hilarious joke
14
Name:
Anonymous
2011-04-07 9:40
>>13
I didn't considered this as joke.
15
Name:
Anonymous
2011-04-07 9:55
16
Name:
Anonymous
2011-04-07 10:37
17
Name:
Anonymous
2011-04-07 13:22
>>16
WHAT IT'S SUPPOSED TO BECOME THEN?
INDEXOLLOXEN?
18
Name:
Anonymous
2011-04-07 13:46
indexes, indices
I will cheerfully spend literally hours on identifier names: variable names, method names, and so forth, to make my code readable. If you read some expression using these identifiers and it reads like an English sentence, your program is much more likely to be correct, and much easier to maintain. I think that people who say, "Oh it's not worth the time; it's just the name of a variable," just don''t get it. You're not going to produce a maintainable program with that attitude.
It's from Chapter 5 in "Coders at Work", and I happen to think he's right
20
Name:
Anonymous
2011-04-07 13:49
21
Name:
Anonymous
2011-04-07 13:53
22
Name:
Anonymous
2011-04-07 14:11
>>18
INDEXEN! INDEXEN! INDEXEN IS THE STANDARD!!!
23
Name:
Anonymous
2011-04-07 16:13
24
Name:
Anonymous
2011-04-07 16:16
I use self-descriptive identifier names that communicate the purpose for the variable, unless it's just a simple loop variable or array index.
Example:
void logger::report(log_record const& record) {
lock_guard<mutex> guard(mutex_);
for (log_sink& sink : global_sinks_) {
if ((sink.min_level() <= record.level()) && (record.level() <= sink.max_level())) {
sink->consume(record);
}
}
}
25
Name:
Anonymous
2011-04-07 16:21
>>23
I'll go back to /standard/, thank you.
26
Name:
Anonymous
2011-04-07 19:20
noko
27
Name:
Anonymous
2011-04-07 19:21
noko
28
Name:
Anonymous
2011-04-08 11:38
I adhere all my programming to whatever the spec says. Any variable identifiers that aren't spec'd out are given logical names.
29
Name:
Anonymous
2011-04-08 11:43
i name all my variables zoklet please visit
http://www.zoklet.net/
30
Name:
Anonymous
2011-04-08 23:20
I use the lyrics of the song I'm hearing when I need to name it.
31
Name:
Anonymous
2011-04-09 2:03
32
Name:
Anonymous
2011-04-09 2:16
33
Name:
Anonymous
2011-04-09 2:17
>>27
noko static void main(int one, char **two) { ... }
34
Name:
Anonymous
2011-04-09 4:41
>>31
That is True Blackness by Satanic Warmaster.
35
Name:
Anonymous
2011-04-09 9:18
>>31
Industrial noise recording number 30.
36
Name:
Anonymous
2011-04-09 12:57
extern double nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
37
Name:
Anonymous
2011-04-09 13:35
I like to use GUIDs. That way, I can copy and paste code everywhere and not worry about name collisions.
char *a2fca5e1_eb85_4d93_902d_fc9037dc71b0 = "anus";
puts("Hax my %s!", a2fca5e1_eb85_4d93_902d_fc9037dc71b0);
38
Name:
Anonymous
2011-04-09 13:43
>>37
The whole idea behind GUIDs is retarded, incredibly low probability of getting
dubz is still not a zero probability.
39
Name:
Anonymous
2011-04-09 13:45
>>36
__const__
Is this
PYTHON ?
40
Name:
Anonymous
2011-04-09 13:48
___'''python'''___
41
Name:
Anonymous
2011-04-09 13:49
>>38
100% probability of
autism .
42
Name:
Anonymous
2011-04-09 14:40
>>39
extern post /prog/ __attribute__ ((__reply__)) No. ;
43
Name:
GCC FAGGOT
2011-04-09 15:44
>>36
Please optimize your
__attribute__s
!
extern double nan (__const char *__tagb) __attribute__ ((nothrow, const))[1] ; extern double __nan (__const char *__tagb) __attribute__ ((nothrow, const));
-------------------------
[1] http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
44
Name:
VIPPER
2011-04-09 15:50
JEWS
45
Name:
VIPPER
2011-04-09 15:52
JEWS
46
Name:
VIPPER
2011-04-09 15:54
JEWS
47
Name:
VIPPER
2011-04-09 15:56
JEWS
48
Name:
VIPPER
2011-04-09 15:58
JEWS
49
Name:
Anonymous
2011-04-14 17:39
>>/g/16981926
50
Name:
Anonymous
2011-04-14 17:39
>>>/g/16981926
51
Name:
Anonymous
2011-04-14 17:40
>> /g/16981926
52
Name:
Anonymous
2011-04-14 17:40
>>> /g/16981926
53
Name:
Anonymous
2011-04-14 17:43
>>49-52
/backplate getgoes/
54
Name:
Anonymous
2011-04-21 14:20
>>38
You're retarded,
retard .
55
Name:
Anonymous
2011-04-21 16:52
Eh?
Give me a link to pic: "Have you read your SICP today?" -with-the-crazy-trouser-snake-guy !