The Beauty of Pointers

Authors

  • Austin Owino Wetoyi Dept. of Mathematics, Physics and Computing, School of Sciences and Aerospace Studies, Moi University, Eldoret, Kenya

DOI:

https://doi.org/10.14738/tecs.116.15504

Keywords:

Pointer, Reference, Bug, Memory

Abstract

Talk to any folk familiar with programming for an advice on pointers and the most likely advice you will get is avoid pointers at all costs. Very little is said about pointers that show them in good light. We try to show in this paper that pointers are probably the best feature that a programming language can offer. There are too many beautiful (and even ugly) things that can only be done with pointers. Pointers are the most powerful feature of languages that allow their use. Obviously extreme power requires extreme responsibility. Careless use of them is known to lead to the most difficult logical errors to fix. Pointers are the closest thing to hell before you understand them. Pointer bugs can cause a program crash in random ways which makes them more difficult to debug. Nonetheless, even with their problems, pointers are irresistibly powerful programming constructs. Many advanced programming and debugging problems only make sense with a complete understanding of pointers and memory. There's a lot of nice, tidy code you can write without knowing about pointers. But once you learn to use the power of pointers, you can never go back.

Downloads

Published

2024-01-01

How to Cite

Wetoyi, A. O. (2024). The Beauty of Pointers. Transactions on Engineering and Computing Sciences, 11(6), 106–118. https://doi.org/10.14738/tecs.116.15504