Yes, bro, pointer is powerful, yet ugly

LORY
8 min readJul 6, 2024

And this is why I don’t like it.

The Story

One day, “May I ask if there is any c/c++ project in the future? I’d like to explore that” My young friend seems interested in low-level language.

“Hmm, it depends on our sales. But why, it will be painful and won’t be a pleasant experience, trust me pls” I replied.

“Yes, but you know in C/C++ the pointers are super powerful, after graduation 3 years, I've never done any C/C++ project,” he said.

“Agreed. To me pointers are like a Swiss knife in the programming world, similarly in the web world we know that Nginx as a web server, does load balancing, black-white listing IP, proxy, rate limiting, media server (RTMP streaming), mod-security as WAF, etc.. (it seems to offer everything…which doesn’t mean we have to use everything); similarly, pointers can do many things but it’s easy to harm ourselves. the reason is that they lack proper abstractions that are already built into many advanced languages like Java, .NET, golang, and Python: classes, interfaces, delegates, lambdas, references, out parameters, generic types, classes, heaps, GC, and so on.”

Let me explain more.

The Basic: Pointer Value is a Memory Address

Since a pointer holds a memory address, it can do many things.

Suppose you break down how a statement into CPU instructions(here is a step-by-step post)…

--

--

LORY

A channel which focusing on developer growth and self improvement