Would the world of computing be better with no pointers?
Imagine for a moment a world, a world no rules and no boundaries, a world with no limits, a world with no POINTERS. How would this computing world look? Would it make life easier or worse? Wouldn't programming be much easier not having to worry about them?
I was just a bit pissed off at syntax in C++. I love how C++ the middle between the metal with assembly and high languages like Python. Thanks peoplez
- Robert JLv 72 months agoFavorite Answer
Taken to the limit with no "pointer" addressing in the CPU, and there would be no computers, at least not digital computers as we know them.
Pointers are just memory addresses of things; no memory addresses of anything means no addressable memory; no RAM or program memory.
If you just accept that a pointer is the address of an item rather than a copy of an item, everything becomes simple and straightforward, and you will understand how useful they are and how efficient they can make programs, compared to copying entire chunks of memory to pass an item from one routine or function to another.
To put it in a slightly exaggerated parallel context, imagine not being able to use addresses (pointers) for shipping items or sending mail - imagine the only way you could show the post office or carrier where to deliver an item, by taking taking the building to them or them to the building..
If you consider a program working with large files or graphic images etc., having to copy the entire file or image data at every transfer between functions, rather than just handing over the address pointer, is about as extreme a backwards move.
- ∅Lv 72 months ago
adding to what has already been said, as a creative content maker, limitations can actually fuel one's creativity.
when you are granted unlimited options, unlimited time, and unlimited resources, often the results are trite and boring. not very inspired.
but when limits are set: deadlines, buget, media, etc., then one's creativity tends to shine brighter, and they make the best product possible using the given criteria.
- Anonymous2 months ago
At the lower level, of C and C++ pointers are needed, at the even lower level of assembly addresses are used but don't go there. There are plenty of higher level languages where you never need to use a pointer. Such as Haskell.
In C++ you can reduce the complication by using smart pointers, such as unique_ptr, it makes things simpler by automatically disposing of objects. The advantage of using pointers explicitly rather than reference counted objects is speed. With C++ you can make things a lot faster. Even languages without pointers still have pointers behind the scenes. These can lead to disadvantages such as automatic garbage collection deciding to automatically start just when the program wants to do something else, slowing things down.
- Anonymous2 months ago
The stack would be getting one heck of a workout.
- How do you think about the answers? You can sign in to vote the answer.
- EddieJLv 72 months ago
Newer programming languages do NOT have explicit pointers. Instead, they use "references".
The biggest problem with pointers has been the obscure notation that C used. The idea behind pointers is extremely simple.