Bad advice

Pages: 123
I've recently read the "why's my console closing" thread in the beginner's section, and I was wondering whether the should some moderation or authority so you don't get retards giving idiotic advice to people. Don't get me wrong, I thoroughly enjoyed see Duoas and helios developing anurisms at the sheer amount of stupidity that transpired.
(My absolute fav, this will supposedly make sure the console won't close)
1
2
3
4
5
6
7
8
9
#inlcude <iostream>
#include <conio.h>
using namespace std;
int main ()
{
cout<<"Hello World!\n";
return 0;
}
getch()


I mean honestly, system ("pause"); is more intelligent than that.

I know there are regulars around who try to keep track but there should be a way to tag them, so when they post people know what they say can be (at least somewhat) trusted.

EDIT: fixed a name, my bad
Last edited on
Uh well first off, the person who posted your above snippet has a total of 3 posts. And I'm pretty sure nobody agreed with him.

P.S.
Don't flame
closed account (zb0S216C)
sargon94 wrote:
"I was wondering whether the should some moderation or authority so you don't get retards giving idiotic advice to people."

We all have a life to attend to, so monitoring every thread for bad advice is a no go.

sargon94 wrote:
"I know there are regulars around who try to keep track but there should be a way to tag them, so when they post people know what they say can be (at least somewhat) trusted."


"Tagging" users is a bit humiliating, don't you think?

Wazzak
Last edited on
I think it's fine the way it is.
This isn't facebook or Reddit, tagging people would be counter productive to why we contribute to this site. People come here to learn, part of learning is making mistakes.
so you don't get retards

Watch it.


As for your question, I think some kind of reputation system could solve this problem. Having the ability to +1 a post to increase someones reputation, and then every user receiving a tag based on their reputation (something like "Newbie" or "Guru," for example) could solve this problem. It wouldn't keep out bad posts, but it would allow people to easily distinguish crap posts from good posts.

A lot of forums use systems similar to this, so there's my two cents.
Last edited on
@ascii: sorry should've been more diplomatic (less fortunatly endowed? that honestly just sounds dirty), but anyway, you suggestion's exactly what I'm talking about. We're still gonna get spoonlickers and dadabes, but at least be can tell the difference between sage advice, average personal advice, and trolls (and if you look at my first example, downright [dafuq?[apologise]] advice).
Well, we tend to have more serious people than trolls. And plenty of knowledgeable people who will point someone out if they are wrong. Hell, I call people out even if I'm not sure. Just for some clarification.
I was wondering whether the should some moderation or authority so you don't get retards giving idiotic advice to people.

"We must do something to prevent idiots from giving bad advice... to idiots."
No, we mustn't. Besides, a little workout is beneficial for the common brain.
(My absolute fav, this will supposedly make sure the console won't close)
1
2
3
4
5
6
7
8
9
#inlcude <iostream>
#include <conio.h>
using namespace std;
int main ()
{
cout<<"Hello World!\n";
return 0;
}
getch()



I just read through the Keeping the Console open thread, and I think this one deserves an honorable mention:
1
2
3
4
5
int main () {
    cout << "Blah blah blah"
    while (true) {}
    return 0;
}
Last edited on
Yes, I believe that one was worthy of this:
............................................________
....................................,.-‘”...................``~.,
.............................,.-”...................................“-.,
.........................,/...............................................”:,
.....................,?......................................................\,
................../...........................................................,}
................./......................................................,:`^`..}
.............../...................................................,:”........./
..............?.....__.........................................:`.........../
............./__.(.....“~-,_..............................,:`........../
.........../(_....”~,_........“~,_....................,:`........_/
..........{.._$;_......”=,_.......“-,_.......,.-~-,},.~”;/....}
...........((.....*~_.......”=-._......“;,,./`..../”............../
...,,,___.\`~,......“~.,....................`.....}............../
............(....`=-,,.......`........................(......;_,,-”
............/.`~,......`-...............................\....../\
.............\`~.*-,.....................................|,./.....\,__
,,_..........}.>-._\...................................|..............`=~-,
.....`=~-,_\_......`\,.................................\
...................`=~-,,.\,...............................\
................................`:,,...........................`\..............__
.....................................`=-,...................,%`>--==``
........................................_\..........._,-%.......`\
...................................,<`.._|_,-&``................`\

Honestly, some of these things physically hurt to look at. (partially because I was probably like them at some time, something I wouldn't mind forgetting, ehm)

EDIT: fixed typo

EDIT 2: What's great about that thread is, I used to be really lax as far as system ("crap!") and it's uses, it was what I'de use (or occasionally tell people to use) on code that could never matter in a million years, but now that i've seen... well I'm sure you've all read it at some point, I'm thoroughly against it too.
Last edited on
I don't get it, what's so wrong about system("PAUSE");.
Are you truly worried that beginners who use it when learning the language, would also use it in "professional code"?
Would you rather use input stream hackery?
I think the system("PAUSE") issue is purely to do with the inherent danger involved with using a system call, given how vulnerable they are security-wise.

Yeah, a beginner isn't like to use them in a scenario that will cause them any trouble but, like a few other programming habits, I think it's something that's better off learned early and can be avoided in future, much like goto*.

As for monitoring responses, I think that's a horrendous idea and not really how we do things on these boards. Everyone is entitled to answer a question, just as everyone is entitled to ask. We could implement some sort of +1 system but, as it stands, most people who come on here looking for a solution (and, might I add, genuinely want help, rather than a homework solution) end up getting the help they need.

Bad advice isn't restricted to C++ programming. People give it all over the world in all manner of subjects. Flagging or suppressing this seems a little bit fascist to me.

* Yes, I know there have been instances where goto can be considered useful, though they are few and far between. I'm more referring to the abhorrent way in which goto is used as a method of program control in many beginner posts I've seen on this board.
Last edited on
closed account (z05DSL3A)
As for your question, I think some kind of reputation system could solve this problem. Having the ability to +1 a post to increase someones reputation, and then every user receiving a tag based on their reputation (something like "Newbie" or "Guru," for example) could solve this problem. It wouldn't keep out bad posts, but it would allow people to easily distinguish crap posts from good posts.
Reputation systems are not really any good. People with a good reputation can still be wrong. New forum member can give more accurate answers but ignored because someone with a better reputation gives an less accurate answer.

It is better to encourage a debate rather than trample on the egos.
Honestly, post count is a decent enough hint at accuracy. It may not be perfect (e.g. my post count > Cubbi's), but it generally weeds out the really bad replies.

I do like the reputation system that StackOverflow has, but considering the limited size of our community (20~30 core members?) I think that would be overkill.

Also, considering "bad practices": I think it's good that some of our users are very concerned with this. It's better to teach people the proper way from the start than having to correct their old habits. However, getting overly anal on system calls is, to me, a bit annoying. 99,9% of the people who come on here with questions aren't in a situation where it'll matter. I'd even say that 99,9% of the people who come here will never be in a situation where it'll matter. Especially when it comes to bad practices with no real harm, it often distracts from the main issue of their question.

Lastly, I'd say it's more important to say why something is bad than just saying so. There are great articles on system calls, MD arrays and Dev-C++, for example, but they all could use a little summary at the top. Someone asking how to properly use pointers won't read an entire article on a side-issue.
Bad advice is everywhere and everyone is guilty of giving it at one time or another. Putting any kind of reputation system in place would be putting a label on users which would ultimately discourage the beginners from posting or stop trying to offer advice on things they understand because they would worry if it would be good enough advice to give a +1 vote on their reputation. Also, spoonlicker has shown that if you VPN you could make multiple accounts and up your own reputation so it would become a false reputation.

The forums are fine as is. As for the goofed advice examples, anyone that does them will learn fast that they aren't that good (in regard to the while(true){}) and the other one with getch(); outside the main function should be obvious to even a beginner as it is normally explained that program execution ends at return 0; and won't execute getch();.

Now the method I use is:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>

void pause();

int main(int argc, char** argv)
{
   std::cout << "blah blah blah\n";
   pause();
   return 0;
}

void pause()
{
   char ch;
   std::cout << "Press a key and hit enter: ";
   std::cin >> ch;
}


Of course there are tons of other ways, some better and some worse. With my example you could flush the stream before getting the char to insure that it doesn't accidentally simulate a char being entered.
Last edited on by closed account z6A9GNh0
I think the biggest problem with telling people to use system("PAUSE"); is that sometimes it's *wrong* advice. There are a lot of OS X and Linux users on this forum and if they put system("PAUSE"); into their program, they're breaking it not fixing it. When there are easy alternatives that are platform independent (like using cin.ignore()), system("PAUSE"); is not even worth mentioning.

In regards to reputation, if you're seriously worried about people making fake accounts to +1 answers, rating people by post count would easily work. I don't think I've seen a single poor answer from people with a post count greater than 500, or even 200 really (excluding me, I make a lot of crappy ones), so I see no problem with that system.

Or we could do nothing, because I don't really see this as a problem.
Last edited on
I prefer the following solution (it was posted in the stickied thread discussing the solutions in a slightly different way):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>

using namespace std;

class KeepConsoleOpen {
        public:
                ~KeepConsoleOpen()
                {
                        std::cout << std::endl << "Press ENTER to continue...";
                        std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
                }
} k18237012371260317263;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}


The reasons this is "better" is because:
1. It doesn't require any code change in the actual code, you only have to post the snippet before main().
2. It works even when your program is ended unexpectedly. (Because of an exception, a different return call from your main function or any other reason.)
3. Only enter has to be pressed, unlike the other cin calls usually seen in given solutions (and it doesn't require functions like getch, that are Windows-only).
I don't think I've seen a single poor answer from people with a post count greater than 500, or even 200 really


dadabe (spoonlicker) reached 198 posts before his account was suspended. If an obvious troll like him can get that high, imagine what someone with an IQ over 40 could do.

I think 1000 is a safe number at this point, but even then there are exceptions (*points to self*).
closed account (z05DSL3A)
My biggest problem with using system("PAUSE"); or any of the alternatives is that you should be encouraging the proper use of the tools (IDE, debugger etc.) and not encouraging the OP to fudge the code to subvert the operation of said tool.
Pages: 123