This page lists information/tips/reminders for maintaining this website.
If a programming language is added to the cheat sheets, update these pages in this order: cheatsheets.js Search Programming Language Cheat Sheets The Universal Function Library Project [feature recommendations] Online Compilers Timeline of New Features - Programming Language Comparison Documentation Links - Programming Language Cheat Sheets
What's New? Remember to add a 'year' header for each year. JEE.js Remember to keep the date up-to-date. (When you update a file, remember to update the date.)
Variable names are typically of the form 'vValue' and 'oObj'. Note: 'v' for value, don't use 'b'/'f'/'n'/'i'/'s' for bool/float/number/int/string. This convention is uncommon, but aids readability/maintainability. It also avoids name collisions with built-in constants, resulting in variable names typically working in all programming languages. For Excel and SQL variants, use 'My' instead of of 'v'/'o'. For Excel, sometimes use 'A1' for key variables (e.g. instead of 'MyText'). For SQL variants, sometimes use 'MyCol' for key variables (e.g. instead of 'MyText'). Some generic return value variable names: vRet (return), vBool, vTextNew, oArrayNew. Further variable names: vPfx/vIfx/vSfx: for prefix/infix/suffix respectively.
Some key points to consider when copying and pasting from one language as a template for other languages. PHP variables need the '$' prefix. AutoHotkey uses ':=' not '=' for assignment. Go uses ':=' most of the time for creating variables, but this can also be done with '=' (and slightly different syntax). Python often uses ':' at the end of lines (e.g. def, for, if/elif/else). Array (linear array) equivalents: C++/Rust use arrays/vectors. Go uses arrays/slices. Python uses lists. R uses vectors/lists. (C#/Java/Kotlin/Scala use arrays/lists.) Map (associative array) equivalents: C++/Python/Swift use dictionaries. (PHP uses arrays as linear arrays and as associative arrays.) To avoid confusion with other programming languages/terms (when using LLMs): Refer to C as 'C-lang'. (Not 'Clang'.) Refer to Crystal as 'Crystal-lang'. (LLMs can confuse it with Crystal Reports.) Refer to Go as 'Golang'. Refer to R as 'R-lang'. (Specify 'base R' to avoid references to third-party libraries.) Collations: SQL Server: prefer Latin1_General_100_BIN2, over Latin1_General_BIN/Latin1_General_BIN2.
Typical tags within square brackets, include: [also [note [can use [e.g. [WARNING [requires [or [for 'UFL' lines only] [type [beforehand [MAJOR WARNING [afterwards [see also [item order [algorithm [version [inverse [alias [deprecated [workaround [non-standard [e.g. for BBCode]
'UFL' lines should be of the form: UFL: MyFuncName [or MyFuncNameAlt1/MyFuncNameAlt2][function description][function notes 1][function notes 2][see also: MyOtherFunc1/MyOtherFunc2] 'UFL: (MyFuncName)', in parentheses, indicates a function of lower priority. Note: '[or MyFuncNameAlt1', not '[or: MyFuncNameAlt1', no colon. '___' indicates no content. However, on the Operators and Symbols page... '[none]' is more common. For the dates page, there are additional rows: 'JavaScript (Temporal)'. One-liners via pilcrows: For most programming languages, multi-liners can be made into one-liners using semicolons (or commas/colons, see the 'SymSep' category in 'Operators and Symbols'). If code cannot be represented as a one-liner, one option is to use pilcrows: E.g. 'UFL: Version': Excel VBA: ___ [e.g. (replace pilcrows with line breaks): #If VBA6 Then¶ Debug.Print "VBA6+"¶#End If] Swift: ___ [e.g. (replace pilcrows with line breaks): #if swift(>=5.9.0)¶ print("Swift 5.9.0+")¶#endif] (Another option is to use multiple lines, e.g. 'UFL: StrMultiLineDemo'.) Documentation links: For Crystal URLs, use '/latest/' rather than '/master/' or fixed version numbers. Referring to functions/methods/keywords: Refer to functions/methods with parentheses: e.g. MyFunc()/MyMethod(). Refer to keywords with apostrophes: e.g. 'MyKeyword'. Map/Object: The Map and (JavaScript-like) Object categories should be equivalent. I.e. any Map category should have an Object functional equivalent, and vice versa. 'Beforehand': In the cheat sheets, previously, 'beforehand' was used more (separating code examples into a main code line, and an additional line). But semicolon one-liners are easier to understand, and copy-and-paste. Thus avoid 'beforehand', with some exceptions, e.g. variables that tend to be defined once per code block. E.g. creating a random number generation object. E.g. creating a time zone object. E.g. creating a collation (string settings) object.
Ideally, the text version of the website, i.e. copied and pasted into Notepad, should be fairly readable. I.e. in particular, the number of blank lines between items. See '[FIX]' on the What's New? page for potential issues affecting website layouts. I include the 'FIX' notes because they can be invaluable for programmers/web devs, these little hints can save countless hours of debugging, and can alert people to crucial problems with their software/websites that they might be unaware of.
At present, all code on the website is permitted to use the latest JavaScript. The exception is JEE.js, the functions should be compatible with Internet Explorer 11, so that they can be used with HTMLFile objects in Windows. JEE.js E.g. some nested loop text manipulations are faster using JavaScript in an HTMLFile object, than using native AutoHotkey code.
Two key terms to use regarding errors are 'syntax error' and 'throw'. Code that fails before execution is typically a syntax error. Syntax errors are a subset of compile-time errors. (An example of a compile-time error that isn't a syntax error, is a missing include file.) Code that fails during execution is typically described as throwing (or a runtime error).