Spot the bug (three line program) and a question on how to order execution flow in a OOP

M

Michael S

Tom Dacon said:
I'll tell you one thing - I'm glad to see the last of Hungarian notation.
I never could buy into that, at least the way that the MS programmers
distorted Simonyi's original intent.

Tom

Makes me remember a project done in VB.NET by VB6 dudes.
They had a corporate policy of doing everything in Visual Basic,
so trying to get them into C# was impossible.

Also, they insisted of prefixing type to all their variables,
the VB6 notation of lngCount, arrList, objConn etc etc.

As the VB6 coding tool sucks, and all things being Variants,
I can understand why you do this in VB6.
Also, for the LET/SET gotcha on objects,
prefixing objects with obj is a good thing in VB6.

In VB.NET it was a disaster.
Mostly becuase most things in .NET are references to objects.
Pretty much everything got the obj-prefix, and when I taught them
arrays where references types, one of them went through the whole source,
replacing arrMyArray to objMyArray.

They still insist on using that notation, and I am happy I don't
work on that project at all no more.

*sigh*

- Michael Starberg
 
T

Tom Dacon

Peter Duniho said:
And yes, I admit it. I like and use the "proper" form of Hungarian,
especially in my own code (as opposed to when fixing someone else's). Even
when I'm writing .NET code, all of the non-public parts of my classes use
Hungarian notation. So sue me. :)

Pete

I do it too, in its original sense of supplying semantic information, and it
works well for me. In fact, I was doing it long before I ever heard about
Hungarian notation. For example, back in the DOS days I developed a library
for computational astronomy which I've since ported to C#. There are many
different types of coordinate systems with which you have to concern
yourself, one for each frame of reference from which you're viewing the
astronomic universe - horizontal coordinates, solar coordinates, galactic
coordinates, etc. I use the notation to distinguish the type of coordinates
that an object contains by prefixing the symbolic name with a short
abbreviation of the type of coordinates: gc for galactic, hc for horizontal,
and so forth. It's a HUGE help when I'm reading the code.

Tom
 
T

Tom Dacon

Jon Skeet said:
Right. One thing I *do* find important is to follow the "public"
conventions of a platform when it comes to naming - making methods and
properties Pascal-cases in .NET for instance. When people bring
conventions from one platform to another, chances are they're still
thinking in the idioms of the old platform too.

That's a good principle, and you're completely right about people dragging
their idioms along from platform to platform. If I can get away with saying
this without the flame throwers swarming out of the woodwork, I think it's
most common among people who are coming from the platform on which they
first entered the world of computing. By the time you're programming in your
third or fourth or tenth language, on your third or fourth or tenth
platform, you realize that there's nothing magic about any of them, and
there are smart people working on all of them, with plenty of good ideas.

Tom
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Michael said:
Also, they insisted of prefixing type to all their variables,
the VB6 notation of lngCount, arrList, objConn etc etc.

As the VB6 coding tool sucks, and all things being Variants,
I can understand why you do this in VB6.
Also, for the LET/SET gotcha on objects,
prefixing objects with obj is a good thing in VB6.

Hm.

I don't think all things are variants in VB6 ...

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top