4 ms·
Everyone struggles with this, it's not natural nor intuitive. Just like pointers. We've all been there. Is this a humblebrag post?
by bongodongobob 3y ago
Everyone struggles with this, it's not natural nor intuitive. Just like pointers. We've all been there.
Is this a humblebrag post?
- lupusreal 3y agoPointers being challenging is the biggest meme in CS education. They're conceptually very simple and the only real challenging part is C's arcane syntax. If you start with assembly for a simple ISA or just teach the concept of pointers first instead of teaching them at the same time as teaching C, then they're dead simple.
- exe34 3y agoPointers are easy. You add stars until it compiles and then you add & until it stops segfaulting.
- SAI_Peregrinus 3y agoUntil you try to write an optimizing compiler, run into provenance, and find that they're actually complicated (though not for the reasons beginners think they're complicated).
- bongodongobob 3y agoYeah calculus is simple once you learn it too. We are talking about intro to CS.
- lupusreal 3y agoPointers aren't hard, the languages used by most intro to CS classes are the hard part. I taught myself z80 assembly in middle school and didn't learn until years later that pointers are supposedly hard. From the direction I learned it, you address memory with numbers, and obviously you can do arithmetic on numbers. This is one of the simplest things in CS to learn. It's the * and & soup that becomes a nightmare to beginners. Lest you think I'm just a bragard, I never managed to get better than a C in any calculus course.
- deleted 3y ago[deleted]
- jeroenhd 3y agoPointers are so easy to work with that they're still the cause of major security flaws and crashing programs every single day. The concept of pointers isn't too hard if you know how memory works, but that hasn't made working with pointers any easier. Any serious work with pointers quickly devolves into questions about ownership, lifetimes, and figuring out the proper sizes. Plus, many educators seem to skip verifying that students actually know how memory works before introducing pointers, which leads some students to believe that pointers are some kind of language feature rather than a core concept of modern computer hardware.
- analog31 3y agoI always tell people that I understand pointers because I once made one out of gates. This may be a case where teaching a simple microprocessor architecture would reap a lot of benefits. My first was the Z80, simply because there was a book about it at Radio Shack.
- mrob 3y agoIMO, the biggest mistake in C syntax was using the same character for both the dereferencing operator and the pointer type declarator. I'm convinced it's responsible for the majority of the confusion about pointers.
- vundercind 3y agoI have so far seen only two reasons that “hard” CS concepts are hard: 1) It’s reputedly hard, but isn’t at all, so I spend way more time convincing myself I’m not missing something (“I must be…”) than I do learning it. Pointers; recursion; “dynamic programming”; various concepts that basically only Haskellers talk about. 2) A huge proportion of explanations are just, unaccountably, confusing as hell and make it seem way more complicated than it is. Bad beginner OO explanations; literally any explanation of anything in which the examples are in Haskell.
- nick7376182 3y agoThroughout my CS degree I had a piece of tape on the top edge of my laptop screen that said "* address of, & value pointed by"
- relaxing 3y agoYou’ve still got it backwards :)
- trgn 3y agoTesting if somebody groks recursion or pointers is the easiest litmus test to see if somebody "groks" programming. They're not "easy" concepts, and usually people have had to break through a wall for it to be comfortable with them. They make great interview questions, doesn't need to be long or complex problem, just has to have either pointers or recursion in it.