r/learnprogramming • • Apr 05 '22

Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them

Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.

Someone else who reads yours and does understand it, try to explain it to them to help them learn

1.6k Upvotes

738 comments sorted by

View all comments

8

u/Patrickstarho Apr 05 '22

Ceaser Cipher. I get your supposed to shift each character by n but the whole modulus thing makes no sense to me. I remember I did the problem and wrote it out 10 times. 2 weeks later I was stuck again

9

u/CatatonicMan Apr 05 '22

Modulo is like an analog clock. It goes in a cycle from 1 to 12, then back to 1 again.

So if you're at 11 and add four hours, you'd count 12, 1, 2, and end at 3.

A Caesar cipher is like that, except it has 26 letters instead of 12 numbers.