single lowercase letters.
unless you're writing a library, then it's under_score or GTFO. or i'll just use the amazing power of #define to make your shit readable...
Name:
Anonymous2007-05-19 23:15 ID:p5aixpRU
shitCase
Name:
Anonymous2007-05-20 0:08 ID:3D28or/p
Basically CamelCase, with a few extra rules:
1. First letter is only capitalized on classes.
2. Acronyms are fully capitalized if the first letter normally would be; thus HTMLParser rather than HtmlParser for a class, and htmlToXHTML rather than HTMLToXHTML for a function.
3. Constants (or variables which are used as such in languages without support for constants) are all uppercase with underscores separating words, and usually have a prefix for ones which are used for the same things; for example, COLOR_GREEN and COLOR_RED
4. ???
5. PROFIT!
>>6
At least with shitCase you have a reliable measurement of how Enterprise your code is. If you hit shift half a dozen times when typing variable names your shit is well on its way to being Enterprise quality.
>>7
Yeah, but is becoming a furry really worth that?
Name:
Anonymous2007-05-20 1:33 ID:pRuOBKDZ
In C, I use words_separated_with_underscores, both in function and variable names. #define-d things are CAPITALIZED.
In C++, Java and C#, class names are SeparatedWithCapitals. C++ method names with underscores, java method names inDromedaryCase, C# method names like class names. These follow the conventions of the languages' respective standard libraries.
Haskell, which is completely different, gets isDromedaryCase and whatever'' and "foo:foos". More conventions than you could shake a stick at.
Name:
Anonymous2007-05-20 2:51 ID:occE31GR
I've always used shitCase, but ever since I started doing more C shit recently, I find myself using underscores more.
Name:
Anonymous2007-05-20 3:26 ID:T2jka9b0
camelCase looks like this int CAMEL CAMEL = ten;
Name:
Anonymous2007-05-20 4:31 ID:AFVJpLKX
camelCase, pretty much the same as >>5 when working with Java. When working with C or perl i use under_scores for functions and variables.
Name:
Anonymous2007-05-20 5:24 ID:OBPZStZz
I always use the style of the standard library of the language in question (with the exception of C, obviously, where I just use underscores).
functionName
functionName' (strict version)
functionNameM (monadic version)
functionNameM_ (monadic version that returns m ())
variableName
x - single local variable
xs - list
Name:
Anonymous2007-05-20 16:16 ID:yj1oRhxZ
oo-bar "-" is used as a word delimiter
*foo* (global) special variable
foo* slightly different variant of the foo operator
&foo lambda list keyword. These symbols will be in the lambda-list-keywords list.
nfoo (possibly) destructive (non-consing) function
foop predicate (also foo-p); see notes below for when to hyphenate
foof place changing (like in SETF, INCF, ...) (also foo-f)
+foo+ constant, or single CLOS instance
%foo low-level, fast, dangerous function, or Lisp system specific implementation of foo
make-foo create a foo and return it
define-foo (globally) define a new foo (also short version: "deffoo")
with-foo create a dynamic context with a foo
do-foo iterate through a foo
foo-case foo-specific case expression
foo-bar type-slot, converting FOO to BAR
foo-to-bar converting FOO to BAR
thread over.
Name:
Anonymous2007-05-21 2:41 ID:4CnUQKN0
>>16
I don't get why people insist on naming strict versions with the prime. The bit where you want the compiler to be strict for you (ooh, BDSM-tastic!) aside, prime ought to mean that the thingy that was prime'd is substantially different from the one without the prime... like it had a different type or different edge cases or something.
Give me back my "sfoldl" is what I mean, dammit!
Name:
Anonymous2007-05-21 3:46 ID:hEosEiGx
I wish more programming languages supported Unicode.
ﷺ is the ultimate metasyntactic variable.
Name:
Anonymous2007-05-21 4:03 ID:J0SprHEB
I use one true convention:
DEFINE_CONSTANT
ClassName
MethodName
FunctionName
variable_name (arguments, important variables)
i, j, k (loop variables, temporary variables)
Also, braces are like:
for (;;) {
//True braces convention
}
>>21
Argh shitCase is shitty! Don't use shitCase. Plus shitCase considered dangerous: it can't be told from lowercase if the name has only one word. Stupid, ambiguous. Shitty. Hence shitCase. Only Javafags and the like are meant to use it.
>>23
Why the fuck do you mongle your properties? Also shitCase, see above.
All of you OOfags need to stop doing what Javafags do. Consider that Javafags are inherently stupid, therefore their practices not only are not good, but they are probably bad.
>>25 it can't be told from lowercase if the name has only one word.
That's a feature, dumbass.
Name:
Anonymous2007-05-21 18:34 ID:H++qK6Vv
functionname
classname
variablename
Name:
Anonymous2007-05-21 19:13 ID:8DejbGrT
>>25
You haven't listed a single reason why "shitCase" is bad, except this pathetic "U CNT TELL IT FROM LOWERCAES IF U ONLY HAEV ONE WURD!!1" What the fuck? Do words disappear off your screen if at least one letter isn't capitalized? Are you having trouble reading my post because some of the letters are lowercase?
Grow a nutbeard. Then you can come talk to the big people.
Name:
Anonymous2007-05-21 19:58 ID:2P5jPwqO
>>28
Actually, they might just disappear if the code's a total mess and you're editing it with some shit editor that can't do syntax highlighting.
>>29
That's a problem with the programmer, not the naming style.
Grow a nutbeard.
Name:
Anonymous2007-05-22 2:51 ID:3Y0wTIqc
non-breaking spaces should be part of the variables. MUAHAHHAE13,1pm31lisp())()()()(
Name:
Anonymous2007-05-22 15:52 ID:g0bwqPsu
hybrid shitCase for javascript, to use C conventions where possible but maintain consistency with the DOM:
ClassName
functionName
variable_name
CONSTANT_NAME
Name:
Anonymous2007-05-22 16:22 ID:IoV5Gxh2
>>26
That's a bug, dumbass. A property is a property, and a method is a method. You want to tell the two apart. You can't if you use shitcase. Don't come saying verbs vs nouns and all that OOfag bullshit because in real scenarios you just need more words and/or make everything overly verbose (a common OOfag trait).
>>28
shitCase is ambiguous. You use casing to distinguish between different types of symbols. If shitCase looks like lowercase, then it loses its purpose. Why the fuck do you even bother with casing and style and get trolled so hard if shitCase fails to serve its purpose?
Name:
Anonymous2007-05-22 16:23 ID:IoV5Gxh2
>>34
The DOM is nasty, and you want to use its "style"? Enjoy your getElementById.
It's called Hungarian Notation.
Look it up
Use it
Live it
Name:
Anonymous2007-05-23 5:33 ID:coKpcZ0G
>>37
1. It's stupid. If you can't tell the type of a variably by its name, you clearly need a better name.
2. It's fugly to read and type. lpszFuckMyAss.
3. It's unmaintainable. What happens when you change a variable's type or class, or a class name? It's not like your design is so limited that it can't be reused in a slightly different way, right?
"real" hungarian shows the intention for the use of the variable, not the type, which is microsoft's bastardization
Name:
Anonymous2007-05-23 6:48 ID:VWmtKPdG
"real" hungarian shows the intention for the use of the variable, not the type, which is microsoft's bastardization
Actually 'real' hungarian was invented inside MS too. It was invented in the apps department and then totally misunderstood by the OS department. I'm assuming you've read that Joel Spolsky essay too; you just don't remember it very well :P
Name:
Anonymous2007-05-23 8:24 ID:coKpcZ0G
>>42
I suppose the same kind of object would then receive different Hungarian prefixes. If so, then you don't even need Hungarian notation because the prefix will do. I just don't see how Hungarian notation wouldn't be a messy piece of shit to make code ugly and discourage small developers.
Name:
Anonymous2007-05-23 12:47 ID:qm9Vo2GC
In assembler I never used labels, but absolute addresses. I continue the tradition today, by just using numbers for names, i.e. v00000000, v00000001, v00000002, etc. I use this notation for every variable name and label. I also use goto, never use function calls, and make extensive use of global variables, because using the stack is a security risk.
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy