Which of these names would be rejected by the EK9 compiler?

← Variable Naming Rules and Conventions · Ref: Q926

Here is how to spot banned names. EK9 bans exactly 12 non-descriptive names (E11031): temp, tmp, flag, flg, data, dat, object, obj, value, val, buffer, buf. These are case-insensitive.

Names like str, num, item, result, input, output, count, index, list, map, set, key, status, state, type, config, param, arg, var, ret, res are NOT banned.

Separately, E11032 bans operator keywords as variable names: empty, length, contains, abs, sqrt, close, matches.

SPOTTING GUIDE:

- 'customerName' -> ALLOWED (descriptive)
- 'name' -> ALLOWED (not in banned list)
- 'data' -> BANNED (E11031)
- 'dataProcessor' -> ALLOWED (compound word)
- 'x' -> ALLOWED (single-char)
- 'temp' -> BANNED (E11031)
- 'temperature' -> ALLOWED (descriptive, not 'temp')
- 'result' -> ALLOWED (not in the 12 banned names)
- 'searchResult' -> ALLOWED (compound word)

ALWAYS ALLOWED EXCEPTIONS:

- Single-character: x, y, z, i, j, k (math variables, loop counters)
- Compound words: errorCount, inputValidator, configPath
- Descriptive domain names: threshold, customerName, retryLimit

Example

defines module qa.naming.spotbanned

  defines program

    SpotBannedDemo()
      stdout <- Stdout()

      // ALLOWED: descriptive names
      customerName <- "Alice"
      temperature <- 22.5
      searchResult <- "found"
      retryLimit <- 3
      stdout.println(`Customer: ${customerName}`)
      stdout.println(`Temp: ${temperature}`)
      stdout.println(`Search: ${searchResult}, Limit: ${retryLimit}`)

      // ALLOWED: compound words (contain banned roots)
      dataProcessor <- "json"
      errorCount <- 0
      inputValidator <- "regex"
      configPath <- "/etc/app"
      stdout.println(`Processor: ${dataProcessor}, Errors: ${errorCount}`)
      stdout.println(`Validator: ${inputValidator}, Path: ${configPath}`)

      // ALLOWED: single-character
      x <- 10.0
      y <- 20.0
      i <- 1
      stdout.println(`Point: ${x}, ${y}, Index: ${i}`)

      // ALLOWED: domain names not in banned list
      threshold <- 0.95
      name <- "sensor-A"
      stdout.println(`Threshold: ${threshold}, Name: ${name}`)

Common mistakes

E11031 — The name 'temp' is banned (E11031) but 'temperature' is allowed because it is a complete descriptive word, not the banned abbreviation.

Incorrect:

      temp <- 22.5
      searchResult <- "found"
      retryLimit <- 3
      stdout.println(`Customer: ${customerName}`)
      stdout.println(`Temp: ${$temp}`)
      stdout.println(`Search: ${searchResult}, Limit: ${$retryLimit}`)

Correct:

      temperature <- 22.5
      searchResult <- "found"
      retryLimit <- 3
      stdout.println(`Customer: ${customerName}`)
      stdout.println(`Temp: ${temperature}`)
      stdout.println(`Search: ${searchResult}, Limit: ${retryLimit}`)
Other ways to ask this
  • Can you identify which variable names are banned in EK9?
  • Which identifiers will trigger E11031?
  • Help me spot banned names in my EK9 code

Keywords: quiz, E11031, naming, spot, allowed, banned, identify