Questions tagged [reserved-words]

reserved words are specific words in any language which are banned from use by authors, because of the special meaning they have in the language.

The language may have reserved words it is not currently using (Java has goto). While generally unwanted, new reserved words may also be added as the language evolves (since the version 1.5 Java treats enum as a reserved word, causing problems for the old code).

Some words that are commonly assumed as reserved are actually not reserved (for instance, it is ok to write int String = 1 in Java).

340 questions
632
votes
7 answers

What is the equivalent of Java's final in C#?

What is the equivalent of Java's final in C#?
Nosrama
  • 14,530
  • 13
  • 49
  • 58
622
votes
4 answers

What does the @ symbol before a variable name mean in C#?

I understand that the @ symbol can be used before a string literal to change how the compiler parses the string. But what does it mean when a variable name is prefixed with the @ symbol?
Greg
  • 10,360
  • 6
  • 44
  • 67
336
votes
9 answers

What's the use/meaning of the @ character in variable names in C#?

I discovered that you can start your variable name with a '@' character in C#. In my C# project I was using a web service (I added a web reference to my project) that was written in Java. One of the interface objects defined in the WSDL had a…
Remko Jansen
  • 4,649
  • 4
  • 30
  • 39
169
votes
8 answers

Reserved keywords in JavaScript

What JavaScript keywords (function names, variables, etc) are reserved?
titanous
  • 3,668
  • 3
  • 27
  • 26
156
votes
5 answers

How do I escape a reserved word in Oracle?

In TSQL I could use something like Select [table] from tablename to select a column named "table". How do I do this for reserved words in oracle? Edit: I've tried square braces, double quotes, single quotes, and backquotes, they don't work... As a…
Spence
  • 28,526
  • 15
  • 68
  • 103
149
votes
5 answers

Cannot create a database table named 'user' in PostgreSQL

It seems PostgreSQL does not allow to create a database table named 'user'. But MySQL will allow to create such a table. Is that because it is a key word? But Hibernate cannot identify any issue (even if we set the PostgreSQLDialect).
Channa
  • 4,963
  • 14
  • 65
  • 97
145
votes
3 answers

What is the "type" reserved word in TypeScript?

I just noticed when trying to create an interface in TypeScript that "type" is either a keyword or a reserved word. When creating the following interface, for example, "type" is shown in blue in Visual Studio 2013 with TypeScript 1.4: interface…
Adam Goodwin
  • 3,951
  • 5
  • 28
  • 33
57
votes
10 answers

What is the difference between "keyword" and "reserved word"?

What's the difference between a keyword and a reserved word? For example, in the proposal for concepts in C++ one can read the following statement: This proposal introduces five new keywords: concept, concept map, where, axiom, and late check.…
56
votes
4 answers

Using reserved words as property names, revisited

Can a reserved word be used as an object's property name? This issue was raised indirectly in a previous Stack Overflow question: Browser support for using a reserved word as a property name in JavaScript. The answer seemed general consensus by Alex…
cc young
  • 18,939
  • 31
  • 90
  • 148
54
votes
4 answers

Is it bad practice to use a built-in function name as an attribute or method identifier?

I know to never use built-in function names as variable identifiers. But are there any reasons not to use them as attribute or method identifiers? For example, is it safe to write my_object.id = 5, or define an instance method dict in my own class?
max
  • 49,282
  • 56
  • 208
  • 355
53
votes
6 answers

Is it safe to use the python word "type" in my code?

Can I use the word type in my own code or is it reserved? My function header: def get( self, region='Delhi', city='Delhi', category='Apartments', type='For sale', limit=60, PAGESIZE=5, year=2012, month=1, …
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
49
votes
4 answers

SQL error: Incorrect syntax near the keyword 'User'

I am using SQL to insert data to SQL Database file using C# as follows. String cs = System.Configuration.ConfigurationManager.ConnectionStrings["connection1"].ConnectionString; SqlConnection conn = new SqlConnection(cs); String sql =…
Muneer
  • 7,384
  • 7
  • 38
  • 62
48
votes
1 answer

Syntax error due to using a reserved word as a table or column name in MySQL

I'm trying to execute a simple MySQL query as below: INSERT INTO user_details (username, location, key) VALUES ('Tim', 'Florida', 42) But I'm getting the following error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual…
Amal Murali
  • 75,622
  • 18
  • 128
  • 150
39
votes
3 answers

What exactly does the T-SQL "LineNo" reserved word do?

I was writing a query against a table today on a SQL Server 2000 box, and while writing the query in Query Analyzer, to my surprise I noticed the word LineNo was converted to blue text. It appears to be a reserved word according to MSDN…
LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
36
votes
6 answers

Is 'event' a reserved word in JavaScript?

I am a beginner to Javascript. And when I was practicing I have noticed something. Take this function: