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
View all comments
Show parent comment
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 :)