Off Topic > Off Topic
Programming Megathread
<< < (127/241) > >>
Foxscotch:
do you really write it like that, with no indentation? or is that a problem with the website? I can't tell what's what without looking at it for five minutes
and you don't have to define SUM after main. you can just define it at the top where you already have the prototype of it. you only have to bother with those if you have two functions that need to call each other, and even then it doesn't need to be above main. some people prefer non-main functions to be below main, but personally I like main to be at the bottom
--- Quote from: Ravencroft· on May 03, 2016, 08:24:16 PM ---How do I fix that?

--- End quote ---
uh... by calling it in main
just a shot in the dark, but it looks like what you're probably supposed to be doing is using SUM to find the average. so instead of
AVG=(NUM1+NUM2+NUM3+NUM4+NUM5)/5;
you'd use
AVG = SUM(NUM1, NUM2, NUM3, NUM4, NUM5) / 5;

also what's with all the caps? is your teacher telling you to do that?
SetGaming:
imo it looks neater to use parenthases when dealing with multiple actions at once

for example:


--- Code: ---public static float Foo (float bar) {
    return (bar / 255f);
}

--- End code ---

looks much better to me than


--- Code: ---public static float Foo (float bar) {
    return bar / 255f;
}

--- End code ---
McJob:

--- Quote from: Foxscotch on May 03, 2016, 04:15:53 PM ---also, that comment looks like a huge hassle :<
I like sphinx's autodoc format for python

--- End quote ---
I work entirely in Visual Studio, and that's the format they specify for adding comments and describing parameters for Intellisense.
Headcrab Zombie:

--- Quote from: McJob on May 03, 2016, 08:42:48 PM ---I work entirely in Visual Studio, and that's the format they specify for adding comments and describing parameters for Intellisense.

--- End quote ---
Yeah, this, you just type /// and VS automatically inserts a template for the comments, with the summary, params, and returns blocks
Ravencroft·:

--- Quote from: Foxscotch on May 03, 2016, 08:31:37 PM ---do you really write it like that, with no indentation? or is that a problem with the website? I can't tell what's what without looking at it for five minutes

--- End quote ---
What would I indent? The professor has provided zero lecture notes involving formatting.

--- Quote from: Foxscotch on May 03, 2016, 08:31:37 PM ---also what's with all the caps? is your teacher telling you to do that?

--- End quote ---
My professor always uses caps when naming variables and functions in example program notes, so it became a habit for me.
Navigation
Message Index
Next page
Previous page

Go to full version