wouldnt it be better if defult access-modifier was...
# getting-started
b
wouldnt it be better if defult access-modifier was internal rather than public? I think it would make our code more encapsulated
🚫 3
n
whatever the relevance of your comment it’s not going to change as it would be a huge breaking change
b
I'm still not sure (as most of us I think) what internal even does.
s
Internal prevents other modules or projects that consume your module from seeing those functions/properties/classes/etc
b
Does it, tho? Some of the stdlib for kotlin wasm is marked as internal, but i can still construct those objects.
s
It should, and if it doesn't, that's a bug
b
I haven't tried compiling it though, so it might be an IDE bug for not showing any errors
m
For a library writer, internal is very powerful. Can have something used in a lot of places in your library that a consumer can never touch. Java didn't have this feature. Default (Package- private) was the closest thing BUT we all know how to get around that and complain to the library dev when they break our code that uses something we weren't intended to use šŸ˜„
ā˜ļø 3
s
Accessing a library method that has modifier as ā€œinternalā€ will give an error ā€œCannot access ā€˜method_name’: it is internal in ā€˜package of the library method’