Re: strange behaviour

From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 10/26/03


Date: 26 Oct 2003 11:46:12 GMT

In article <3f9a58ce$0$27387$edfadb0f@dread16.news.tele.dk>, "Nicolai Hansen"
<nic@aub.dk> writes:

>PChar <---- Type, nothing wrong with calling a non-pointer PBlah, this is
>not at all clear that its a pointer
>

In general "P" is a prefix for a pointer _type_ (just as "T" is for most other
types), carelessly many people use it as a prefix to a pointer _variable_. IMO
a pointer _variable_ should always be prefixed with "Ptr", particularly when
one is dealing with both values and a pointer to such values.

OTOH standard API C-type variables appear to always use "p" as a prefix as part
of the "hungarian" naming convention (which in general is unnecessary in a
strongly typed language such as Delphi).

Conventions in programming (as in social communication) are to help you
understand, needlessly and perversely breaking them is unhelpful and usually
arises during immaturity or some basic incompatibility.

Alan Lloyd
alanglloyd@aol.com



Relevant Pages

  • Fixes for tar(5) format handling in pax(1)
    ... bug in paxrelated to handling pathnames of the maximum length ... prefix, linkname) to be unterminated if they fill the entire field ... if so just return a pointer to the name. ... * to find the biggest piece to fit in the name field (or the smallest ...
    (freebsd-arch)
  • Re: Hungarian notation in C++ (is it used or not today, and if so, how?)
    ... > p (pointer) ... > by (unsigned char, or byte) ... that the prefix is correct. ... C++ Faq: http://www.parashift.com/c++-faq-lite ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Creating vanity domain names on the fly.
    ... >Hi - Any help or pointer on this would be greatly appreciated. ... the request will propagate back to you to make sense of the prefix and ... covert to an IP. ...
    (comp.lang.java.programmer)
  • Re: Struck with CopyMemory API
    ... Is pDevMode a pointer or a UDT? ... The "p" prefix can cause ... API oriented examples look like ported code rather than being working up in VB from scratch. ...
    (microsoft.public.vb.winapi)
  • Re: Linked List Issue
    ... Arthur & Leor, ... I used the Hungarian because with a glance I could tell what the type ... > Dereferencing a null pointer. ... > See comment above about making extra work for yourself. ...
    (alt.comp.lang.learn.c-cpp)