sytem("pause") whats the big deal?
Author |
Message |
mirhagk
|
Posted: Wed Feb 23, 2011 11:41 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
You guys really don't read my posts do you? I'm not arguing that system("pause") is good, I said that it can be used just for quickly looking at the results. I agreed it should never been in a distrubuted program.
WHAT I'M SAYING IS PEOPLE ARGUE AGAINST IT WITH STUPID REASONS!!!!!!! LIKE SAYING IT'S SLOW, LIKE DAN SAYING USING A BREAKPOINT IS BETTER!!!!!!!!! IT'S BAD!!! I KNOW!!!!!!!!! BUT YOU ARGUE WITH THE WRONG REASONS.
Sorry for the caps spam, but it's the only way you'll read it apparently. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
rdrake
|
Posted: Thu Feb 24, 2011 12:30 am Post subject: RE:sytem("pause") whats the big deal? |
|
|
We read your posts. They are filled with idiocy and, quite frankly, hurt my brain.
Everything I have ever read in your posts has been wrong. |
|
|
|
|
|
MihaiG
|
Posted: Thu Feb 24, 2011 12:34 am Post subject: Re: sytem("pause") whats the big deal? |
|
|
as a grizzled veteran of the site i agree with rdrake |
|
|
|
|
|
mirhagk
|
Posted: Thu Feb 24, 2011 8:12 am Post subject: RE:sytem("pause") whats the big deal? |
|
|
Yes.... your right.... paragraphs 2 and 4 of my opening statement are completely wrong........
Paragraph 1 and 5 were rants about who cares that it's slow, because that argument is completely invalid. Paragraph 3 was saying it's only useful spot, the only reason it exists.
I never use system("pause") anymore, especially not in anything I ever give to anyone else.
(Mostly I use C# anyways, and I just Console.ReadKey(true))
What I've been arguing is that you guys have given some stupid points, notice how I haven't argued against any of the good points? |
|
|
|
|
|
Xupicor
|
Posted: Thu Feb 24, 2011 1:07 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
Not that you didn't argue against them, but it seems to me like you ignored them.
And by the way, it was already said I think, but - if you stop a console application to see the result (no matter how you do it), you are most probably doing it wrong.
How do you use such an application? Do you double click the icon or do you open up the terminal and then run the app?
edit: and no, people usually don't even want to read an all-caps paragraph. I certainly don't feel like reading it, and it has no added value over normal text. Shouting doesn't make you right. |
|
|
|
|
|
mirhagk
|
Posted: Thu Feb 24, 2011 9:17 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
I don't run linux, that answers your question.
(In case you don't see it, that means from double clicking it)
And actually I've almost never run my programs other than from the IDE. Which closes the console when done (other than in non-debug mode, but I usually run in debug mode).
I've never distributed a command line only program, only graphics games, so the whole thing of pausing output is irrelevant. |
|
|
|
|
|
Xupicor
|
Posted: Thu Feb 24, 2011 10:24 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
Well then it's your IDEs fault, as was stated before by many. There were good IDEs mentioned that do force the terminal to say untill you close it.
Quote: I don't run linux, that answers your question. Certainly not! Do you really imagine power users/sysadmins/etc on Windows only run applications using mouse? :O There's cmd, Console2 for a nicer terminal, there's MSYS, Cygwin... You can have Perl, Python, bash, sed, grep, etc, etc - plenty of GNU stuff is ported over, and even if you're not interested in turning your Windows into more *nix friendly environment/toolchain, cmd and some tools are always there, and you can use it.
You certainly do not need to have *nix OS to run console apps "properly".
You really never used your console applications outside of your IDE? Well I did, and I am, although usually that would usually be a (quick and dirty) Perl script, just because text processing is much easier in Perl.
If you would use the console more you'd see how a pause would only annoy you, and make you want to kill the tool developer.
If gcc would add pause at the end, doing this:
code: | gcc -pedantic my.c && ./a.exe | would have to change to: code: | gcc -pedantic my.c < file_with_enter_key && ./a.exe | And if that pause would actually need me to really tap the keyboard, like with conio.h/getch() - then it would be almost impossible to use gcc with make or configure script, or anything, making it useless.
If dir/ls, cd or touch had a pause "feature" I'd probably "facepalm" myself to death.
If you're writing a stream application that takes some data, and returns some data, then you should always write it in a way that it can be used without an actual person pressing the keys. Unless you really NEED an actual person pressing the keys (then why not make it easier for him/her and write a GUI), that won't assume automation.
In other words you should be able to redirect a file with an input on to the app and it should work:
code: | ./myapp < file_with_input_data
What's your name?How many apples?
Hello Xupicor, you have now 5 apples |
That way you can also additionally test your app against known sets of valid input and output data, kind of like SPOJ does it. |
|
|
|
|
|
mirhagk
|
Posted: Thu Feb 24, 2011 11:09 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
But what I'm saying is that I never ever write those. Maybe as a quick hack to do something, but never as a exe I'll save for future use.
I mean 99% of my command line programs have either been quickly testing an algorithm for use in an actual project, or for school, where they want you to have prompts for data and such, and the teacher wants to be able to test without having to run via command line, like just double click the exe, enter some random fake data, and see the output.
Again, I never said using it was a good idea, it's a quick fix I use for seeing the output of an algorithm I'm testing, and that's about it. It's like any kind of quick fix, it works for now, and it'll never stay that way, so who cares. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Velocity
|
Posted: Fri Nov 18, 2011 10:51 am Post subject: RE:sytem("pause") whats the big deal? |
|
|
it pauses the program and waits until your view is complete. |
|
|
|
|
|
S_Grimm
|
Posted: Sat Nov 19, 2011 1:16 pm Post subject: Re: RE:sytem("pause") whats the big deal? |
|
|
mirhagk @ Thu Feb 24, 2011 11:09 pm wrote:
I mean 99% of my command line programs have either been quickly testing an algorithm for use in an actual project, or for school, where they want you to have prompts for data and such, and the teacher wants to be able to test without having to run via command line, like just double click the exe, enter some random fake data, and see the output.
I wish I had your teacher, mine ALWAYS compiles C++ programs from source files, its a 10% dock in your grade to send him anything but the source files. And i agree with the posters above, it's your IDEs fault. I know that if you use VS2010 and hit "CTRL+F5" it halts the terminal at end of execution, where "F5" doesn't. I'd see if you are able to use a different IDE, as yours seems sub-par. |
|
|
|
|
|
Insectoid
|
Posted: Sat Nov 19, 2011 1:24 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
You guys might wanna check the timestamps on the posts above yours. |
|
|
|
|
|
S_Grimm
|
Posted: Sun Nov 20, 2011 1:28 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
oopsies xD I was a little hung over when I posted so I didnt check. My bad. |
|
|
|
|
|
mirhagk
|
Posted: Sun Nov 20, 2011 5:59 pm Post subject: RE:sytem("pause") whats the big deal? |
|
|
Also your probably not aware what crtl+F5 does on VS2010 (which I use), it's a very important difference.
F5 will debug, CRTL+F5 runs without debugging, usually the former is better while developing. |
|
|
|
|
|
S_Grimm
|
Posted: Mon Nov 21, 2011 10:45 am Post subject: Re: RE:sytem("pause") whats the big deal? |
|
|
mirhagk @ Sun Nov 20, 2011 5:59 pm wrote: Also your probably not aware what crtl+F5 does on VS2010 (which I use), it's a very important difference.
F5 will debug, CRTL+F5 runs without debugging, usually the former is better while developing.
Im well aware, I just finished spending 2 hours tracing down a error with debugging. I missed a freaking "e" on the end of a variable name. Unfortunetly there was another variable without the "e" declared (Blame my teacher not me, my naming convention isnt that bad) |
|
|
|
|
|
Velocity
|
Posted: Mon Nov 21, 2011 10:49 am Post subject: Re: sytem("pause") whats the big deal? |
|
|
they use system ("pause") because it tells you exactly where to implement your command. but if you use
#include <conio.h_> you will only be abel to do it for the whole program. So to sum it up, it will allow you to be more specific and exact about where you want to place your pause. |
|
|
|
|
|
|
|