DEV Community

Do they teach "pointers" in bootcamp? Should they?

Ben Halpern on December 03, 2020

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...
Collapse
 
tiguchi profile image
Thomas Werner

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

I’ve come to realize that understanding pointers in C is not a skill, it’s an aptitude. [...] Pointers require a complex form of doubly-indirected thinking that some people just can’t do, and it’s pretty crucial to good programming.

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 🤷

Collapse
 
waynejwerner profile image
Wayne Werner

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.

Collapse
 
miguelmj profile image
MiguelMJ • Edited

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.

Collapse
 
yechielk profile image
Yechiel Kalmenson

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.

Collapse
 
waynejwerner profile image
Wayne Werner

In every high level language you're going to have the idea of references, like in JS if you do

thing = {"foo": "bar"};
a = thing;
b = thing;
a.foo = 42;
console.log(b.foo);
Enter fullscreen mode Exit fullscreen mode

If you understand that you'll see 42, then you understand pointers.

Collapse
 
liaowow profile image
Annie Liao

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.

Collapse
 
defman profile image
Sergey Kislyakov • Edited

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.

Collapse
 
kallmanation profile image
Nathan Kallman

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.

Collapse
 
dwd profile image
Dave Cridland

"All problems in computer science can be solved by another level of indirection" - David Wheeler.

Collapse
 
zenulabidin profile image
Ali Sherief

No, people should not have to learn pointers if they are studying a high-level language because that is an internal feature in those languages - kind of how you have a transmission in a car but you don't need to know about it to drive.

Collapse
 
valterm profile image
Martin Valter

Yes and no. Using your car analogy, the developer would be a mechanic working in the engine bay. They might be able to get by working only on parts not directly related to the transmission, might even be great at it, but would you not prefer a mechanic that understands all of the engine mechanics?

Similarly, abstract memory management might be obfuscated away in high-level languages, but it still happens. Understanding the mechanics of it will improve the efficiency of your code. Most high-level languages don't require you to manage the memory yourself, but that doesn't meant you don't need to keep memory usage in mind.

Collapse
 
markerikson profile image
Mark Erikson

My first programming course was an Engineering-track "Intro to C++" class, back in 2000, as part of a CS major.

If I remember right, we didn't even touch pointers in that class - they were covered in the second course, "Object-Oriented Programming with C++".

I think pointers are a valuable concept to understand for anyone doing programming.

At the same time, I wouldn't teach C++ as a first language to anyone getting started today - I'd go with JS or Python. Along with that, no, I'd never try to throw a beginning programmer straight into pointers.

I do see some value in trying to cover something sorta-kinda like this somewhere in the process. After all, "references" in JS, Java, Python, and C# are just pointers that have been hidden a bit so you can't modify them yourself, and it's certainly important to know that this code:

let a = [];
let b = ;
Enter fullscreen mode Exit fullscreen mode

just creates two variables pointing at the same array in memory.

Mmm... I'm actually kinda talking myself back and forth on this one a bit here as I write :)

Eh... if we're going to stretch the definition of "pointer" to "references in GC-based languages", then yes, I can see the importance of covering that at some point in the semi-early-ish learning process.

Collapse
 
kspeakman profile image
Kasey Speakman • Edited

I think what people are trying to imply when they value pointer experience is knowledge of how the code controls the hardware memory. You do not have to use pointers to understand this, although the minutia of dealing with pointers does provide you with significant hints.

But the short-term benefit of being instructive does not outweigh the long-term maintenance hassle of being fiddly and error prone. Even garbage collection can teach you the memory model eventually, because you have to dig deeper when you run into its limitations.

Collapse
 
sarahcodes_dev profile image
Sarah 🦄

Pointers, I would think no as you don’t really have to worry about those in higher level languages, however there are foundational programming paradigms that I think should be taught like separation of concerns, dependency injection etc, essentially how to write clean code.

Collapse
 
gypsydave5 profile image
David Wickes

No they don't (personal experience). Yes they should - incredibly useful concept. I'm of the opinion that a good code bootcamp should pivot to teaching Go; a simple language, but one that is explicit about the use of pointers/references.

Collapse
 
linaran profile image
Deni • Edited

Even in C++ people probably won't juggle complicated pointers. But they might cause a memory leak in Java. They should understand why and how.

If not the above, they should understand linked lists and I'm not sure how to explain that without talking about references which are basically pointers that are automatically dereferenced when being accessed.

Collapse
 
aminmansuri profile image
hidden_dude

The objective of a bootcamp is to get people quickly proficient in a particular technology. It's not a replacement for a Bachelor's degree.

I would suspect that if you interview to find out if the person understood their BS that you would filter out Bootcamp people. But then why are you even interviewing them?

Bootcamps are a tradeoff. Recursion and pointers are more in-depth.

When I designed a university curriculum I forced everyone to learn recursion and pointers (much to the initial horror of some). But when I designed a Bootcamp curriculum I preferred to teach concurrency, transaction isolation, and multi-threading that I thought was more relevant and urgent to teach in the limited time we had.

