What naming mistakes do AI assistants commonly make in EK9?
← Variable Naming Rules and Conventions · Ref: Q927
AI assistants (ChatGPT, Copilot, Claude) constantly generate banned variable names because they learned from Java/Python where these names are legal. The most common AI mistakes from the banned list are: temp, data, value, buffer, flag, object.
EK9 bans these non-descriptive names (E11031): temp, tmp, flag, flg, data, dat, object, obj, value, val, buffer, buf, arg (and arg0, arg1, ...). These are case-insensitive. Names like result, count, item, input, output, status, str, num, index, list, map, set, key, state, type, config, param, var, ret, res are NOT banned.
Separately, E11032 bans operator keywords as variable names: empty, length, contains, abs, sqrt, close, matches.
AI FIX TABLE (for the banned names):
- temp, tmp -> temporaryUser, calculationResult
- flag, flg -> isValid, hasPermission, wasProcessed
- data, dat -> customerData, configData, requestPayload
- object, obj -> user, order, session
- value, val -> price, count, threshold
- buffer, buf -> inputBuffer, responseBuffer
- arg -> other, item, amount, message
ALWAYS ALLOWED EXCEPTIONS:
- Single-character: x, y, z, i, j, k (math variables, loop counters)
- Compound words: dataProcessor, resultSet, countdownTimer
- Descriptive: customerName, orderTotal, retryLimit
Example
defines module qa.naming.aimistakes defines function <?- Shows AI-corrected naming patterns. -?> fetchSensorData() as pure <- payload as String: "temperature=22.5" calculateTotal() as pure -> unitPrice as Float orderQuantity as Integer <- orderTotal as Float: unitPrice * #^ orderQuantity defines program AiMistakesDemo() stdout <- Stdout() // AI would write: data <- fetchSensorData() BANNED // FIXED: descriptive name payload <- fetchSensorData() stdout.println(`Payload: ${payload}`) // AI would write: value <- calculateTotal(...) BANNED // FIXED: descriptive name orderTotal <- calculateTotal(29.99, 3) stdout.println(`Total: ${orderTotal}`) // AI would write: tmp <- 5 BANNED // FIXED: descriptive name retryAttempt <- 5 stdout.println(`Retries: ${retryAttempt}`) // Compound words: ALLOWED dataProcessor <- "xml" resultCache <- "warm" stdout.println(`Processor: ${dataProcessor}, Cache: ${resultCache}`) // Single-char math: ALLOWED x <- 1.0 y <- 2.0 stdout.println(`Point: ${x}, ${y}`)
Common mistakes
E11031 — The non-descriptive name 'data' is banned by E11031; use a descriptive name such as 'payload' instead. See ek9 -h E11031 for details.
Incorrect:
data <- fetchSensorData() stdout.println(`Payload: ${data}`)
Correct:
payload <- fetchSensorData() stdout.println(`Payload: ${payload}`)
Other ways to ask this
- Why does AI-generated EK9 code fail with E11031?
- What banned names do LLMs use most often?
- How do I fix AI naming errors in EK9?
Keywords: banned, fix, naming, AI, E11031, common, LLM, mistake