Zum Inhalt springen

Abbreviation and Hungarian (ARCH3011)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key typescript.naming.no-hungarian-notation · Severity info · Category naming

Hungarian-notation type prefixes (strName, iCount, b_flag) and cryptic abbreviations add noise by duplicating information the type system already provides, hurting readability.

function process(strName: string, iCount: number, b_active: boolean) {
const arrItems: string[] = [];
const objCfg = loadConfig();
return { strName, iCount, b_active, arrItems, objCfg };
}
function process(name: string, count: number, active: boolean) {
const items: string[] = [];
const config = loadConfig();
return { name, count, active, items, config };
}

Drop the type prefix and cryptic abbreviations; rename the identifier to a plain, meaningful word.