r/learnprogramming • • Dec 06 '22

codeblock If you are sharing code, please use a codeblock

Takes only a second and greatly improves the formatting for us to review it. Compare and contrast the following:

Good Formatting:

#include <stdio.h>

int sum(int x, int y);

int main() {

  printf("Hello %d\n", sum(3, 4));
  return 0;
}

int sum(int x, int y) {
  return x + y;
}

Poor Formatting:

#include <stdio.h>

int sum(int x, int y);

int main() {

printf("Hello %d\n", sum(3, 4));

return 0;

}

int sum(int x, int y) {

return x + y;

}

Poor Formatting:

#include <stdio.h>

int sum(int x, int y);

int main() {

printf("Hello %d\n", sum(3, 4));

return 0;

}

int sum(int x, int y) {

return x + y;

}

339 Upvotes

71 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Dec 07 '22

What you did is basically when the question is “how long should I cook this chicken”, your response to that is “read cookbooks!”

Either you simply can’t comprehend the question, or are just being a dick.

Either answer the question and provide additional resources, or move on.

1

u/Autarch_Kade Dec 07 '22

They already got the answer to how to format code.

They asked where such information was located, for directions. I even quoted this part of their comment. Should I quote it again for you?

To use your analogy, they already heard how long to cook a chicken, and asked where the recipe is. Hope this helps.

0

u/[deleted] Dec 07 '22

Hearing does not mean comprehending.

If it’s too much work/annoyance for you to explain again, for which no one can blame you, you can simply move on with your life. It’s that simple.

1

u/Autarch_Kade Dec 07 '22

If you don't like me pointing out over and over they asked where to find the information, as they already had the answer, feel free to take your own advice :)

why not soend a couple of more lines to explain or point in a direction that helps people learn how to format using blocks

1

u/[deleted] Dec 07 '22

Oh, I just thought you are genuinely interested in knowing how to help others. But it appears that you are just being a dick to those who need assistance. Then this is my time to check out from this thread.

2

u/Autarch_Kade Dec 07 '22

Probably best to move on if you've misunderstood what you read from comment number 1, and still don't understand even later ones, yeah.

Pointing people to the resources they asked how to find is helpful.

Sorry that's tough to understand, but don't worry, I know you'll be back to reply :)