Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Greetings

Name: Anonymous 2011-09-23 14:48

Poll: Which one of the following variable naming conventions do you prefer?
A. int VariableName;
A. int variableName;
A. int variable_name;

Discussion: Coding style and conventions.

Name: Anonymous 2011-09-23 14:51

The third A.
The first two are far too ENTERPRISE

Name: Anonymous 2011-09-23 14:52

variableName, TypeName in Haskell
variable_name in C

Name: Anonymous 2011-09-23 14:52

first one, hands down

Name: Anonymous 2011-09-23 14:59

2

Name: Anonymous 2011-09-23 14:59

Also, choose one:
A. char* str;
A. char *str;

Name: Anonymous 2011-09-23 15:01


class ThisIsAClass {
    public:
        int ThisIsNotAClass;

        void ThisIsNotAClassEither()
        {
        }
};

...
ThisIsAClass* c = new ThisIsAClass;
c->ThisIsNotAClass = *(new int);
c->ThisIsNotAClassEither = (void(*)())new int; // oh shit nigga what are you doing

Name: Anonymous 2011-09-23 15:05

>>7
what is this i don't even

Name: Anonymous 2011-09-23 15:06

>>6
Is there anyone who uses char* faggot?
char* pig, disgusting;

Name: Anonymous 2011-09-23 15:10

>>7
That last line won't compile I know these things.

Name: Anonymous 2011-09-23 15:48

the third one is just annoying

Name: Anonymous 2011-09-23 15:52

I prefer variable-name. It the most aesthetically pleasing.

Name: Anonymous 2011-09-23 15:52

>>12
fuck you faggot

>>1
variable_name

Name: Anonymous 2011-09-23 15:58

>>9
I think using char* makes it more clear that it's a char-pointer, even though the correct usage is char *, as in char *a, *b;, or char pointer-a, pointer-b;.

Name: Anonymous 2011-09-23 15:58

>>9
>Is there anyone who uses char* faggot?
Yes because it's easy to read.
char* pig;

pig is a pointer to char.

I hate char *pig! *pig is not of type char.

Name: Anonymous 2011-09-23 16:06

>>14
imo, "char* a, b" should create two char pointers. the possibility to create a char and a pointer to char in the same statement is completely unnecessary.

Name: Anonymous 2011-09-23 16:17

Second or first A, depending on whether it is exported or not.

Name: Anonymous 2011-09-23 16:18

>>16
You don't *create* char pointers you fucking mental midget nigger. You *declare* a pointer of type char. You suck. Go help another customer you low IQ bitch.

Name: Anonymous 2011-09-23 16:21

>>18
You are right. But stop being so rude. It doesn't help anything ant it's probably the reason you have no friends and no one wants to talk to you.

Name: Anonymous 2011-09-23 16:25

>>18
Take your damn pills once in a while and learn how to sage you pigfucking cocksucking faggot.

Name: Anonymous 2011-09-23 16:34

>>18
whatever, you know what i mean

Name: Anonymous 2011-09-23 16:46

Choose one:
A:
if () {

} else if () {

} else {

}

A:
if ()
{

}
else if ()
{

}
else
{

}

Name: Anonymous 2011-09-23 17:17

first

Name: Anonymous 2011-09-23 17:18

>>22
A

Name: Anonymous 2011-09-23 17:25

>>22
Is it okay if i choose two?

Name: Anonymous 2011-09-23 17:28

i prefer lisp style


variable-name

Name: Anonymous 2011-09-23 18:00

>>16
Which shows why char * is clearer. char* is not a type and should not be treated as such. char * is a pointer to char.

Name: Anonymous 2011-09-23 18:16

Superior:

if ()
    {
    # do shit here
    }
    else if ()
    {
    # do other shit here
    }
    else
    # do yet still different shit here
    }

Name: Anonymous 2011-09-23 20:05

Expert solution:

Use ``variable_name'' and modify your favourite coding font (or editor code, if you're using a CLI editor) so that it displays ``_'' as an em dash.

Name: Anonymous 2011-09-23 22:56

>>1
In C, I prefer variable_name. I only use capitalization in macros (ALL_CAPS) or typedefs (DataType) and functions using those typedefs (FooType_read() and BarType_read()).
>>6
Definitely "char *str;" because the * is a type modifier just like in "char str[]" or "char (*getstr)(void)", and not part of the base type.
>>22
The first one. But I don't mind other styles as long as they're consistent.

Name: Anonymous 2011-09-23 23:10

public: 
 method-or-variable-name
private:
 __method-or-variable-name
local:  
 variable_name

Name: Anonymous 2011-09-24 2:32

>>30
I love you, even though your opinions differ from mine.
Also, I have always found C's type modifier syntax to be confusing. I think the syntax for declaring a variable should be the same as for typecasting to it, like so:
char* c1, c2; // Two pointers to char
int[20] i1, i2; // Two arrays of 20 ints.
. Oh well, maybe I'm just weird.

Name: Anonymous 2011-09-24 2:39

>>32
Also, function pointer should look something like this:
char(*)(void) getstr;
Or maybe like this:
char(void)* getstr;

That is my honest opinion.

Name: Anonymous 2011-09-24 2:48

>>33
To sum it all up: types first, names second. No confusing bullshit.

Name: Anonymous 2011-09-24 3:26

while we're at the subject of incoherent and inconsistent syntactical design flaws, what's up with having to include headers to use some of the fundamental language constructs in c++? like placement new or typeid, weird!

Name: Anonymous 2011-09-24 4:33

>>1
second
>>22
second
>>6
second

Name: Anonymous 2011-09-25 2:08

>>13
Go away.

Don't change these.
Name: Email:
Entire Thread Thread List