Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #71486

Re: C++ variable names

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c++
Subject Re: C++ variable names
Date Tue, 21 Jan 2020 05:31:54 -0800
Organization A noiseless patient Spider
Lines 61
Message-ID <86lfq1hr5h.fsf@linuxsc.com> (permalink)
References <qvohup$gar$1@dont-email.me> <4d6f2d19-ff6f-433c-bff9-adde1c8b719a@googlegroups.com> <qvqlni$ofi$2@dont-email.me> <2a3d69e3-50c6-45df-94ce-cd23723c158a@googlegroups.com> <qvv7ra$1cg6$1@gioia.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info reader02.eternal-september.org; posting-host="d01dc2e4789bccc98e4eaed72337c14b"; logging-data="23925"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aaKI5aJniWL3xMLaiAsj7RiDzCp8nZeY="
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock sha1:k956HqDYnuL8IhujB/yHnX9w1gY= sha1:fVRN5qm1eB0pbEPBqj6Tp2R9VaY=
Xref csiph.com comp.lang.c++:71486

Show key headers only | View raw


Manfred <noname@add.invalid> writes:

> On 1/16/2020 11:11 PM,  <<D6 F6 [05b6]>>  Tiib wrote:
>
>> On Thursday, 16 January 2020 23:48:52 UTC+2, Lynn McGuire  wrote:
>>
>>> On 1/15/2020 8:42 PM, Daniel wrote:
>>>
>>>> On Wednesday, January 15, 2020 at 9:32:02 PM UTC-5, T wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> Would some kind individual please fill in
>>>>> the C++ variables names that go with these
>>>>> C variable names?
>>>>>
>>>>> int8_t in C
>>>>
>>>> ...
>>>>
>>>>> Do I just drop the "_t"?
>>>>
>>>> In general it's considered to be bad practice to adorn a variable name
>>>> with type information.
>>>
>>> Huh ?  Don't tell that to Hungarian notation folks.
>>>      https://en.wikipedia.org/wiki/Hungarian_notation
>>
>> Yes, but the Hungarian notation guys are frowned upon in majority of
>> collectives.  By
>> <https://en.wikipedia.org/wiki/Hungarian_notation#Notable_opinions>
>> Bjarne Stroustrup does not recommend it.
>> It can be tricky for three star programmer to understand what they
>> do without such notation OTOH it is unclear if it does help.
>> <https://wiki.c2.com/?ThreeStarProgrammer>
>
> Note that, as far as I read somewhere, the Hungarian notation was
> initially introduced to indicate the "intention or kind" of a variable
> or function, which is not that silly of an idea - in fact you always
> use the variable name to indicate its purpose, the Hungarian
> decoration introduced some kind of naming convention with this
> respect.

In languages with static typing, type names can (and IMO should)
be used to indicate the purpose of identifiers declared with
those type names.  Redundantly adding type or purpose information
to an identifier name is, well, redundant.

These comments don't apply to the orginal context (BCPL) of
Hungarian notation, since BCPL doesn't have any notion of
static typing.

> For example, I read it was initially used to identify the coordinate
> system some point would belong to (page, print margins, ...) in MS
> Office applications.

Hungarian notation predates Microsoft as a company, let alone
Microsoft word.  It may be the case the Hungarian notation was
used to indicate a coordinate value (as opposed to, say, a string
length), but it was certainly not initially in any Microsoft
product.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

C++ variable names T <T@invalid.invalid> - 2020-01-15 18:31 -0800
  Re: C++ variable names Daniel <danielaparker@gmail.com> - 2020-01-15 18:42 -0800
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 18:46 -0800
      Re: C++ variable names Daniel <danielaparker@gmail.com> - 2020-01-15 21:30 -0800
        Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 21:52 -0800
      Re: C++ variable names Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2020-01-15 23:44 -0700
        Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 22:59 -0800
          Re: C++ variable names Bo Persson <bo@bo-persson.se> - 2020-01-16 08:44 +0100
            Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 23:48 -0800
            Re: C++ variable names David Brown <david.brown@hesbynett.no> - 2020-01-16 10:08 +0100
          Re: C++ variable names Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2020-01-16 00:43 -0700
            Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 23:51 -0800
              Re: C++ variable names Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2020-01-16 01:39 -0700
                Re: C++ variable names T <T@invalid.invalid> - 2020-01-16 14:01 -0800
    Re: C++ variable names Lynn McGuire <lynnmcguire5@gmail.com> - 2020-01-16 15:48 -0600
      Re: C++ variable names Öö Tiib <ootiib@hot.ee> - 2020-01-16 14:11 -0800
        Re: C++ variable names Lynn McGuire <lynnmcguire5@gmail.com> - 2020-01-17 18:52 -0600
        Re: C++ variable names Manfred <noname@add.invalid> - 2020-01-18 16:22 +0100
          Re: C++ variable names Öö Tiib <ootiib@hot.ee> - 2020-01-18 10:41 -0800
          Re: C++ variable names Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-01-21 05:31 -0800
      Re: C++ variable names David Brown <david.brown@hesbynett.no> - 2020-01-16 23:32 +0100
      Re: C++ variable names legalize+jeeves@mail.xmission.com (Richard) - 2020-01-19 19:13 +0000
  Re: C++ variable names red floyd <no.spam@its.invalid> - 2020-01-15 18:45 -0800
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 18:47 -0800
    Re: C++ variable names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-01-15 21:51 -0800
      Re: C++ variable names red floyd <no.spam@its.invalid> - 2020-01-15 22:44 -0800
        Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 23:00 -0800
  Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-15 19:40 -0800
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 19:58 -0800
      Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-15 20:12 -0800
    Re: C++ variable names James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-01-15 23:18 -0500
      Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 20:20 -0800
        Re: C++ variable names James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-01-16 12:06 -0800
          Re: C++ variable names T <T@invalid.invalid> - 2020-01-16 14:02 -0800
      Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-15 20:31 -0800
        Re: C++ variable names David Brown <david.brown@hesbynett.no> - 2020-01-16 11:09 +0100
  Re: C++ variable names Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-01-16 03:52 +0000
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 19:59 -0800
      Re: C++ variable names Bo Persson <bo@bo-persson.se> - 2020-01-16 06:33 +0100
        Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 21:53 -0800
  Re: C++ variable names Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-16 06:18 +0100
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 21:54 -0800
      Re: C++ variable names Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-16 06:59 +0100
        Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 22:31 -0800
          Re: C++ variable names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-01-16 00:15 -0800
          Re: C++ variable names Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-16 11:25 +0100
            Re: C++ variable names Mister2U@honorific.org - 2020-01-16 11:47 +0000
              Re: C++ variable names Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-16 13:31 +0100
                Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-16 15:51 -0800
                Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-16 15:51 -0800
                Re: C++ variable names Manfred <invalid@add.invalid> - 2020-01-17 01:31 +0100
  Re: C++ variable names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-01-15 21:48 -0800
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 21:55 -0800
      Re: C++ variable names Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-01-16 00:01 -0800
    Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-15 22:28 -0800
      Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 22:31 -0800
  Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-15 23:16 -0800
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 23:26 -0800
      Re: C++ variable names "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2020-01-15 23:34 -0800
        Re: C++ variable names T <T@invalid.invalid> - 2020-01-15 23:53 -0800
          Re: C++ variable names Louis Krupp <lkrupp@nospam.pssw.com.invalid> - 2020-01-16 03:04 -0700
  C++ variable names James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-01-16 11:51 -0800
    Re: C++ variable names T <T@invalid.invalid> - 2020-01-16 13:58 -0800

csiph-web