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

Pages: 1-4041-8081-

How do you call your functions?

Name: Anonymous 2005-12-07 16:31

A) poststupidshit
B) post_stupid_shit
C) PostStupidShit
D) postStupidShit
E) pss lol
etc

I call them like PostStupidShit or XXX_PostStupidShit where XXX is a module's short name.

Name: Anonymous 2005-12-07 17:28

– completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:

Name: Anonymous 2005-12-07 17:30

post_stupid_shit

Name: Anonymous 2005-12-07 17:35

pooooooooooooooooooooooooooooossssssssssssssssssssssssssssssstttttttttttttttttttt________________--------------___________________________stuuupoddddddddddd__________-----Shit

Name: Anonymous 2005-12-07 18:19

F) LikeMyBossTellsMeToo

Name: Anonymous 2005-12-07 18:41

I always disliked postStupidShit; why is the first letter lowercase? That's ugly.

Name: Anonymous 2005-12-07 19:13

>>6
because you're a stupid shit

Name: Anonymous 2005-12-07 19:54

in C, Assembler and T-SQL I call them post_stupid_shit or pss
in C++, C# and VB6 I call them PostStupidShit

Name: Anonymous 2005-12-07 20:30

>>7
I am offended because you've insulted me over the Internet.

Name: Anonymous 2005-12-08 3:55

A - hard to read
B - hard to write
C - is ok
D - perfect
C - is stupid

Name: Anonymous 2005-12-08 3:56

F) POST_STUPID_SHIT

Name: Anonymous 2005-12-08 10:22

>>11

I use that style for constants

Name: Anonymous 2005-12-08 13:09

>>6
Provided your editor doesn't autocomplete such things, you don't have to hold down Shift every time you write a function name, which is win. IIRC, in Cocoa and Smalltalk, the first part of the name also hints at the return type, if any.

Name: Anonymous 2005-12-08 14:52

I use:

#define CONSTANT lol
//This is a comment. I like comments.
/* This is a long comment, only for function headers
 * Lol
 */
type FunctionName(type arg, ...) {
    type variablename;
    PresButan();
    do { //Braces in the same line and separated with a space
        //Try to always use {} even for a single statement, it's useful when you insert code and less error prone
        PresButan(); //Parenthesis next to the name because it's a function
    } while (!(snacks = ReceevSnacks())); //Parenthesis separated because it's a statement
    return snacks; //Return is a statement, no ()
}


>>13
I don't speak Hungarian

Name: Anonymous 2005-12-08 17:31 (sage)

I call them according to the establised conventions of the language I use and the project I participate in.

Name: Anonymous 2005-12-08 18:17

exactly as the haskell gods demand of me... postStupidShit. thou shall have no other style but this style!

Name: Anonymous 2005-12-08 19:31

>>15
So do I, but what when you're in charge of deciding it, or when you're writing your own stuff.

>>16
postStupidShit sucks though, not only it's ugly and inconsistently cased, but what if the function is only one word? post. You can't tell the difference from a variable symbol.

Name: Anonymous 2005-12-09 1:06

>>17 in haskell, there are no variables

Name: Anonymous 2005-12-09 5:56

