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

Pages: 1-

Programming Terms?

Name: Anonymous 2013-07-22 11:36

This is really stupid, and I feel stupid for asking, but I'm going to do it anyway:

Can someone explain programming terms to me? That seems really vague, I know, but I can't seem to grasp this for some reason. I'm currently learning C, and I really don't understand why it's not computing. I get floating point numbers since that's really easy, but everything else is kind of confusing for me.

For instance, function. I really cannot get this. Can a function be anything you name it? Say cool()? Can anyone help me?

Name: Anonymous 2013-07-22 11:48

Valid function name in real languages:
veryCool

Valid function name in academico-hipster-trash languages:
very-cool

Name: Anonymous 2013-07-22 11:49

Name: Anonymous 2013-07-22 11:54

Oh hell, the links may assist me in the most wonderful way.

Name: snake_case 2013-07-22 11:54

>>2

//proper way to write a function
int proper_function_is_always_underscored (int argc, char *argv[]){
//something other system calls
}

Name: Anonymous 2013-07-22 12:00

Your mom is a cosmonaut.

Name: Anonymous 2013-07-22 12:16

For instance Scrum Master, can someone explain this to me?

Name: Anonymous 2013-07-22 12:30

Name: Anonymous 2013-07-22 12:43

The underlying visual problem is the overuse of parentheses, as in Lisp.

Name: Anonymous 2013-07-22 12:43

>>1
A function takes some work to understand.  I'm not sure what parts you're missing, so I'll explain the whole thing.

A "function" is just a piece of code that you can reuse.  This allows you to write a bit of code once and then use it multiple times.  There are two parts to using a function: the place where you tell the computer what it is, and the place where you tell the computer that you want to run that code.  The former is called a function "declaration," because you are declaring your intent, I suppose.  The latter is called a function "call."

The function declaration has four main parts.  These are, in order (I'll explain them one by one)

1. return type
2. function name
3. arguments
4. function body

an example:

int main(int argc, char** argv) {
  return 0;
}

here, the first word, "int" is the return type.  This function returns an integer.  This means that when you call the function it will look like this:

int result;
result = main(0, 0);

Never mind the part in parentheses (it's not exactly valid): the thing to look at here is that you get an integer "out of" the function.

Next, the function name - in this case it's "main."  Easy enough.  When you call it, you call it by name.

Third, function arguments - these are the things in ().  Note that in the function declaration you have to provide both a type and a name for each argument, as if you were passing in a variable.  For example, int argc is an integer with the name "argc."  If you don't know what functions are yet, you probably also don't know about pointers, so don't worry about what a char** is (until later).

Why arguments?  Imagine a function to add two numbers together:

int add(int first, int second) {
  return first + second;
}

This is a stupid function.  Don't write it.  But it is an example.  You can see that you can pass in any numbers to get them added together:

int a, b;
a = add(2, 5);
b = add(a, a);

In this example, a would be given the value 7 (2 + 5), and b would have 14 (a + a or 7 + 7).

Finally, the function body.  Obviously you've seen this by now - it's everything between the two { } curly brackets, or "crazy brackets" as my novice programmer friend calls them.  You can do all sorts of things here: you can have many lines of code, and do lots of stuff.  At the end, you write

return [...]

where [...] contains whatever you want to return.  It should be of the type you defined as your return type, obviously.

Good luck.  C is hard.

Name: Anonymous 2013-07-22 12:50

Where is L.A.C when you need him?

Name: Anonymous 2013-07-22 13:14

a function is a subroutine(a separate piece of code) with optional parameters, that exists in its own stack context( the called function conventionally manages the context: it can do anything). Return from a function, set variable= function return value.
http://en.wikipedia.org/wiki/Call_stack
http://en.wikipedia.org/wiki/Calling_convention
http://en.wikipedia.org/wiki/Subroutine
http://en.wikipedia.org/wiki/Parameter_(computer_programming)
http://en.wikipedia.org/wiki/Name_binding

Name: Anonymous 2013-07-22 15:08

Why ask this here, the answer is all in texts etc. Read the SICP.

Name: Anonymous 2013-07-22 15:20

Why the fuck are you all fuckers replying to this shitfaced nigger?

Name: Anonymous 2013-07-22 16:35

>>14
at least he isn't a kike like you, kike

Name: Anonymous 2013-07-22 16:56

>>15
have you heard those faggots who say homophobia is just a sign of closet faggotry?

guess that, the same applies for antisemitism and you're a gay kike

Name: Anonymous 2013-07-22 17:39

>>16
eat my butt

Name: Anonymous 2013-07-22 17:49

Name: Anonymous 2013-07-22 23:12

a function is like a souped-up procedure.. or a procedure is a function that doesn't return any value..

eg.
void ThreeBlanklines(void){
printf("\n\n\n\n");
}

Name: Anonymous 2013-07-22 23:42

PROGRAMMING LANGUGE

10 YOUR MOM

Name: Anonymous 2013-07-23 6:57

>>9
The underlying visual problem is the overuse of braces, as in all C-like languages ever.

Name: Anonymous 2013-07-23 7:04

The underlying visual problem is the overuse of indentation, as in Python.

Name: Anonymous 2013-07-23 7:11

>>9,21
1.there are much more parens in LISP
2.there is choice of block separator({ or lisp parens-ridden soup(which is worse than nested ternaries?of course,ternaries can be converted to normal code:lisp code on the other hand remains in the state of nested parens forever)), endblock words(e.g.pig-disgusting End While) or FIOC.
Invent something else if you don't like it.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-23 7:12

>>19
That's 4, you idiot. Did you skip grade school? You know, where YOU LEARN TO FUCKING COUNT?

Name: Anonymous 2013-07-23 7:16

>>24
Ah, thats horrible, its an OFF-BY-ONE ERROR which immediately leads to memory corruption,crashing and demons coming out of the corrupted terminal.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-23 7:22

I read that as "demos coming out of the corrupted terminal". Sounds fun.

Name: Anonymous 2013-07-23 8:04

The underlying visual problem is the overuse of camelCase as in Haskell and Java

Name: Anonymous 2013-07-23 8:06

>>26
That's 'demons', you idiot.  Did you skip grade school? You know, where you LEARN TO FUCKING READ?

Name: Anonymous 2013-07-23 8:18

>>27

At least those two made a choice. The makers of Zend Framework couldn't make a choice, so they used both camelCase with underscores. Like: Zend_Frame_Work.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-23 8:58

>>28
That would be 'daemons', you idiot. Are you American?

Name: Anonymous 2013-07-23 9:13

>>30
The internet is, as a matter of fact, owned by America. So it would only stand to reason that we use the EnUS spellings of common words. Stop being such a  `high-calibre, daemoniac, paedophilic foetus'.

Name: Anonymous 2013-07-23 9:50

>>31 Are you fucking retarded. In computing a daemon process is called a daemon process, not a demon process.

Name: Anonymous 2013-07-23 10:19

>>32
Process these fucking dubs, asshole.

Name: Anonymous 2013-07-23 10:33

>>24
That's not 4, the first \n goes to a new line, so in the end only 3 lines are blank...

Name: Anonymous 2013-07-23 10:47

>>32
The relevance of this is what?

dem blasted mussulmen wot wot always goin back on deyz agreementz wit da queen wot wot deyve dun robbed us o hunneds o towsends o pownds sterlin wot wot xian slavery n all dat gubna

Name: Anonymous 2013-07-23 12:10

>>28
I lel'd.

Name: Anonymous 2013-07-26 10:13

Free software glossary : http://www.salon.com/2000/03/05/glossary

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