iOSView naming convention

Just a silly little question for you this evening: if, like me, you prefix your controls with three letters, what do you use for iOSView? For a window on the desktop, I traditionally used winXXXXX, so I’d have winStart, winLogin, winMain etc. For iOSViews, I’ve thought of vewMain, vieMain but they’re all pretty bad. And I can’t possibly start doing having a four-letter prefix, I’ve been doing this too long to break that rule!

For the moment, I’m using winXXXXX again but I’d like to hear what you’re using.

Disclaimer: this discussion is not intended to start World War 3 over whether controls should have a prefix. Of course they should.

I’ve been postfixing my view names with “View”. So I have “MainView”, “ActivityView”, “SoundsView” etc. But that is completely different from your style :stuck_out_tongue:

Not :slight_smile:

I dont prefix things this way as its far to easy to “just leave the name alone but change the type” - which has happened in a few code bases I’ve worked on

[quote=168433:@Gavin Smith]Just a silly little question for you this evening: if, like me, you prefix your controls with three letters, what do you use for iOSView? For a window on the desktop, I traditionally used winXXXXX, so I’d have winStart, winLogin, winMain etc. For iOSViews, I’ve thought of vewMain, vieMain but they’re all pretty bad. And I can’t possibly start doing having a four-letter prefix, I’ve been doing this too long to break that rule!

For the moment, I’m using winXXXXX again but I’d like to hear what you’re using.

Disclaimer: this discussion is not intended to start World War 3 over whether controls should have a prefix. Of course they should.[/quote]

A rose, by any other name…

Why don’t you go on with what you are comfortable with ? If it works for you, who is going to argue because you call views by windows names ? As long as you find your way in the code, that is what counts, right ?

[quote=168443:@Norman Palardy]Not :slight_smile:

I dont prefix things this way as its far to easy to “just leave the name alone but change the type” - which has happened in a few code bases I’ve worked on[/quote]
Right - I only prefix controls though, not often that I change the type on those :slight_smile:

I’m not comfortable with it, which is why I’m asking :slight_smile: It hurts my OCD!

Then take a deep breath and start using viewXXXX. Give yourself the luxury of an extra byte of descriptive. Long past is the time we had to count every byte in the 1 K of a Sinclair ZX-81 using part of it for the screen :wink:

Live large !

Even worked on those where a popup turns into a combobox etc.
I just find the larger a code base / product gets the less likely you are to go fix the increasingly large number of references that use that name when / if you do change it’s type (whether its a property control etc) Hence avoiding such names avoids the issue all together.
YMMV

Wouldn’t that be CDO then ? :stuck_out_tongue:

You should just rip off Bob’s naming conventions then
They’ve been pretty pedantic about them & posted their entire set on his blog once upon a time

However you decide to attack this just be consistent with them

[quote=168479:@Norman Palardy]You should just rip off Bob’s naming conventions then
They’ve been pretty pedantic about them & posted their entire set on his blog once upon a time

However you decide to attack this just be consistent with them[/quote]

I have a set of naming conventions that I’ve been using since the dawn of time. iOSViews is one control I haven’t settled on a prefix for, hence this little thread. I’ve seen Bob’s list but that was pre-iOS.

Come on prefixers, don’t let these post-fixers and no-fixers silence you! Together we can stay strong! :wink:

Oh, I forgot something we did in memory scarce time : remove vowels. So you could prefix “Vw”. Saves you one character :wink:

Of course, it sounds like Das auto. Or you could go SVw for iOSView.

iov
You know immediately it stands for iOSView :slight_smile:

Well at least I do

[quote=168480:@Gavin Smith]I have a set of naming conventions that I’ve been using since the dawn of time. iOSViews is one control I haven’t settled on a prefix for, hence this little thread. I’ve seen Bob’s list but that was pre-iOS.

Come on prefixers, don’t let these post-fixers and no-fixers silence you! Together we can stay strong! ;)[/quote]

The first time I ran into this was in a few hundred thousand lines of C where someone had infamously changed the type and NOT changed the name in all the places it was used as that would have been “painful” so I was told - and I’d believe them to some extent as it would have meant altering a few hundred source files.

The system didn’t have a nice debugger like Xojo’s or even iOS or Metrowerks old on in CW
It was printf debugging all the way and that was also a chore since - the “name” said this thing is a float but the compiler bitched about it being a double. So the hunt was on. It didn’t take long to find this was the case but certainly was illustrative of the problem.
Had the same issue in a fairly large 4D client server set up and have seen it from time to time nearly everywhere I’ve worked in many languages. In some its easier to find the issue than others.

The problem comes when you adopt code from others who use different prefixes.
Do you go alter their source code to meet your rules or just adopt it as is - say MacOSLib?
If so then updating to any newer version becomes a pile of work.
Or worse now you have inconsistent prefixes and have to remember “Oh right that comes from there and they use … as a prefix where I’d use …”
And keeping all that in your head hurts after a while.

If it works for you & you have a big stick to beat anyone who doesn’t follow your coding standard for code you collaboratively work on then great.
I prefer to just name things for their purpose and leave the type out of the name.

And note I’m not saying your way is / isn’t right or wrong regardless of what I think of it :stuck_out_tongue:

YMMV

I use the prefix ‘vw’ for views.