The pointer is not a thing that every developer needs to know, but it's still a thing that exists. This question is kind of a stand in for concepts like pointers and not just that one thing.
I wonder: Do they teach this concept in bootcamp at all?
Should they teach stuff like pointers at all to a group learning, say, web development in JavaScript? If so, does it come early or late?
I imagine the course doesn't need to cover computer science from the ground up, but what should get detailed and when?
In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.
Oldest comments (34)
Well thanks for sharing, I did not know about Pointer before.
I think pointers are pretty fundamental in programming, so understanding them might be a good idea even if you don't use them NOW (and it's a pretty basic concept tbh). You can't be sure you'd be writing JS (or any other language without pointers being present to the programmer) for life. I thought that I won't face them, but then I've started programming in Golang and here we go.
I'd suggest to learn as much as you can because every day it gets harder for your brain to learn, memorize and understand information.
Joel Spolsky has a pretty radical point of view (not sure if I really share it, but it's interesting): The Guerilla Guide to Interviewing
Asking questions about pointers and recursion is apparently part of his interviewing routine, and one of the deciding factors for hiring someone
Now the question is, whether it's only crucial to good programming in C or higher level languages that abstract memory management away, but Joel seems to be saying: a good programmer understands pointers (and recursion). Bad programmers don't.
Interesting point of view, but not sure what to think about that 🤷
I'm not terribly convinced that this isn't a skill. It might be a skill that's difficult to acquire, and perhaps a skill that's difficult to retain or even be really good at. And maybe some people are just better at thinking about really weird problems.
But pointers aren't a hard concept, and probably everyone has used a pointer at one point in their life, without realizing that's what they were doing.
a href? Pointer
Library card catalog? Pointer
Yellow Pages? Pointer
Address book? Pointer
Table of contents? Pointer
Index? Pointer
The problem is that most people who understand pointers don't do a good job of teaching what pointers are.
I agree with you. In my opinion, pointers scare starters because of their bad reputation. In reality, the scary thing of pointers is that the errors they produce are difficult to track and debug, so you need some solid good practices.
But conceptually, they are not more difficult to understand than other data types out there.
Pointers in the sense of managing memory locations are probably not critical unless the language you use presents that interface.
But "pointers" in the more general sense of having a piece of data that refers to the "real" data in another location is fundamental and appears all over. (Think foreign keys in databases, URLs, file systems, compression formats, etc.).
You really can't do anything interesting on a computer without this idea.
I'll also throw in the concept of a pointer to a pointer. Which at first seems like a silly extension; but on second look can actually allow surprising simplifications of problems.
"All problems in computer science can be solved by another level of indirection" - David Wheeler.
The bootcamp I attended last summer did not go over pointers. I do think it would have been beneficial to at least get a "hey, this exists - here's how to learn more", but the structure was more focused on diving into projects, not powerpoints. I do know that the curriculum has changed a bit since I attended, so I am not sure if this has changed.
We've covered them in our bootcamp! We're eight weeks into a ten month camp, and I think we learned about them in maybe week 6 or so. Not explicitly the concept of pointers, but ones related to what language we are learning (Ruby) and how they relate.
Oh, I do hope they don't. Understanding pointers is one of the few things that still makes me feel clever.
When I was in bootcamp, we didn't learn about pointers per se, because the languages we learned (Ruby and JavaScript) didn't have pointers, but I do remember learning about the difference between passing by reference and passing by value, so when I learned Go and it came to pointers, the concepts were familiar to me.
In every high level language you're going to have the idea of references, like in JS if you do
If you understand that you'll see 42, then you understand pointers.
This code snippet reminded me of a mental model I acquired from Dan Abramov via his Just JavaScript newsletter, where we learned to literally "draw" pointers to understand the concept of references in JS.
There are some competitive programming bootcamps they must be teaching it.
And in higher level languages we can't directly access pointers but we generally use the concept of a reference, which is mostly implicit. So I guess going by the language is good enough. Pointers are really powerful in C and C++ but in Python or JS, we don't care a lot about them, pioneers of these languages don't want us to be bother about it.
If you want to create or modify binary files on disk or in RAM, then you will need to understand how pointers work. Here's a tutorial video I made recently on binary file structures: