Hi, I wrote an article about Kotlin & WatchSer...
# feed
v
Hi, I wrote an article about Kotlin & WatchService - an example how to wrap existing Java API with Kotlin - a practical use of some language features such as: extensions, channels, sealed classes & implementation by delegation. https://medium.com/@vishna/kotlin-watchservice-a-better-file-watcher-using-channels-coroutines-and-sealed-classes-7ab5c9df3ada
👍 3
o
This was pretty neat, I'm just not sure I agree with your use of sealed classes. The way you used them (entirely constant) seems like you'd be better off with enums.
2
v
Good point. I want to believe though we only have enums in Kotlin because of the Java inter-op 🙂
a
Enums are syntactically shorter and much lighter in terms of VM.
v
guess it might be an overkill, gonna update that
fixed, thanks for feedback
👍 1