Talk:Handle (computing)

Latest comment: 15 years ago by 86.41.34.42 in topic Simple English version of this page?

Getting a handle on handles edit

More details on handle are needed....

I think the section on handles should be eventually moved to their own page. There's an argument against this — pointer, smart pointer, and reference are all separate and vaguely redundant, and handle would only add to the mess. I'm going to leave it for now, because I usually stick to FP and prefer not to mess with this stuff. :) --Mgreenbe 23:17, 8 December 2005 (UTC)Reply

Handles aren’t smart pointers edit

It’s never been my impression that handles are smart pointers. Sometimes handles aren’t pointers at all. Even when a handle is a pointer, it can be harmful for a programmer to think of it that way since that brings the temptation to dereference the pointer and dig around at what it’s pointing at. A handle is meant to keep those kinds of details abstract.

There are other kinds of handles that have nothing to do with the memory manager. Those include file handles, window handles, mutex handles, search handles, etc. In this way, the notion of a handle is a kind of pattern: All those kinds of handles represent different things, but they’re all there to prevent (or relieve) the program from having to deal with the nitty-gritty details of the underlying system.

Smart pointers don’t do that. Smart pointers don’t really hide anything from the program. They lessen the burden of some of the bookkeeping involved with pointers, but they still provide access to the same memory that would have been available with a conventional pointer.

Although handles for memory may have fallen out of favor lately, they’re definitely still going strong for other uses, especially on Windows. I suspect they still get frequent use on other operating systems.

If anything has caused other kinds of handles to fall out of favor, it’s classes. Instead of file handles with API functions that accept file handles for their first parameters, we instead often see File classes with various methods to act on underlying disk files.

To describe a handle as a smart pointer, I’d want to know what kind of “smarts” the handle supposedly has. This article doesn’t address that, and I doubt it can. --Rob Kennedy 04:55, 30 August 2006 (UTC)Reply

Definitely, smart pointers and handles are very different concepts. I have not found any serious reference for support this conceptual unification in external links. I suggest to move that section to a non-redirected Handle (computer science). --pybalo 21:11, 21 May 2007 (UTC)Reply
Agree. Handles are related to Smart Pointers, but they are not smart pointers by themselves. Rjgodoy 03:01, 22 May 2007 (UTC)Reply

Ouch!. I was found an interesting counter-argument for our objections: a 2007 C++ Glossary, from none other than Bjarne Stroustrup!

Ok, a smart pointer can be called a handle... if we can a agree what is a handle.

Following the discussed plan, I will create Handle (computing) (or Handle (computer science)) as a pseudo-disambiguation page, explaining related and unrelated concepts named handle in computing. It may include:

  • File/resource handle
  • Handle in Windows programming, Macintosh, GUIs
  • Handle on C++, ADA (smart pointers)
  • Handle/body: C++ idiom, design pattern
  • Adjustment handles

Bonus track:

  • Event handling
  • Exception handling

More definitions on FOLDOC & answers.com.

I think may be appropriate to move this discussion page to discussion of new page. Do you agree? pybalo 23:55, 28 May 2007 (UTC)Reply

I agree, but drop a line here about the discussion. I believe I have read something about SP and handles some time ago, but I cannot remember neither the source nor the idea... I got used to think about SP as things with -> overloaded. Rjgodoy 02:59, 29 May 2007 (UTC)Reply
Since you have found a reliable source, can we get rid of {{disputed}}? Rjgodoy 03:03, 29 May 2007 (UTC)Reply

As a Windows Programmer... edit

I HATE handles, Win32 API is not O-O, handles suck. "Smart" pointers, more like "RETARDED AND CONFUSING" pointers! Just my humble opinion. 64.12.116.10 21:23, 5 September 2006 (UTC)Reply

Handles don't suck (although the Win32 API does). The Win32 API is OO (usually), just in C's baroque syntax. njaard (talk) 07:40, 17 June 2008 (UTC)Reply

Simple English version of this page? edit

I not technically minded, I find this article very confusing. I think a simple English version of this page should be created. 86.41.34.42 (talk) 17:12, 23 April 2009 (UTC)Reply