Kotlin is a relatively new language, and is evolving all the time.

When we wrote the previous video, a private const at the top level of a file was package-private.

That means it was visible throughout the package.

The implication of that is that we couldn't use

private const TAG = "classname"

in each of our class files, because the TAG would be visible in all the other classes. That would obviously be confusing.

Kotlin has since changed, and a top-level constant marked as private is now only visible in the file in which it's declared.

That means we can move all of our TAG constants to the top level, and not have the problems described in the previous video.

It also removes the weak warning, about the TAG variable name not conforming to the standard convention.

What I mean is, rather than

class MainActivity : AppCompatActivity() {
    private val TAG = "MainActivity"

we can move TAG to the top-level, and make it a const

private const val TAG = "MainActivity"

class MainActivity : AppCompatActivity() {

The capitalised name, TAG, now conforms to the convention for constants, and the private modifier means it's only visible inside this file. We can have a different private const val TAG in each file, without any conflicts.

We've left the previous video in the course, because the discussion of Companion Objects is still useful. You'll also see code on the internet that still uses Companion Objects for class constants.

The discussion on viewing the byte code is also useful.