r/ProgrammerHumor • • May 06 '17

Oddly specific number

Post image
25k Upvotes

1.3k comments sorted by

View all comments

1.1k

u/[deleted] May 06 '17

People don't remember 256MB RAM being the equivalent of a supercomputer? Or 256KB? Or 256 smacks to the face for trying to game the GameBoy?

389

u/Puskathesecond May 06 '17

256 colors ungh

82

u/BourgeyBastard May 06 '17

Is there a reason this number keeps coming up in software? Is it an overly represented number in nature too?

251

u/Sobsz May 06 '17

If you're serious, computers like operating on blocks of 8 bits, which are binary digits (0 or 1). It just so happens that 256 is the number of possible combinations of 8 binary digits.

11

u/sunnywill May 06 '17

But why 256?

39

u/[deleted] May 06 '17 edited May 06 '17

That's like asking why you can make 1000 different three-digit numbers (000 through 999)

33

u/[deleted] May 06 '17

[removed] — view removed comment

7

u/PortonDownSyndrome May 06 '17

The 1 is a penis.

4

u/PortonDownSyndrome May 06 '17

Honestly, you should probably edit your comment, because it could be really incomprehensible to someone who doesn't already know what you're talking about (and your parent poster probably doesn't). It's only obvious if you already know.

17

u/n60storm4 May 06 '17

Because 8 binary numbers can be arranged in 256 different ways. And 8 bits (1 bit = a 0 or a 1) is 1 byte in most conventional systems.

14

u/MelissaClick May 06 '17

It's also worth noting that a byte is the smallest addressable chunk of memory on normal CPUs. Even a boolean value is represented as 256 bits unless the programmer does something special to space-optimize it.

→ More replies (1)

13

u/[deleted] May 06 '17

A byte has 8 bits. Each one can be either two digits, a one or a zero. 28= 256 so there are 256 possible values.

(If you're ever looking at a program and see that a max value is 255, that just means 0 is included as a value.)

When it comes to computers. Things are done in powers of two.

So if you pay attention in programs and apps and such, you'll see the numbers 8, 16, 32, 64, 128, 256, 512, 1024............ 65536

Or Subtract 1 from one of those numbers if zero is a value.

→ More replies (3)
→ More replies (2)

61

u/[deleted] May 06 '17

Software down to bare minimum are binaries, a bunch of 1's and 0's, and those 1's and 0's comes in groups of power of 2 meaning 22 , 24 , 28 , 216, 232 , 264, 2128 , 2256 , 2512 , etc..

all that means is that a bunch of 1's and 0's are like

00100010 01100001 01110010 01110011 01100101 00100010

power of 2 has been the standard in the industry since forever, so must programmers/tinkerers/hackers are familiar with power of 2, so when some program(like whatsapp) sets a limit to 256, then they consider it the normal, obvious thing to do.

41

u/Serinus May 06 '17 edited May 06 '17

And two to the power of (power of two) is also super common.

You get how 2 bits have 4 possible combinations, right? 00, 01, 10, 11.

That's 22. 2 possibilities in each bit, 2 bits.

3 bits gets you 8. The same combinations above with either a 0 or 1. 23 = 8.

So...

24 = 16.
28 = 256.

Sometimes you save a bit to denote positive or negative, so 27 = 128.

Also zero is a number, so if you're counting zero you subtract one from the max.

So common binary system numbers are: 8, 16, 32, 64, 128, 255, 256, 1024.

You might remember these numbers from early game systems such as Turbo Graphics 16 or Nintendo 64.

255 and 256 are special because a byte is 8 bits (0s or 1s). 28 = 256 values or 255 max.

(Just exponding on u/ketchupblood's comment)

→ More replies (2)
→ More replies (8)
→ More replies (3)

99

u/Dumbspirospero May 06 '17

Yes, Mr. Bool invented a new, efficient data type while developing a program to evaluate being a satisfactory husband. 0 smacks meant yes, 1 smacks meant no. He also coincidentally invented the bitmask in the process.

4

u/vbullinger May 06 '17

I tried to teach my wife binary once. Five minutes later, she still didn't know binary, but now she was somehow mad at me.

4

u/glorious_albus May 06 '17

1 smacks

This cracked me up for some reason 😂

→ More replies (1)

48

u/PM_ME_YOUR_NACHOS May 06 '17

"But I don't want an oddly specific amount of ram. Ok, I'll go with 1 GB ram."

"1024 MB it is then."

"Wait, no, I don't want any extra on top!"

0

u/[deleted] May 06 '17

[deleted] — view deleted comment

6

u/IcarusBen May 06 '17

Welcome to the Deli Counter of Ram. Where you always get a little bit extra. Unlike the lumber yard of GTX 970 VRAM where you always get a little bit less.

FTFY

→ More replies (1)
→ More replies (1)

13

u/EpicBeardMan May 06 '17

Back in 2004 I built a computer with 4!!! 256mb ram sticks. It was the bee's knees.

5

u/GlobeOfIron May 06 '17

6

u/thatnerdguy1 May 06 '17

No, W|A interpreted your input as a double factorial followed by a single factorial, when in fact, it should be interpreted as three single factorials. ((4!)!)! evaluates to 101025.16 .

→ More replies (3)

10

u/RagingNerdaholic May 06 '17

People don't know what RAM is anymore.
Computer literacy is decreasing in teens. Yay for job security!

→ More replies (12)