Why pointers lost their popularity in Java, C# and other modern languages

August 04, 2019

Pointers is the core concept for a programming language. They allow us directly access data stored at memory locations. One can also modify data at the desired pointer location.

The Pointers History

Pointers were used majorly in language C & C++. Back in the 1970s, developers had to work directly with machine language. Understanding the machine level by everyone is not everyone’s cup of tea.
C language was introduced at that time, which was considered as a high-level language. Instead of programming in machine language instructions that worked upon memory addresses, people found the C language comparatively easy & useful.
At that time, pointers were like a productive tool for programming as it allowed easy & fast access to addresses over machine language.
The best/worst part of pointer is that it allows access to data at memory addresses.
With great power comes great responsibility — Spiderman
Directly accessing the memory based on addresses & altering data is very efficient in terms of performance.
Pointers are the sharp tools which when used wrongly, can cause disastrous effects.
Imagine while coding in C, if you modify the data at the wrong memory address. Being able to access data by address, you can alter any data (even the operating system’s data) & this can lead to machine failure.

Modern Languages

With the programming languages progressing towards modern languages like Java, C#, etc, the pointers were either removed from the languages or were made safer to use to prevent access to memory addresses outside the program’s running scope. The underlying system behind many modern programming languages still uses pointers but they do not expose the complexity & accessibility of pointers to the programmers.

So the next question arises…

Should I learn it?

Since modern programming languages work on the underlying pointers concepts, it is recommended to grasp a firm understanding of pointers to be able to work on even modern programming languages.

You Might Also Like