My opinion in variable naming is this
>int someVariable; //God tier
>int some_variable; //Jesus tier
>int SOMEVARIABLE; //Mary tier
>int v; //Judas tier
My opinion in variable naming is this
>int someVariable; //God tier
>int some_variable; //Jesus tier
>int SOMEVARIABLE; //Mary tier
>int v; //Judas tier
Other urls found in this thread:
en.wikipedia.org
twitter.com
Snake is best!
int IIlllIII;
int IlIIlIIl;
int llIIlIlI;
int IIIIIlll;
int IIIIllII;
int lllIllll;
Jesus is God tho
int some-Variable;
Yes and no. Jesus is the son. God is Jesus but Jesus is not god.
UPPERCASE_SNAKE for constants
i, j, x, y, z, tmp and other short names for stuff that doesn't really matter (e.g. indices)
Everything else is mostly language dependent (e.g. java has its own naming convention)
Never ever use shit like the m_ prefix for class members, it's an old practice that is considered retarded nowadays.
*global-variable*
+global-constant+
any-other-symbol
int Peniseater
int dateOfBirth;
Oh...Jow Forums stripped the emojiis out. Mark my words it was hilarious guys
en.wikipedia.org
links are non-directional
Doesn't it still mean that god is all 3 but each individually is not god.
snake_case_or_gtfo
If you used camel case in that variable name you would have saved 3 bytes.
int one = 2;
If it's so trivial that it can reasonably be called just "some variable" I'd probably just call it x. That's rare, though.
My style varies depending on the semantics of the language. In C and sepples, I use k&r style. Very terse internal variables, outward-facing functions get a semantic namespace and a name that clearly describes what they do. Snake the namespaces, concatenate the rest (e.g. namespace_helloworld). In Java/Kotlin, I use highly descriptive everything, camel case for variables and title case for types (ObjectType objectName). In python and rust, I'm less verbose than Java but more verbose than C.
no
I use type synonyms sometimes to make my code more readable. I.e. stuff like size_t, index_t. For identifiers if I’m working on application software on gui stuff I’ll be very verbose on smaller functions I still never use abbrevations. It will just always lead to confusion and look ugly.
int one = 2;
int seven = 3;
int three = seven + 1;
function divideBy(int num){
return num * 23 * one + seven;
}
What does divideBy(three); return?
well camelCase is the convention for JS so i do that
>>//God tier
>>//Jesus tier
FYI you're going to hell for using them in vain
I didn't know fundies frequented Jow Forums
ArrayList anArrayListInstance = new ArrayList()
>you-forgot-kebab-case
int printf
int scanf
int if
int while
int for
PEP8
>$someArray = array();
>$someArray['some_value'] = $value;
>$someArray['arrayValue'] = $arrayValue;
>$some_variable;
>function Foo() {}
>function fooBar() {}
>class FooBar {}
>const SOME_CONSTANT = 'value';
Going by the standard used at my workplace:
Loops or variables used in a very small scope - just single letter
function and variable names - descriptive words in camel case
constants - descriptive words in all caps with underscores between each word
Yeah this guy gets it. Would add that in Java and JS it only makes sense to camelCase but pyhton and sometimes php or C like the_snake.
One
One_1
One_1-1
Etc depending on how nested I am in a parameter. Sometimes itll end up looking like
One_one-one_ONe_ONe-ONe
And of course the second variable would be all 2s
>One_one-one_ONe_ONe-ONe
what the fuck
why can't you use proper variable names?
Nothing because one and seven are undefined
This makes sense to me
like this:
Theorem FixedPoint_C: is_contraction f ->
exists a:X, phi a /\ is_eq (f a) a
/\ (forall b, phi b -> is_eq (f b) b -> is_eq b a)
/\ forall x, phi x -> is_eq
(lim (fun P => eventually (fun n => P (iter f n x)))) a.
187
t. Certified Mensa member
t. enclosed space lead painter
error: initializer element is not constant
But if you could code actually code; 552
pebkac
a,b,c,..,z for storage variables, alllowercase for function variables, camelCase for object instantiation.
based
PEP8
idk about that but this post made me smile
int SoMeVaRiaBLe;
Read a style guide for each language, asshole.
This
It depends on the context and the conventions of the language and field you're programming in, but generally I would reserve capital letters for constants or defs, single letters for index variables and opt for snake case for regular variables if it's my own project.
I prefer snake_case because it's less confusing but generally ill just look at the style standard for the language to keep things as readable as possible for anyone reading my code who has a lot of experience with that language
Nevermind I figured it out.
Public properties
>int SomeName
Private variables, and local variables
>int someName
Iterators
>int n, var item, var feature
this
I use a random combination of all the tiers.
On a sidenote, I don't really get why people seem to think scientists are terrible programmers.
int32_t registers[256];
Its really just lack of expertise in young scientists
Scientists who program tend to have their code introduced to the real world before their skill in coding is fully developed whereas cs students spend years writing bullshit programs and getting good before their code sees the light of day