Loading ...
Sorry, an error occurred while loading the content.

Coding Practices and Reserved Words (beyond the basics) *LONG on Data*

Expand Messages
  • abyssoft@ymail.com
    Below is a comprehensive list of words that I consider as Reserved. I use this list to help keep me out of traps and bad Identifier choice. This also helps to
    Message 1 of 1 , Jul 4 3:22 PM
    • 0 Attachment
      Below is a comprehensive list of words that I consider as Reserved. I use this list to help keep me out of traps and bad Identifier choice. This also helps to force me to be a bit more creative with my Identifier names, and as such opens me up to more thoughtful solutions.
      I use classes and classes that emulate namespaces and avoid global primitive variables. If I should need a global scope variable I place as a field of a Global namespace. I have found this helps to keep my code both clean and highly readable.
      Another tool I use as a complement to JSLint is JSDoc-Toolkit. It helps me with organizing my code in to OOJS. Feel free to ask questions.

      // RESERVED WORDS - Contains Reserve words from HTML Tags, common file extensions,
      // Java, JavaScript, Cobol, Fortran, C#, Basic (different flavors), VB.net, SQL (different flavors),
      // Browser names, Corporate entities, and others that interfere with self-documenting code practices.
      // Some Keyword from Java/JavaScript have been omitted as they are not legal identifiers.
      // Also keywords from various JavaScript libraries have been omitted and if need should be in their own library declaration.
      // (Reserved Words A-F)
      /*global a, A, abstract, accept, Accept, add, Add, ADD, aggregate, Aggregate, AGGREGATE, alert, all, All, ALL, alter, Alter, ALTER, amaya, Amaya, Anchor, and, And, AND, any, Any, ANY, apple, Apple, Area, Arguments, array, Array, As, AS, assign, Assign, at, At, AT, average, Average, AVERAGE, b, B, base, Base, begin, Begin, BEGIN,big, Big, BIG, bigint, bigInt, Bigint, BigInt, BIGINT, bit, Bit, BIT, blur, bool, Bool, boolean, Boolean, bottom, Bottom, Break, BREAK, browser, Browser, BROWSER, bulk, Bulk, BULK, Button, by, By, BY, byte, Byte, c, C, cdata, CDATA, cache, Cache, CACHE, callee, caller, camino, Camino, captureEvents, cartesian, Cartesian, CARTESIAN, Case, CASE, cast, Cast, CAST, Catch, char, Char, CHAR, CHARACTER, check, Check, Checkbox, checkBox, checked, Checked, chrome, Chrome, Class, clearInterval, clearTimeout, clone, Clone, close, closed, comment, commit, Commit, COMMIT, concat, Concat, CONCAT, confirm, Const, constructor, Constructor, contains, Contains, CONTAINS, Continue, control, Control, count, Count, COUNT, create, Create, CREATE, currency, Currency, CURRENCY, d, D, data, Data, DATA, Date, date, datepart, datePart, Datepart, DatePart, DATEPART, datetime, dateTime, Datetime, DateTime, DATETIME, decimal, Decimal, DECIMAL, declare, Declare, def, Def, DEF, Default, defaultStatus, delegate, Delegate, Delete, DELETE, dfn, Dfn, DFn DFN, dialog, Dialog, DIALOG, dialogue, Dialogue, DIALOGUE, die, Die, dim, Dim, DIM, dimm, Dimm, DIMM distinct, Distinct, DISTINCT, divide, Divide, DIVIDE, Do, document, Document, double, Double, down, Down, dram, Dram, DRAM, drop, Drop, DROP, e, E, echo, Echo, element, Element, Else, ELSE, elseif, elseIf, empty, Empty, end, End, END, enddeclare, endDeclare, EndDeclare, endfor, endFor, EndFor, endforeach, endforEach, endForeach, endForEach, Endforeach, EndforEach, EndForeach, EndForEach, endif, endIf, EndIf, endwhile, endWhile, EndWhile, endwith, endWith, Endwith, EndWith, ENDWITH, Enum, ENUM, enumeration, Enumeration, ENUMERATION, epiphany, Epiphany, equal, Equal, EQUAL, escape, Eval, event, Event, exception, Exception, except, Except, EXCEPT, exclude, Exclude, EXCLUDE, exit, Exit, EXIT, explicit, Explicit, explorer, Explorer, Export, Extends, extern, Extern, f, F, fact, Fact, FACT, False, file, File, FileUpload, final, Final, Finally, find, Find, firefox, fireFox, FireFox, first, First, FIRST, fixed, Fixed, float, Float, flock, Flock, focus, Focus, For, foreach, forEach, ForEach, Form, Frame, frames, Frames, from, From, FROM, Function, FUNCTION */
      // (Reserved Words G-M)
      /*global g, G, geography, Geography, GEOGRAPHY, get, Get, GET, getClass, global, go, Go, GO, google, Google, gosub, Gosub, goSub, GoSub, GOSUB, goto, Goto, GoTo, GOTO, grant, Grant, GRANT, group, Group, GROUP, groupby, groupBy, Groupby, GroupBy, GROUPBY, groupjoin, groupJoin, Groupjoin, GroupJoin, GROUPJOIN, h, H, hash, Hash, HASH, hashtable, hashTable, Hashtable, HashTable, HASHTABLE, having, Having, HAVING, Hidden, history, History, home, Home, html, Html, HTML, i, I, icab, iCab, ICab, id, Id, ID, If, IF, image, Image, Implements, implicit, Implicit, Import, IMPORT, imports, Imports, IMPORTS, In, include, Include, INCLUDE, index, Index, INDEX, infinity, inherit, Inherit, init, Init, INIT, innerHeight, innerWidth, input, Input, INPUT, insert, Insert, INSERT, instanceOf, InstanceOf, int, Int, INT, int16, Int16, INT16, int32, Int32, INT32, int64, Int64, INT64, integer, Integer, INTEGER, Interface, internal, Internal, internet, Internet, internetExplorer, InternetExplorer, intersect, Intersect, INTERSECT, into, Into, INTO, isFinite, IsFinite, isNaN, IsNaN, isset, isSet, IsSet, j, J, java, Java, javaArray, JavaArray, javaClass, JavaClass, javaObject, JavaObject, javaPackage, JavaPackage, join, join, JOIN, k, K, key, Key, KEY, kmelon, k_melon, kMelon, k_Melon, KMelon, K_Melon, konqueror, Konqueror, l, L, label, Label, LABEL, last, Last, LAST, left, Left, length, Length, Let, LET, Link, link, list, List, location, Location, lock, Lock, locationbar, long, Long, loop, Loop, LOOP, m, M, macro, Macro, MACRO, Math, math, min, Min, MIN, max, Max, MAX, maxthon, Maxthon, menubar, merge, Merge, MERGE, method, Method, METHOD, micro, Micro, MICRO, microsoft, microSoft, Microsoft, MicroSoft, MimeType, mod, Mod, MOD, mode, Mode, MODE, modulus, moveBy, moveTo, multiply, Multiply, MULTIPLY */
      // (Reserved Words N-S)
      /*global n, N, name, Name, namespace, Namespace, nameSpace, NameSpace, nan, NATIONAL, native, Native, NATIVE, natural, Natural, NATURAL, navigate, navigator, Navigator, nchar, Nchar, nChar, NChar, NCHAR, netscape, Netscape, NetScape, netsurf, netSurf, NetSurf, New, next, Next, NEXT, no, No, NO, Null, number, Number, NUMBER, numeric, Numeric, NUMERIC, nvarchar, nvarChar, nVarchar, Nvarchar, NvarChar, NVarchar, NVarChar, NVARCHAR, o, O, object, Object, of, Of, OF, off, Off, OFF, oftype, ofType, OfType, OFTYPE, omniweb, omniWeb, Omniweb, Omniweb, on, On, ON, onBlur, onError, onFocus, onLoad, onUnload, open, Open, OPEN, opener, opera, Opera, operator, Operator, option, Option, or, Or, OR, oracle, Oracle, order, Order, ORDER, orderby, orderBy, Orderby, OrderBy, ORDERBY, ordered, Ordered, out, Out, outerHeight, outerWidth, output, Output, OUTPUT, overload, overLoad, override, overRide, p, P, Packages, pageXoffset, pageYoffset, params, Params, parent, parseFloat, parseInt, password, Password, pause, Pause, PAUSE, peek, Peek, PEEK, persistent, Persistent, PERSISTENT, personalbar, personalBar, play, Play, PLAY, plugin, Plugin, poke, Poke, POKE, precision, Precision, PRECISION, primary, Primary, PRIMARY, print, Print, PRINT, Private, proc, Proc, PROC, procedure, Procedure, PROCEDURE, prom, Prom, PROM, prompt, Prompt, Protected, prototype, Prototype, Public, q, Q, quit, Quit, QUIT, r, R, radio, Radio, ram, Ram, RAM, rate, Rate, RATE, read, Read, READ, readonly, readOnly, ReadOnly, real, Real, REAL, redim, Redim, reDim, ReDim, REDIM, ref, Ref, regexp, regExp, RegExp, releaseEvents, rem, Rem, REM, remark, Remark, REMARK, rename, Rename, RENAME, repeat, Repeat, REPEAT, reset, Reset, resizeBy, resizeTo, Return, RETURN, reverse, Reverse, REVERSE, revoke, Revoke, REVOKE, right, Right, rollback, Rollback, rollBack, RollBack, ROLLBACK, rom, Rom, ROM, routeEvent, run, Run, RUN, s, S, safari, Safari, save, Save, SAVE, savepoint, Savepoint, savePoint, SavePoint, SAVEPOINT, sbyte, sByte, SByte, scale, Scale, SCALE, scroll, scrollbars, scrollBy, scrollTo, sealed, Sealed, seamonkey, seaMonkey, Seamonkey, SeaMonkey, small, Small, smallint, smallInt, Smallint, SmallInt, SMALLINT, select, Select, SELECT, selectmany, selectMany, Selectmany, SelectMany, SELECTMANY, self, Self, set, Set, SET, setInterval, setTimeout, short, Short, sizeof, sizeOf, skip, Skip, SKIP, skipwhile, skipWhile, Skipwhile, SkipWhile, SKIPWHILE, some, Some, SOME, sort, Sort, SORT, sputnik, Sputnik, stackalloc, stackAlloc, start, Start, START, Static, status, Status, statusbar, statusBar, stop, Stop, string, String, struct, Struct, sub, Sub, SUB, submit, Submit, subtract, Subtract, SUBTRACT, sum, Sum, SUM, sun, Super, swap, Swap, SWAP, Switch, sync, Sync, SYNC, synchronized, Synchronized */
      // (Reserved Words S-Z)
      /*global t, T, tab, Tab, TAB, table, Table, TABLE, taint, Taint, take, Take, TAKE, takewhile, takeWhile, Takewhile, TakeWhile, TAKEWHILE, text, Text, textarea, textArea, Textarea, TextArea, then, Then, THEN, thenby, thenBy, Thenby, ThenBy, THENBY, This, through, Through, THROUGH, Throw, throws, Throws, thru, Thru, THRU, time, Time, TIME, times, Times, TIMES, toolbar, toolBar, Toolbar, ToolBar, top, Top, toString, transaction, Transaction, TRANSACTION, transient, Transient, True, truncate, Truncate, TRUNCATE, Try, TRY, type, Type, TYPE, typeOf, TypeOf, u, U, unescape, unEscape, Unescape, uint, uInt, UINT, uint16, Uint16, UInt16, UINT16, uint32, Uint32, UInt32, UINT32, uint64, Uint64, UInt64, UINT64, ulong, uLong, unchecked, unChecked, unit, Unit, UNIT, unordered, unOrdered, Unordered, update, Update, UPDATE, unsafe, Unsafe, use, Use, ushort, uShort, using, Using, untaint, unTaint, Untaint, until, Until, UNTIL, unwatch, unWatch, UnWatch, Unwatch, v, V, value, Value, VALUE, values, Values, VALUES, valueof, valueOf, Valueof, ValueOf, Var, VAR, varchar, Varchar, varChar, VarChar, VARCHAR, variable, Variable, VARIABLE, variant, Variant, virtual, Virtual, Void, VOID, w, W, wait, Wait, WAIT, watch, Watch, wend, Wend, WEND, While, WHILE, when, When, WHEN, window, Window, With, work, Work, WORK, write, Write, writeline, writeLine, Writeline, WriteLine, writeln, writeLn, Writeln, WriteLn, x, X, xml, Xml, XML, xor, Xor, XOR, y, Y, yes, Yes, YES, zero, Zero, ZERO */
    Your message has been successfully submitted and would be delivered to recipients shortly.