Re: How to name variables in a program?





Arthur J. O'Dwyer wrote:
> On Sun, 29 May 2005 spinoza1111@xxxxxxxxx wrote:
> [...]
> > certain programming groups at IBM. Since Szymonyi worked in mainframe
>
> Although I bet Nilges won't listen, I feel obliged to point out that
> Charles Simonyi's last name is "Simonyi", not "Szymonyi". In fact, the
> solitary Google hit for "Charles Szymonyi" is one of Nilges' earlier
> posts!

I'm not listening, I'm reading a man who asked me to keep promises he
could not concerning conduct in this ng. But thanks for the apparent
correction.

It may be because I've seen other Hungarian names such as the violinist
Josef Szigeti and for this reason, upon reading of Simonyi's
contributions in Programmers at Work (Susan Lammers 1986: Microsoft
Press) I mistakenly remembered his name. Or the name may have been
spelled in my fashion in Lammers' book (I no longer have my copy). As
usual, my mistake seems the unfortunate possession of a fragment of
erudition in a world where erudition is being sold on a sort of slave
block by slave owners' ignorant great-grandchildren.

it may also be that Simonyi simplified his name. He had escaped from
Hungary and in my experience, many friends whose fathers escaped the
Eastern zone changed their names or simplified the spelling for fear of
intelligence operatives working in the USA.

But when in Rome, even if it is the Rome of Nero, Caligula and Tony
Soprano, one does as the Romans do.

>
> [snip a bunch of nilgewater]

Real cute. You might consider that if you are going to form a name
flame, you might want to flame only me and not Captain Edward J.
Nilges, who died in the last months of WWII and who was insulted in the
Cleveland Plain Dealer because, it seems, his death came at a time when
America (being already taken over by the feelgood predecessors of
George Bush including Prescott Bush) was cheering up...since it was
clearly winning. The Plain Dealer described his death as in effect
spoiling the party because WWII was the birth of brutal celebrity, and
its antithesis the name flame.

People who share my surname deserve common decency from even the likes
of you Mr. Arthur J. O'Dwyer. They've accomplished much in their chosen
fields, and as such my father et al. deserve not having you spread your
goddamn confusion.

Do I make myself clear?
>
> > If you don't use Hungarian, then you have to THINK, what did I call
> > that stinky variable? If you do use the notation of the Magyars, then
> > you can think faster: "oh, I need that integer, what was it, tippy
> > typee i-n-t, oh yeah, there it is".
>
> This is actually a decent argument for Hungarian notation, in a
> Microsoft Visual Studio context. It's new to me. I have noticed that
> Microsoft style seems to put a lot of emphasis on /producing/ software,
> rather than /reading/ software, so in that mindset it makes a lot of
> sense to sacrifice a bit of readability for the ability to index
> variables by type.
> Where I would prefer to take the extra five or ten minutes per program
> to write 'width' where I mean "width," so the reader isn't burdened with
> a bunch of arcane prefixes --- Nilges and other VS users might naturally
> prefer to save the five or ten minutes by adjusting their naming scheme.

This is a caricature. I have a high rate of software production. My
<shamelessPlug>book</shamelessPlug> contains 26000 lines of code, far
more than the usual computer book, and when a manager asked me to
self-measure I found my rate to be thousands of debugged lines per
month.

But I don't work at Microsoft and in fact would probably not succeed at
my age in merely grinding out code.

My whole point seems to have passed you by. There is no rage to burden
the user with arcana. Quite the reverse. Instead, the responsible user
of HN does it for one reason alone, and that is clarity in the context
of what Dijkstra described as a radical novelty: the cruel world of a
new form of applied mathematics.

Many people appoint themselves authorities on programming style. Few
have the insight that comes from true literacy since they come from
aliteracy. The insight is that no programming style should be use if it
doesn't please its author, who is after all by definition the first
reader.

You would do well to consider that in this world, drawing-room notions
of what constitutes "clarity" such as the simple word "width" no longer
apply.

Width could be an integer quantity and as such a measure of discrete
units, such that each unit has dimension and the "width" is the unit
count and not the sum of their dimensions. Or it might be the real
value of their summed widths. As such intWidth versus dblWidth
clarifies the width.

> The reader won't thank them for 'iWidth', but in their paradigm, the
> "comfort" of people reading their code is insignificant compared to the
> speed of development.

This is NONSENSE. Let's see, us evil Microsoft guys are TYPING LONG
IDENTIFIERS to save time (hint: we can use intellisense to find
variables without prefixes as well: hint hint: I have interviewed at
Microsoft twice and neither time was an offer made: hint hint hint: at
both interviews I was delighted to be able to talk with Microsoft
technicians who get to meet with, and brain tease, and otherwise grill
applicants: hint^4: I enojoyed the Residence Inn: hint^5: when I first
interviewed I was already 37 and as such outside the Microsoft
developer demographic).

>
> (Of course, if Visual Studio let you type 'int' and up popped a list of
> variables /of that type/, rather than /beginning with those letters/,
> the former Hungarian-notation users would have the best of both worlds! :)

Of course, this feature would have to be carefully designed to
differentiate the variables that ARE int and those that have the
prefix, and to highlight invalid uses of the prefix.
>
> signing off,
> -Arthur

.



Relevant Pages

  • Re: Support for optional parameters
    ... programming language, but THE central programming language of the .Net ... Office being THE cash cow at Microsoft, well, forgive me for restraining my ... The success of the VSTO initiative and the success of Office are two ... >> sure it comes in handy for a few developers out there from time to time. ...
    (microsoft.public.dotnet.framework)
  • Re: The Demise of the Art of Programming
    ... > Microsoft is making a tacit admission that they have ... Which "lite version" is that? ... Strict object oriented programming is difficult to learn. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Visual Basic 6.0 support
    ... unhappiness at the lack of migration paths as I'm not of that wing to even ... VB6 applications being re-written in .NET unnecessarily, ... you would think Microsoft or Ballmer ... > Microsoft didn't give it most popular programming language the power ...
    (microsoft.public.vb.general.discussion)
  • Re: newbie question
    ... "people in the Unix crowd are just not current regarding Microsoft." ... I spend half my year learning new technologies, ... > programming stack grows, somebody has something bad to say about it. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Visual Basic 6.0 support
    ... you would think Microsoft or Ballmer ... So I figured it was some other Dan, ... > language depends a whole lot on your point of view. ... > programming. ...
    (microsoft.public.vb.general.discussion)