tags:

views:

223

answers:

7

I'm writing an Event Booking system in C#, which is vexing me greatly because "event" and "delegate" are reserved words. "Delegate" I've changed to "Attendee", but I can't think of an alternative name for the Event class (and instances thereof). The best I've come up with is "Happening", which is a little bit 1970s for my liking. Plus, the classes will be exposed via a customer API so I have to use professional terminology.

Any suggestions would be most gratefully received.

Edit: it is mainly the naming of instances and parameters that is bothering me:

public Booking CreateBooking(Event event, Person person);
+2  A: 

If you really want to use a C# reserved word, you can prefix it with '@'.

E.g.

public class @class
{
  ...
}

Use with caution...

Chris Needham
+2  A: 

I would just go with Event. Type names are case-sensitive, so there is a distinction between event and Event. It is (in my humble opinion) the least confusing and most clear solution to the problem.

JoshJordan
+2  A: 

I would personally just use Event. That doesn't come up as a type name very often. One alternative might be Meeting but it depends on what kind of events you're talking about.

Event really is the right name in the business domain here, for calendars in general.

If you've got recurrent events though, you'll also have exceptions. They're fun - is an EventException an exception to a recurrent event, or a failure to do something with an exception?

None of this can even touch fun with time zones though.

Jon Skeet
+1  A: 

But, event is a keyword, not Event (case sensitivity). Why not use Event? It seems like it is the best name for the job.

Brian Genisio
A: 

C# is case sensitive, why not go with "Event" (capital E)?

JohnFx
A: 

Event at thesaurus.reference.com

Or think about using Event and @event.

Daniel Brückner
A: 

You could always fall back to old-school naming by pre-pending your classes with a "C" (for Class)

CEvent,CDelegate,CMyClass

Muad'Dib