Zum Inhalt springen

Abbreviation And Hungarian (ARCH5011)

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

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

Avoid Hungarian-notation type prefixes such as strName, iCount, b_flag and cryptic abbreviations on identifiers; the type system already provides this information and the prefix only adds noise.

func process(strName string, iCount int, bActive bool) {
for iIdx := 0; iIdx < iCount; iIdx++ {
log(strName)
}
}
func process(name string, count int, active bool) {
for i := 0; i < count; i++ {
log(name)
}
}

Drop the type prefixes and use plain names that describe intent.