orangenpresse / golunarlander

Testproject for go
0 stars 0 forks source link

No this Keywords as object identifier #4

Open orangenpresse opened 9 years ago

orangenpresse commented 9 years ago

We should not use the this keyword for an object instance. Its better to use a short description of the specific instance or use the first letter. If we code the functions clean code like it should be no problem to see what the single letter variable contains.

NerdyMcNerd commented 9 years ago

Well, if a function is working on a instance of struct X, declared in a source- file named x.go. It should be clear, that 'this' is of type X (or Pointer to X). As long as we keep it clean enough (which means defining only one Struct per source file) this should not be a problem.

Besides 'this' is not a keyword in Go. (See: https://golang.org/ref/spec#Keywords)