Hacker News new | ask | show | jobs
by _tardigrade 1386 days ago
I don't have CS degree but I do have 7 years commercial experience with Python/Django Rest Framework and I have no idea how pointers work.
6 comments

Right, there’s no reason you’d need to know in Python.

How quickly could you pick it up if you had to?

https://en.m.wikipedia.org/wiki/Pointer_(computer_programmin...

I am in a similar situation having a lot of working experience but only in a specific domain (web), and no formal CS education.

I only used pointers in one specific context, while working for about 3 months on a Go codebase. I was able to get my code working without too much trouble, but pointers were a source of some headscratching for me out of ignorance and tbh I didn't work there long enough to fully learn or internalize it... I vaguely remember adding a * or & here or there to make things work.

I've been interested in some kind of class or learning reference for some of the more "CS" topics that I don't use but would still be nice to learn. I started an OSSU course or two but haven't made much progress since I get bored when they go over some fundamentals that I already feel confident on.

If you need to understand what Python is doing under the hood, you’ll have to have some understanding of pointers.

Not having a decent mental model of what’s happening a few levels below severely limits the kinda of problems you can solve.

That's a bit harsh.

I'm familiar with C/C++ and how pointers work, but that part of my mental knowledge never comes into play when I write python code, whether Django or not. And I've written substantial code in these two environments, they don't really intersect.

I mean, maybe once in a couple years you'd run into some weird problem that requires deep knowledge to solve, but "severely limits" might be a bit of an overstatement. (And might be some form of unwarranted gatekeeping IMHO.)

Everyone has limits/gaps in their knowledge, while C and pointers are part of the standard curriculum for CS degrees, not everyone has to be such cookie cutter devs (as long as they do their job and their employers are happy)

When the OP said they "have no idea how pointers work", I took that to mean they don't know know anything about how memory works. Why does does copying this array, not copy the contents of the array. Why does accessing a random value in a linked list take so much longer than accessing a random value in array. What happens when I reassign a local variable.

Developing an underlying mental model of what's actually happening is so much more effective than treating a programming language like a black box.

As far as "severely limits", there are many jobs where you could spend your entire wiring together libraries and asking more senior developers for help when you run into edge cases. But if you want to be one of those people who gets called in to help, you need a basic understanding of memory indirection. You don't need to understand pointer syntax in any specific language, but you need to have some understanding of what happens when you type x = [1,2,3].

At many tech companies, I doubt you could even make it passed the interview without a basic understanding of what a pointer is.

What sort of problems would you need to be doing in Python that aren't already done by libraries like NumPy which would require that sort of mental model?
The only thing that comes to mind would be memory leaks in long running applications caused by your data structures having some link to a link to a link that prevents temporary data from being garbagecollected.
I expect you're much closer to understanding pointers than you think. If you know the difference between a deep copy and a shallow copy then you understand the principle.
On top of Python's class semantics, if you understand Python's weakref class, you are about 90% of the way to pointers.
That’s not something to be proud of.