Reserved Keyword

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am using a reserved keyword on my application: event. So I get the
error:
Identifier expected; 'event' is a keyword

This is for a Events project so event seems a normal word to use in
it.
I think I can use @even for example in:

void Create(Event @event);

Should I try to change the name or is it ok to just add the @ before
the name?

Thank You,
Miguel
 
I am using a reserved keyword on my application: event. So I get the
error:
Identifier expected; 'event' is a keyword

This is for a Events project so event seems a normal word to use in
it.
I think I can use @even for example in:

void Create(Event @event);

Should I try to change the name or is it ok to just add the @ before
the name?

Change the name.

The English language has a big vocabulary - you should be
able to find a name that is not a keyword and is still
descriptive.

Arne
 
Change the name.

The English language has a big vocabulary - you should be
able to find a name that is not a keyword and is still
descriptive.

Arne

The parties project would be alliterative and sounds a lot more fun.

eVent if you must be dull.
 
I am using a reserved keyword on my application: event. So I get the
error:
Identifier expected; 'event' is a keyword

This is for a Events project so event seems a normal word to use in
it.
I think I can use @even for example in:

void Create(Event @event);

Should I try to change the name or is it ok to just add the @ before
the name?

Especially for a method called "Create" I would consider naming the
parameter "newEvent" would be very appropriarte.
 
Back
Top