>>18
The term "variable" is certainly used in Haskell (examine the Report if you don't believe me). It just happens to be closer to the algebraic concept of a variable than in imperative languages.

Name: Anonymous 2005-12-09 6:29

Java style:

fooBar //a variable
fooBar() //a method
FooBar //a class
FOO_BAR //a constant

Name: Anonymous 2005-12-09 7:39 (sage)

postStupidShit, of course

Name: Anonymous 2005-12-09 16:17

>>19

arguments, parameteres, constants, but certainly not variables!!!

unless you use unsafePerformIO

Name: Anonymous 2005-12-09 18:03

>>22
You're using the terminology of imperative languages there. Let me say it more clearly: "variable" means a symbol bound to a value, it does not imply that the value can change in the middle of a function.

foo :: Num a => a -> a
foo x = let y = x*x in y*y

foo is a variable (which happens to be bound to a function \x -> let y = x*x in y*y)
x is a variable, bound to whatever you use as argument when calling its function
y is a variable, bound to x*x
a is a type variable, bound to whatever instance of the Num typeclass the argument has

http://haskell.org/definition/

Name: Anonymous 2005-12-10 2:10

those are clearly parameters, not variables

Name: Anonymous 2005-12-10 9:49 (sage)

My bad. Arguing on the internet, what was I thinking

Name: Anonymous 2005-12-10 18:13

>>15
I agree.  Java methods are always camel case, C# methods are always Pascal case, etc..  Even when writing on your own there is still a good chance you'll be using libraries and frameworks and they will all be using the proper casing.  So you'd end up mixing within the same code otherwise.

One neat thing I've encountered in naming, though, is that you can have ? and ! in Ruby method names.  ? is usually used when returning a boolean while ! is used when modifying an object.

Name: Anonymous 2005-12-10 18:19

>>20
Agree

Name: Anonymous 2005-12-11 7:20

>>26
One neat thing I've encountered in naming, though, is that you can have ? and ! in Ruby method names.  ? is usually used when returning a boolean while ! is used when modifying an object.

That's the Scheme convention.

Name: Anonymous 2005-12-22 19:59

Let's not have an indent/naming war here, OK?

That said, in C and C++ I use function_with_many_words(...), C# it's ClassName.ToString(...) (i.e. camel case), in Java it's methodWithManyWords(...). Goes with the language actually. Haskell, same as Java (with less punctuation of course).

Is there any other way to go in Lisp than function-with-many-words? Schemers need not apply -- that shit's gay.

Name: Anonymous 2005-12-26 17:10

if( yourFunctionHasMoreThanFourWords() ) {
   getABetterVocabulary();
}

Name: Anonymous 2005-12-27 14:15

SystemTimeToTzSpecificLocalTime()
//Actual Win32 function

Name: Anonymous 2005-12-27 17:18

Tz?

Name: Anonymous 2005-12-27 17:39

Time Zone

Name: Anonymous 2005-12-27 21:23

I wish it was called SystemTimeToTimeZoneSpecificLocalTime()

Name: Anonymous 2005-12-30 7:25

if(iagsf() == true){
  fdija();
}

Name: Anonymous 2005-12-30 9:47

God I hate it when people compare expressions to true.

Name: Anonymous 2005-12-30 15:19

if(iagsf() != false){
  fdija();
}

Name: Anonymous 2005-12-30 17:03

witty

Name: Anonymous 2005-12-30 17:57

if((iagsf() == true) and (iagsf() != false)){
  fdija();
}

Name: Anonymous 2005-12-30 18:48

too far

Name: Anonymous 2005-12-30 18:50 (sage)

can be further..

Name: Anonymous 2005-12-30 22:58

fgsfds();

Name: Anonymous 2006-01-03 13:45

if i have to insert some code for debugging purposes or am writing some really worthless one-use stuff it usually looks like this:
fuck = shit*2;
while(faggots--) {
  asshole(shit);
  fuck += you;
}
print "suck a dick:" + fuck + "," + you;

Name: Anonymous 2006-01-03 16:01

i called one of my functions shitFuckingBlowsUp because it used unsafePerformIO... also sometimes i call my function tut, tutut, tututut,... when it gets too long I call them toot, toottoot,... and variations.

Name: Anonymous 2006-01-03 20:56

>>44
Your job position at maintenance is secured. We don't want it.

For debugging purposes I just use obfuscated code and vowel variables.

I did use swear words in some code, but it was something like

if (i < STUFF_MIN || i > STUFF_MAX)
    idiot = true;

then later I'd check for idiots.

Name: Anonymous 2006-01-03 22:50

>>44
Why did you use unsafePerformIO?

Name: Anonymous 2006-01-04 19:28

>>44

Remind me to never, ever, ever work with you or on any code you've written.

Name: Anonymous 2006-01-05 16:42

>>44
You dirty, dirty boy. Just wrap your crap in an IO monad like the rest of us do and stop having pretensions about doing computation when it's really I/O.

Name: Anonymous 2006-01-06 3:31

doStuff();

Name: Anonymous 2006-01-06 7:33 (sage)

>>2
Objective C for teh win!

Name: Anonymous 2006-01-07 11:22 (sage)

>>50
what is the difference between that and regular C? From my understanding OO concepts are not language dependant so why does objective C exist? I've also never used it and google doesn't work for me. Actually no, I'm just lazy to look it up.

Name: Anonymous 2006-01-07 13:46

>>51
Why does any language above assembler exist? Because it's easier to have the compiler and runtime do some of the grunt work for you.

Name: Anonymous 2006-01-07 14:42

>>51
It's Smalltalk with C syntax.

Name: Anonymous 2006-01-07 15:26 (sage)

>>52
DQN does not know the answer but tries to appear knowledgeable
>>53
Wins.

Name: Anonymous 2006-01-07 15:57 (sage)

>>53
Smalltalkers hate when you say that.

Name: Anonymous 2009-01-14 4:36

>>1
Whatever is shorter and readable.usually no mixed case or _

Name: Anonymous 2011-07-20 22:15

jljkljklñ

Name: Anonymous 2011-07-20 22:19

GNU style.

Name: Anonymous 2011-07-20 22:56

(define (post-stupid-shit)
  (post "stupid shit"))

Name: Anonymous 2011-07-21 0:06

post_stupid_shit

Name: Anonymous 2011-07-21 0:28

(defun post-stupid-shit ()
  (post stupid-shit))

Name: Anonymous 2011-07-21 3:55


(defun post-stupid-shit ()
  (post (shit :type 'stupid)))

Name: Anonymous 2011-07-21 5:01

I prefer anonymous functions.

Name: Anonymous 2011-07-21 5:12

PLEASE_DO_POST_STUPID_SHIT();

Name: Anonymous 2013-08-24 14:41

Here is 2/3 wisdom.

Name: Anonymous 2013-08-24 15:04

CamelCase is Enterprise quality.

Name: Anonymous 2013-08-24 16:21

postStupidShit

Name: Anonymous 2013-08-24 16:22

D.

Name: Anonymous 2013-08-24 17:12

pSS

Name: Anonymous 2013-08-24 17:23

Ahem.  I call my functions by providing the function name, followed by a parenthesized list of arguments!

*cheering and laughter*

Name: Anonymous 2013-08-24 17:26

>>71
That was my first thought.

Name: Anonymous 2013-08-24 17:55

>>71
i prefer (f args...) because I am a Jew. I bet you use commas too, ya dumb goy!

Name: Anonymous 2013-08-24 20:58

C)

Name: Anonymous 2013-08-25 3:27

C: postStupidShit
Java: pss
Python Post_stupid_shit
Javascript: p

Name: Anonymous 2013-08-25 5:25

postStupidShit

Name: Anonymous 2013-08-25 6:33

f(x)

Name: Anonymous 2013-08-25 6:35

>>77
>>>/sci/

Name: Anonymous 2013-08-25 8:48

>>77
DONT YOU MENA (dy/dx)'(x)dT

Name: Anonymous 2013-08-25 10:22

(defun post-stupid-shit () ... )

Name: Anonymous 2013-08-25 10:29

POStStuPidshIt()

Name: Anonymous 2013-08-25 12:19

>>78
Nice imageboard-style redirection. I bet you don't even know /sci/ is a textboard.

Back to /g/ ``please''!

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