Re: [gtkmm] Re: [glade--] Could raw C++ pointers be eliminated?



> I hold what you may view as a radical position. I believe that
> FRAMEWORKS should be designed so that applications programmers should
> not have to think about or deal with raw pointers at all, unless
> collection classes are being written, or some other class that deals
> with things with dynamic lifetimes.

Pointers are useful, and every useful language and framework uses them.
Java doesn't call them pointers (it calls them references, I think), but
it uses their equivalent far more than we do.

If you want to use smartpointers then use smartpointers.

Maybe you would like all objects to act like smartpointers, but
- I prefer the syntax to show where we deviate from normal C++ memory
management. So, "smartpointer<TheClass> theInstance" clearly shows that
the instance will have the lifetime dictated by smartpointer, while
"TheClass theInstance" will act like a regular C++ object.
- There are practical C++ problems with this when dealing with class
hierarchies.

And if you don't like the code that glademm generates then don't use
glademm and write your own, or use libglademm.

I am unlikely to discuss this lots unless I am very bored.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]