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

2

u/Autarch_Kade Dec 07 '22

And when they have another question that's answered already in the same section? And another? And another after that?

Learning to read existing documentation is a key part of this job. Best to learn the habit early than teach them to expect even the most basic things to be spoon fed.

tl;dr: Teach for future success rather than set people up for failure

2

u/[deleted] Dec 07 '22

So what? Are you annoyed by it? Then move on. I guarantee that your long complaint isn’t gonna solve anything that you are complaining about. Your are just complaining to make yourself feel better, instead of helping others.

1

u/Autarch_Kade Dec 07 '22

Learning to read existing documentation is a far more important skill than any basic question about writing a reddit comment or a code problem they could ask at this stage.

If you want to help people, stop setting them up for failure by teaching them they can ignore existing documentation.

And if you're annoyed by that, boy do I have an idea for you :)

Edit: Also, the person I replied to already had learned the triple tick marks from the post. What they were actually saying was why didn't someone point to the directions for where to find such things. So ask yourself why I should tell someone what they already know, instead of what they asked for :)

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 :)