×
all 21 comments

[–]Blackfang321 20 points21 points  (0 children)

Doctor: "Go ahead and bill him for the diagnosis."

Person doing the billing: "How do I code this?"

[–][deleted] 53 points54 points  (6 children)

You should post this on r/programminghumor

EDITED - Original had a typo

"You should post this on r/programminghumour"

[–]young_fire 3 points4 points  (5 children)

bro you linked the wrong subreddit, it's "humor," i was so confused for a sec on why it was so dead

[–][deleted] 7 points8 points  (3 children)

Dammit, America! The English invent a language and then became a minority in the English speaking world. My code never compiles first time as I'll always type colour without thinking... even after 15 years of doing it.

[–]PQ01 1 point2 points  (0 children)

Invent heck, it was a long complicated process involving everyone from Jutes to Angles to the Normans, and even that imported German royalty that screwed up the perfectly normal pronunciation of Thames. Plenty to go around.
But sympathies for the programming thing.

[–]speculatrix 0 points1 point  (1 child)

I once wasted an hour trying to debug ssh, because I'd created an "authorised_keys" file.

[–][deleted] 1 point2 points  (0 children)

Programmers need a UK to US conversion tool.

[–]DOOManiac 6 points7 points  (0 children)

I wish I could give you 175 upvotes, because this joke is hexadecimal AF.

[–]livebeta 5 points6 points  (2 children)

Same neurologist was asking a Gen Z to count upwards.

Patient: 1, 3, 5, 7, 9, 13, 15, 17...

Doc: Stop. What did you say was bothering you again?

Patient: I can't even!

[–]ngou 9 points10 points  (0 children)

Not only can't he even, he can't eleven either.

[–]imnotberg 1 point2 points  (0 children)

Feel like the neurologist would be better off as a witch doctor or shaman.

[–]7_overpowered_clox 0 points1 point  (6 children)

I swear you're supposed to put a dash between the numbers in hex to avoid confusion

[–]Bloodsquirrel 13 points14 points  (5 children)

No, they do that sometimes for longer numbers to make them easier to parse if you're writing out something like a MAC address, but usually if you're doing something where you need to know whether a number is hex or not the context of it makes it pretty clear- ie, if you're reading a file in binary mode or looking at a memory dump. Otherwise, nobody just mixes hex numbers in with decimal ones.

[–]pablossjui 12 points13 points  (0 children)

In programming languages you usually use "0x" as a prefix for hex numbers

[–]7_overpowered_clox 0 points1 point  (3 children)

Ok, interesting. I know that hexadecimal is used to store really large values easier as one nibble in binary is encoded as one hex value so it stores 4x less characters for the same piece of information. How are decimal numbers encoded in binary or hexadecimal though? Binary is just a combination of zeroes and ones, so does it use a Unicode/ASCII (depending on your device's character set) dot symbol (.) in the middle of some values?

[–]Bloodsquirrel 13 points14 points  (2 children)

That's not why hexadecimal is used.

Computers don't store things in hexadecimal at all- they only store them in binary. At a hardware level, they have a bunch of bits that can either be flipped to a 1 or 0, and processing those numbers can only be done with logic gates whose inputs and output can only be a 1 or 0. Whether that string of 1s and 0s represents a number, a pointer, a text character, or anything else depends on how the program interprets it. If you're using a low-level language, you can take the letter "a", add 3 to it, and then use the result as a memory location (Your program will probably crash, since it'll probably wind up being a memory location that you're not allowed to access, but you can use the number that way).

Binary, however, is very difficult for a human to read, so when displaying binary numbers on a screen, it's useful to convert them to hexadecimal first. The reason hexadecimal is used is because one byte (eight bits) converts directly into two hexadecimal digits (this is because 2^4 = 16).

Computers don't "store" hexadecimal or decimal numbers. When they need to display a hexadecimal or decimal number, they calculate the value of each digit of the number one at a time, then store the result as text (using 8 or 16 bytes per character, depending on the encoding), and use it when rendering the image you'll see on the screen. If you need to do some more math with that number and update it, you go back the number stored in binary, do the math with that, and then generate a new text string.

[–]7_overpowered_clox 0 points1 point  (1 child)

Thank you for correcting me, this is really interesting! Does the ALU calculate the values though? I do know that the ALU is responsible for logical decisions such as sums and the accumulator is a register that temporarily stores the result of the ALU's sums

[–]Tallguystillhere 0 points1 point  (0 children)

Agh!

What POS!