15 ms·
I think the real difference comes with the knowledge the person is carrying when learning C. For example, people that are familiar with concepts like classes, s
by scoutt 6y ago
I think the real difference comes with the knowledge the person is carrying when learning C. For example, people that are familiar with concepts like classes, string objects, arrays, etc. brought from higher level languages are the ones that I see have much more problems when understanding memory management (and thus pointers) in C.
For example, for a higher-level developer, a string might mean some kind of object that knows its length, auto-expands, etc. When in C a string is just an array that it will be overflown at the very first chance. Same with other objects.
I find that a person that doesn't know much about languages are the ones that better understand the basic concepts of C (like pointers).
- melvinroest 6y ago> For example, for a higher-level developer, a string might mean some kind of object that knows its length, auto-expands, etc. When in C a string is just an array that it will be overflown at the very first chance. Same with other objects. Funny, my programming knowledge in Java helped me because of the whole concept of what a reference is and a literal value. In my first Java programming class, 8 years ago, I learned that you need to have references, otherwise things will take up too much memory. My teacher took a humongous object as an example and asked "what if I need to access this at 10000 different places, but I really only need one physical copy of it?" I was pretty upset that you had to do all of this bookkeeping and accounting. I remember being pretty vocal about that it just didn't make sense to my why one couldn't just copy stuff. I guess we all grow up at some point :) When I saw pointers for the first time (to be fair, years later), I was thinking "ah so a pointer is basically a reference". Other people would say "a pointer is a whole lot more than just a reference, you can do pointer arithmetic with (and so on)". And I was just thinking to myself: alright, it's a reference on steroids, but the groundbreaking essential idea of the pointer is that it refers to something, just like a reference in Java. And then I'd hit a segmentation fault and doubt my own understanding. Learning programming felt emotionally turbulent to say the least, haha.
- patrick5415 6y agoMy experience was nearly the opposite. I tried to teach myself c 15 years ago and found pointers completely bewildering. I didn’t really know how to program any other language then. After a 10 year, non-technical interlude, I went to grad school and spent 5 years writing matlab. In the last year, I decided to learn c again. This time, pointers seemed completely straightforward. The most difficult part for me this round was keeping the syntax straight.
- melvinroest 6y agoOut of curiosity, what was your issue the first time?