Elye - A One Eye Dev By His Grace
1 min readAug 22, 2020

--

Hi Nice Robot,

Thank you for reading.

First of all, let me point out that the link you provide is with the title Kotlin’s default visibility should be internal. and not Everything should be private or internal by default. If you read the content, it is clearly stated that “Why the default is public”. Kotlin function and variable is public by default.

Anyway, in my writing, it is not intended to state if a language should have its function or variable private or public. Instead, I’m stating if there’s a default value, then we don’t need to explicitly state it again. The IDE auto-complete feature will help prevent one from accidentally access a private function.

In older days, the IDE doesn’t have the ability to have proper autocomplete. Hence having one specifically the visibility of the function explicitly is must, to avoid the programmer mistakenly access a private function or variable accidentally, and cause compiler error later.

In short, you have misunderstood what I wrote, thinking I’m advocating for public interfaces, which is not my intent.

--

--

Elye - A One Eye Dev By His Grace
Elye - A One Eye Dev By His Grace

Written by Elye - A One Eye Dev By His Grace

Sharing Software Learning, Life and Faith Journey

No responses yet