Сколько слов в языках программирования

Анатолий 'Ин Ши' Попов bio photo By Анатолий 'Ин Ши' Попов Comment

Задумался с утра: а сколько слов надо выучить в так называемых языках программирования. Решил, что 100. Оказалось, что меньше.

Keyword counts (reserved + contextual/soft)

Median across mainstream languages: ~55–65

• Lua — 22 • Go — 25 (~70 with predeclared identifiers: len, make, nil, iota) • Python 3 — ~39 (35 hard + match, case, type, _) • Ruby — ~41 • C (C11) — ~44 (+12 preprocessor directives if counted) • Rust — ~44 (35 strict + reserved + weak: union, macro_rules, safe, raw) • JavaScript — ~46 (async, await, get, set, of, static, let, yield, from, as…) • Scala 3 — ~55 (given, using, extension, opaque, inline, end…) • Kotlin — ~62 (15 hard + 11 soft + ~35 modifiers + it, field) • TypeScript — ~62 (JS set + type, interface, declare, readonly, keyof, infer, satisfies…) • Dart — ~63 (33 reserved + ~30 contextual) • Java — ~67 (~50 + var, record, sealed, permits, yield, module keywords) • PHP — ~75 • Swift — ~95 • C++ (C++20) — ~103 (97 + final, override, import, module, export) • C# — ~115 (77 reserved + ~40 contextual)

Gray area: built-ins vs keywords. Rule of thumb — count it if the parser knows the word, not the standard library.

comments powered by Disqus