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

2

u/[deleted] Apr 05 '22

At a really intro level, I would’ve said for loops. I just didn’t feel that materials you encounter when learning informally REALLY explain this concept in rigorous and complete ways.

0

u/[deleted] Apr 05 '22

[deleted]

2

u/[deleted] Apr 06 '22

Lol I don’t know why I was downvoted. I’m a geologist and a lot of my colleagues with physical science backgrounds also get “broke brain” when confronted by looping and “brain scramblies” when recursion arrives.

Maybe it’s the brevity of the presentation in a lot of materials? The examples in materials I used also always seemed to be sort of disembodied and never towards larger cohesive tasks. Like now that you know “x =‘foo’ for butt in x: print(butt)” you can evaluate the value of a scalar function in 2D for every point in a rectilinear grid where distance between nodes is a constant

0

u/[deleted] Apr 06 '22

[deleted]

1

u/[deleted] Apr 06 '22

Yeah I mean I think the very concept of iteration really fucks with people initially and putting that into a succinct piece of writing seems WEIRD to people. “So like this sentence is telling itself to do something until it tells itself to stop?!”

1

u/Fluffy-Lecture4408 Apr 06 '22

Actually classical loops as for loops keep repeating a set of instructions while a condition is true. As opposed to do until a condition is true. The main difference is that in a do until even if the condition is true at start, the loop will occur at least one time.

1

u/[deleted] Apr 07 '22

I think potentially the issue here is that to really understand why loops exist you would need a lower level understanding of how computers / processors work, and to understand how you use loops in the real world you would need a higher level understanding of how programs come together.

I've found that sometimes it's best to just "accept" that things exist and wait for the why/how to come in a later realization. That's always what got me through math classes at least.

1

u/[deleted] Apr 07 '22

I completely agree.