# Making assumptions about hardware

There doesn't seem to be a standard meta post for assuming architecture or hardware, recently while writing an answer for This Challenge I ran into an issue with the mode windows utility.

By default mode will output information on any COM ports on the system as well as the current CLI, in the above situation only the information for the cli was required, and it was a penalty of 4 bytes (using mode con instead of mode) to ensure consistent output on systems which have multiple com ports.

in this situation is it correct to assume that since a "plain" system or VM with only basic hardware and software can run this correctly, that omitting the four bytes is correct? is there a cutoff point for things we're able to assume about the environment?

• I agree that there needs to be a cutoff point. Otherwise, languages could be created that change how every command is interpreted based on hardware available. This should be a loophole, imho. Golfing the code is more important than golfing a language. May 3 '17 at 15:58
• For me one reasonable hardware it is a Pentium x32 bit cpu with 2 Gb of ram and disk of 500Gb no Internet connection; all above of that it is for me one mainframe or supercomputer or one AI, perhaps it comprehend this cellphone...
– user58988
May 4 '17 at 12:25

## Any hardware setup may be assumed or required, within reason

Assuming that the computer has a graphics card is reasonable. Assuming that it has 2 SLI'd GTX Titans is not[1]. Requiring that only one COM port is connected is reasonable. Requiring that the computer has 1 PB of RAM is not.

There isn't a hard-and-fast rule for what constitutes "reasonable" on purpose - what may be infeasible or prohibitively expensive now could very easily be standard in 10 years.

Additionally, taking advantage of this rule with a language that acts differently for the same code depending on the hardware configuration (e.g. outputting Hello, World! if the CPU has 2 or fewer cores, and performing a primality test if the CPU has more than 2 cores) should be considered loophole abuse.

[1]: also your computer would catch on fire

• So do you mean to say that one may submit answers that only work on precise set of hardware, as long as that setup is "normal" at the time of posting?
May 3 '17 at 20:15
• @Adám Correct. It's really not any different than requiring a specific library or OS, except that hardware can't be downloaded or virtualized as easily.
– user45941
May 3 '17 at 21:22
• I disagree. The hardware setup has to be general enough that a large percentage of computers would get the desired result. Having exactly 3 hard disks of exactly 1TB, 250GB and 128GB is oddly specific, and shouldn't be allowed, even those components are normal today, and having three disks is normal today too.
May 3 '17 at 21:25
• @Adám I would consider such specificity to be unreasonable. However, having > 1 TB of hard drive space would be a reasonable (though questionable) requirement.
– user45941
May 3 '17 at 21:26
• It turns out a mere 45 minutes before you wrote this answer I suggested this unrelated loophole that covers that last part.
– Grain Ghost Mod
May 7 '17 at 2:11
• I've tried to look up GTX Titan. I'm ... not a fan of the design. Though their SLI bridge surely looks better than a ribbon cable. May 12 '17 at 13:38
• @JanDvorak I chose GTX Titans as an example because they're very high-end graphics cards, and two of them SLI'd without liquid cooling would probably result in a fire.
– user45941
May 12 '17 at 13:39
• Don't they have thermometers built in? ... May 12 '17 at 13:40

### The hardware requirements must be broad enough that each requirement separately is fulfilled by a large number of computers

Examples of reasonable hardware requirements:

• 1 TB available hard disk space

• internet connection

• printer attached

• touch screen

• RAID

Examples of unreasonable hardware requirements:

• exact model of a computer

• specific multi-hard drive setup

• 5.25" floppy disk drive

• exact amount of available space

• Honestly, a lot of these don't seem like reasonable requirements to me. Most computers that I have don't have a touch screen, and I don't have any with a printer connected. I have a few RAID arrays, but why should code ever depend on that? And a 1 TB hard disk? Jeez. May 5 '17 at 11:05
• @CodyGray I don't think raid should be needed, but I agree with touch screen. A good many answers on this site are in OS specific languages, so it's not that far off from existing rules. May 6 '17 at 15:11
• @CodyGray I wasn't clear about the 1TB; I meant free, not exactly present.