We couldn't teach everything. If you want everything you should do a BS not a bootcamp.

Collapse
 
crimsonmed profile image
Médéric Burlet

This is one of the things that can be very harsh with bootcamp and that makes a clear difference to someone who studied CS.

Bootcamps usually just focus on the language that your learning so Javascript the focus would be on node, react etc. But anything related to computing and general knowledge is not taught.

I have interviewed junior devs who came from bootcamps and asking question such as what happens when you type a url in browser (dns lookup, request reponse principal, transport layer etc)

Collapse
 
cubiclesocial profile image
cubiclesocial

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:

Collapse
 
avikki profile image
AviKKi

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.

Collapse
 
theosaurusrex profile image
Theo Harris

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.

Collapse
 
egilhuber profile image
erica (she/her)

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.

Collapse
 
dwd profile image
Dave Cridland

Oh, I do hope they don't. Understanding pointers is one of the few things that still makes me feel clever.

Collapse
 
gustavofsantos profile image
Gustavo Santos

I think that it is very useful but not required skill. I personally prefer work with a person that doesn't know how pointers work but can write very readable and testable code if the project doesn't need to deal with bare metal things.

Collapse
 
pinotattari profile image
Riccardo Bernardini

I think that knowing what a pointer is it is quite important, even if you use a language (like JavaScript, Ruby or Python) that does not show them explicitly to you. It is important to know what happens "under the hood." Keep also in mind that you never know and maybe later you'll need to work with a language that uses pointers explicitly.

Collapse
 
lionelrowe profile image
lionel-rowe • Edited

No, web development bootcamps should categorically not teach pointers.[1]

Bootcamps typically take place over the course of several weeks, or at most a few months, and as such there is a high opportunity cost to each concept taught. Learning about (just a few examples) the HTTP protocol, CI/CD tools, version control systems, or agile software development methodology are all orders of magnitude more useful than learning about low-level concepts that are fully abstracted away in the languages used.

Joel on Software is a fantastic blog, but this is one instance where I strongly disagree with him. Interview questions should be tailored as closely as possible to the actual requirements of the job. While I agree it may be a warning sign for a JavaScript developer to not understand recursion, it would be absurd to expect them to have a deep understanding of concepts that aren't used in JavaScript.

I also wonder if Joel himself may have updated his opinions on this, since the article was published 14 years ago.

On the other hand, the difference between passing by reference and passing by value, which is the closest thing JavaScript has to pointers, is a fundamental concept. Any web development bootcamp worth its salt should cover this distinction.


[1] Nor should data science bootcamps and so on, for similar reasons. Unless of course they're using a language that actually has pointers.

Collapse
 
etienneburdet profile image
Etienne Burdet • Edited

Not in the one I did (Le Wagon) and there is no realistic way they do. We did however, implicitely learn how to by reference and value. Just the thing wasn't named or conceptualised, we were taught some examples, what they do and where to use them.

Bootcamps—as opposed to academic learning—main goal is to learn as few as possible, to build as much as much possible in a short time. There is more than enough tooling and high level languages out there to not even think about it. Pointers are useless for web development, they are useless for most of datascience and I am not even sure if game devs use them anymore with tools like Unity or Goddot.

And if you have to learn them one day, you can always sit with a good book and try. But that day is faaaaaar away from the bootcamp for most people.

I know people will quote Joel Spolsky all over the place. But his eugenist view of the thing is just disguting to begin with.

Collapse
 
aghost7 profile image
Jonathan Boudreau

I don't really think it is necessary for a web development bootcamp. It doesn't make a difference to know the distinction with most languages used in that domain.

For embeded development its going to be highly relevant though.

Collapse
 
swarupkm profile image
Swarup Kumar Mahapatra • Edited

The concept of pass by value /pass by reference to a function is something one should know. Thats the closest one can get to "pointers". Specially for people in JS World. Clarity around that is of supreme importance

Collapse
 
ng_update profile image
Kieran

I recently finished a Web Dev bootcamp that covered the basics to the Trinity, then did a LAMP cms, then two Angular cms (one in ionic), then covered some react frontend basics. There of course was a lot of information about creating API's and consuming them via JSON (course was mostly JS) At no point did we discuss pointers. I went in to class with about a year's worth of prior knowledge, but i had learned the basics of data structures from a Udemy course I took. As much as I went over them (interviews, right?), I have yet to come across a required use case for when I would need them in Web Dev. I'm new, but does that actually come up? Like, would I use them in electron for a desktop app or something?

Collapse
 
jaagrav profile image
Jaagrav

Well thanks for sharing, I did not know about Pointer before.

Collapse
 
saymy__name__ profile image
Jordan Engstrom

They did not at my bootcamp. I learned about it from a very thorough Java class I took on Udemy.

Collapse
 
leob profile image
leob

They should, whether it's classical C-style 'pointers' or Javascript 'references' but an aspiring dev should understand the difference between "by value" and "by reference".

Collapse
 
scrabill profile image
Shannon Crabill

It might have come up in my Flatiron curriculum, but I'm not 100% positive.