Is writing “this.” before instance variable and methods good or bad style?

I think it’s less readable, especially in environments where fields are highlighted differently from local variables. The only time I want to see “this” is when it is required, for example:

this.fieldName = fieldName

When assigning the field.

That said, if you need some way to differentiate fields for some reason, I prefer “this.fieldName” to other conventions, like “m_fieldName” or “_fieldName”

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)