by dkersten · 5y ago · 0 comments
In programming you have to practice mental skills. That is, abstract problem solving, logic, bigger-picture-how-things-fit-together. There's a reason many beginners struggle with concepts like pointers or recursion/recursive data types. These things become second nature with practice, just like the physical skills do, but to a beginner who has not practiced such things, they're equally difficult.
Introducing them to the end user who just wants a way to track project status is a great way to bar them from actively participating in developing their own solutions. Forcing them to be beholden to the IT department, rather than empowering them to accomplish their goals.
You know it's not true. Pointers, references, whatever you call them. They exist for a reason.
No, I don't.
> Pointers, references, whatever you call them.
References are not pointers, and I stand by what I said. Pointers are not needed by most people writing software outside of very specific domains.
References are a related but distinct concept. I can "hold a reference" to something without ever being able to read what its memory address is or change what memory address that reference points to. The power to do that is unnecessary for most programs that are written.
> They exist for a reason.
Did I ever say otherwise?
EDIT: Expanding on the notion of "need". A programmer using a C library "needs" pointers because the C library almost certainly makes use of them. The user may or may not need to use pointers themselves to interact with the library (that is, it may offer an interface based on values and not pointers). A programmer on any OS I can think of will be making use of pointers through similar levels of indirection. As an Erlang hobbyist, the implementation almost certainly uses pointers internally, but as an Erlang programmer I wouldn't use them directly. In order to write a program in Erlang, I never need a pointer, though I may make use of some kind of reference (process IDs are a kind of references, but they are not pointers).
Ok. So don't use that power then. Or use references instead, which are conceptually the same thing.
> Did I ever say otherwise?
You quite clearly stated their purpose was very niche. I think you took my statement a bit to literally, as what I meant to convey was: no, they are not niche.
Edit: after reading your edit, I would like to remind you we were discussing the needs of learning the concept of pointers. While what you mention may not be literal C pointers, that is besides the point (haha) because they (methods of indirection) are conceptually equal.
https://www.tutorialspoint.com/d_programming/d_programming_p...
The toy virtual machine and language I built in D uses function pointers heavily to implement the machine's opcodes. They made it incredibly simple to program the 'CPU' of the virtual machine. The opcode functions are setup as an array of function pointers.
Whenever a byte that represents an opcode is read, it simply calls the function being pointed to at the corresponding index in the array. It allows for additional opcodes to be easily added without hassle or breaking things. Every other way I tried without pointers was convoluted and didn't work as expected. Using an array of function pointers just works.
We're talking about accessibility for getting started. Pointers and recursion are good ways to scare people away. They were all my highschool CS teacher cared about... guess who avoided CS for a few years as a result until figuring out ways to use other languages to solve specific problems in non-CS courses several years into college?
Why do you never hear these types of complaints when people say it takes 10000hr to master the piano? People never suggest taking shortcuts and people accept and respect the path of becoming a master. But when it concerns programming, everyone immediately jumps to "how can we make this as dumb as possible?"
Guys. Shit takes time and effort. The freshmen will be fine.
These skills are not unique to programming. It’s true that building sophisticated applications requires skills that need to be developed over time. But there are many many useful programs short of that that can be written with a beginner’s limited knowledge. We see already with python widespread use by non computer scientists in certain fields. I think going forward this will become more and more common across more fields and beyond academia.