-
Crazy naming convention
MS is recommending that similar items should *end* with the same word, like
ApplicationException, IndexOutOfRangeException, SolidBrush, HatchBrush etc.
But it would be a shitload easier to find all these things if they *started*
with the same word, then they would be logically grouped in intellisense,
objectbrowser, help etc. Am I missing something?
--
Michael Culley
www.vbdotcom.com
-
Re: Crazy naming convention
Welcome to 1984.
--
[Microsoft Basic: 1976-2001, RIP]
"Michael Culley" <mike@vbdotcom.com> wrote in message news:3ce2d5b9@10.1.10.29...
> MS is recommending that similar items should *end* with the same word, like
> ApplicationException, IndexOutOfRangeException, SolidBrush, HatchBrush etc.
> But it would be a shitload easier to find all these things if they *started*
> with the same word, then they would be logically grouped in intellisense,
> objectbrowser, help etc. Am I missing something?
>
> --
> Michael Culley
> www.vbdotcom.com
>
>
>
>
>
-
Re: Crazy naming convention
Michael Culley wrote:
> MS is recommending that similar items should *end* with the same
> word, like ApplicationException, IndexOutOfRangeException,
> SolidBrush, HatchBrush etc. But it would be a shitload easier to find
> all these things if they *started* with the same word, then they
> would be logically grouped in intellisense, objectbrowser, help etc.
> Am I missing something?
senseintelli and browserobject mean do you? Unless a Jedi are you,
worth not think I it is ;-)
Consistency is more important IMO, and the natural english way is easier
to enforce. The logical grouping also works the other way, for example
a quick look in the SDK index lists numerous ApplicationXXX classes.
Although I do agree, that in an ideal world (perhaps a non-english
speaking one), the base class names would come first.
--
David
-
Re: Crazy naming convention
On Thu, 16 May 2002 07:58:52 +1000, "Michael Culley" <mike@vbdotcom.com>
wrote:
>Am I missing something?
Yeah, BrushHatch sounds stupid. :-)
--
Turn on, tune in, download.
zane@mvps.org
-
Re: Crazy naming convention
I don't really care how it sounds, I want productivity. If I'm writing some
code and want to throw an exception but am not sure which one is best suited
then it is very easy to type Throw New Exception and then just scroll the
list. The way it is now I have to know what all the exceptions are or go
searching for them.
--
Michael Culley
www.vbdotcom.com
"Zane Thomas" <zane@mabry.com> wrote in message
news:3d1ff695.280401984@news.devx.com...
> On Thu, 16 May 2002 07:58:52 +1000, "Michael Culley" <mike@vbdotcom.com>
> wrote:
>
> >Am I missing something?
>
> Yeah, BrushHatch sounds stupid. :-)
>
>
> --
> Turn on, tune in, download.
> zane@mvps.org
-
Re: Crazy naming convention
On Thu, 16 May 2002 11:06:01 +1000, "Michael Culley" <mike@vbdotcom.com>
wrote:
>I don't really care how it sounds, I want productivity.
HatchBrush is a whole lot easier to remember than BrushHatch, at least for
english-speaking programmers.
--
Turn on, tune in, download.
zane@mvps.org
-
Re: Crazy naming convention
> HatchBrush is a whole lot easier to remember than BrushHatch, at least for
> english-speaking programmers.
But the point is that I have to remember it. If they all start with Brush
then all I have to remember is Brush.
--
Michael Culley
www.vbdotcom.com
-
Re: Crazy naming convention
On Thu, 16 May 2002 14:52:03 +1000, "Michael Culley" <mike@vbdotcom.com>
wrote:
>But the point is that I have to remember it. If they all start with Brush
>then all I have to remember is Brush.
Dunno about you, but I find it easier to remember things that make sense.
OneWay & TwoWay instead of WayOne & WayTwo. <g>
But wrt HatchBrush, the contexts in which you get intellisense for that
are rather limited anyway. So if you really are having a problem with
your memory <g> you could do this:
public class Brushes
{
static public HatchBrush Hatch(HatchStyle style, Color foreColor,
Color backColor)
{
return new HatchBrush(style, foreColor, backColor);
}
static public SolidBrush Solid(Color color)
{
return new SolidBrush(color);
}
}
And then you would get easy-to-use intellisense whenever you wanted to
create a specific brush:
HatchBrush b = Brushes.Hatch(HatchStyle.BackwardDiagonal, Color.Black,
Color.White);
SolidBrush s = Brushes.Solid(Color.Red);
Is that cool or what? :-)))
--
Turn on, tune in, download.
zane@mvps.org
-
Re: Crazy naming convention
On Thu, 16 May 2002 05:43:51 GMT, zane@mabry.com (Zane Thomas) wrote:
> HatchBrush b
Yes I know, but you can use Brushes. ... first, pick out your brush (the
return type given by intellisense is the type you need) and then Home and
fill in the correct name.
But if you're memory is as bad as you say every little bit should help.
:-)
--
Turn on, tune in, download.
zane@mvps.org
-
Re: Crazy naming convention
> But if you're memory is as bad as you say every little bit should help.
> :-)
Are you forgetting that you are the one who introduced memory to this
discussion? Obviously your memory is not what you think 
Brushes are easy enough to remember because there are only a few of them,
but its not so easy with exceptions.
As I said, memory is something you introduced, my real issue is with how
easy it is to find these items.
--
Michael Culley
www.vbdotcom.com
-
Re: Crazy naming convention
On Thu, 16 May 2002 16:37:56 +1000, "Michael Culley" <mike@vbdotcom.com>
wrote:
>As I said, memory is something you introduced, my real issue is with how
>easy it is to find these items.
Exceptions are easy to find. Go to System.Exception and click on a couple
"derived classes" links, and you end up here:
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemsystemexceptionclasshierarchy.htm
for a complete list.
Part of learning .net is - imo - learning how to find things in the docs.
And there's lots to learn. :-)
--
Turn on, tune in, download.
zane@mvps.org
-
Re: Crazy naming convention
Sure, but it would just be easier if they all started with exception. When I
type 'throw new exception' its alot easier if I don't have to go off to the
docs. Generally, this is the method I use in alot of places, for example, in
the VB6 app I am working on at the moment I have frmReportCustomer,
frmReportInvoice etc. It groups all the report forms in one place and makes
them easy to find. I think the method works quite well. I do agree with you
that the names would sound better as CustomerReport etc, but this is a tiny
sacrifice for the gain of having similar items grouped together.
Besides, if things in programming languages should mimic the real world then
why not use 1 base everywhere, I mean who lives at 0 City Road?
--
Michael Culley
www.vbdotcom.com
"Zane Thomas" <zane@mabry.com> wrote in message
news:3d29626d.308010109@news.devx.com...
> On Thu, 16 May 2002 16:37:56 +1000, "Michael Culley" <mike@vbdotcom.com>
> wrote:
>
> >As I said, memory is something you introduced, my real issue is with how
> >easy it is to find these items.
>
> Exceptions are easy to find. Go to System.Exception and click on a couple
> "derived classes" links, and you end up here:
>
>
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemsystemexceptionclasshierar
chy.htm
>
> for a complete list.
>
> Part of learning .net is - imo - learning how to find things in the docs.
> And there's lots to learn. :-)
>
>
> --
> Turn on, tune in, download.
> zane@mvps.org
-
Re: Crazy naming convention
"Michael Culley" <mike@vbdotcom.com> wrote:
>I do agree with you
>that the names would sound better as CustomerReport etc, but this is a tiny
>sacrifice for the gain of having similar items grouped together.
We're never going to agree, do whatever you like.
>Besides, if things in programming languages should mimic the real world then
>why not use 1 base everywhere, I mean who lives at 0 City Road?
Osama bin Laden?
But I never said programming languages should mimic the real world. And
as far as zero-based arrays go they are simply easier to handle in a
variety of indexing calculations because they don't require sprinkling +1
all over the damned place. :-)
--
Turn on, tune in, download.
zane@mvps.org
-
Re: Crazy naming convention
On Thu, 16 May 2002 03:13:40 GMT, zane@mabry.com (Zane Thomas) wrote:
>HatchBrush is a whole lot easier to remember than BrushHatch, at least for
>english-speaking programmers.
Maybe you should all learn German. As one who has translated INto
German professionally for many years, I do not find it strange at all.
Technical German is very succinct and precise. Maybe why they are so
successful in producing goods (and weapons) of the highest quality.
MM
-
Re: Crazy naming convention
On Thu, 16 May 2002 14:52:03 +1000, "Michael Culley"
<mike@vbdotcom.com> wrote:
>But the point is that I have to remember it. If they all start with Brush
>then all I have to remember is Brush.
In a way, all OOP aficionados should be supporting your thesis, which
I tend to agree with. If I have an object, Tree, I could have
properties like Tree.Height, Tree.Kind; and methods like Tree.Prune or
Tree.Train. The key thing I would have to remember, and one that I'd
find immediately in my autointelligencesense drop-down, is "Tree". I
wouldn't spend ages looking first at "Height", "Kind", "Prune", or
"Train", all of which can have totally different meanings, or even, in
the case of Kind, from a different language (German for child).
MM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks