1
$\begingroup$

Are there useful programs that don't take inputs from a user, environment etc. such as key input, or the current time?

A program that computed/printed out predefined data could be turned into a file, right?

$\endgroup$
  • 1
    $\begingroup$ Calculate any defined problem, hardcoded for oprimisation purposes, run and wait for results. Calculate Pi or other expansions. Yes, if a program always return the same result it can be just stored as the file. Sorry I am not sure how this is the Computer Science (maybe I an wrong and it is perfectly ok). And the usefulness is a subjective term. Someone may want to perform heating test on hardware so the program producing random numbers that doesn't bother to print them anywhere becomes useful. $\endgroup$ – Evil Mar 11 '17 at 22:54
  • 2
    $\begingroup$ How is this a computer science question? Also, please define "useful". Would for i = 1 to infty { print i-th prime } qualify? $\endgroup$ – Raphael Mar 11 '17 at 23:06
  • 2
    $\begingroup$ Program that wakes me up at 8am every day is pretty useful. $\endgroup$ – Eugene Mar 12 '17 at 4:14
  • 1
    $\begingroup$ A program that wakes you up every day at 8 a.m. takes input, namely the current time and the time you wish to be woken up. Just because the task is repetitive and requires minimal input does not make it inputless. I think you will find that, at the very least, any program or algorithm that does not take some form of input does not produce meaningful output (and therefore is useless or redundant as the OP puts it). $\endgroup$ – DeBunkeD Mar 12 '17 at 17:21
  • 1
    $\begingroup$ Emm, poor software design skills guys. My program takes no input. It just runs a lot of nops and then signals the alarm. The number of nops is calibrated to be equal exactly 24 hours on my machine. $\endgroup$ – Eugene Mar 12 '17 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.