Hello ! Kotlin language is cool . And I like Kotli...
# announcements
r
Hello ! Kotlin language is cool . And I like Kotlin language can be used in multiple platforms (Kotlin-JS, Kotlin/Native) and beautiful Kotlin Coroutines . But I am supposed to give the intro to Kotlin language , highlight kotlins feature every week . Any ideas how can I make more people engaging in Kotlin? Still many people I find people using Kotlin are Java converts and Android developer . But I want to highlight other Kotlin features and make students know use Kotlin language . Any guidance can I get ? Any help would be appreciated . Thank you
@elizarov @gildor ? Any guidance .
e
There's lot of great material on why Kotlin is great and how to use it out there. Just google for it. I personally like Hadi's talk from Google IO'17

https://www.youtube.com/watch?v=X1RVYt2QKQE&t=389s

👍 1
r
Thank you for pointing this out . I forgot about this introduction. Got the leading point . 😊
t
Built in immutability, ease of lambda definitions -> can be used as a real fp language:) Data classes, extension functions, sealed classes, if/when as expression. Just to mention a few.
s
If someone wants me to introduce Kotlin to them, I would just say "Kotlin fixes most language design problems in Java, so it's the paradise for Java developers. But if you never used Java, Kotlin is so confusing for you."
Built-in immutability does not make sense for a beginner to programming why we don't want things to be mutable. "But it has more flexibility!" Lambda definitions is probably not clear why it is useful (or even special) without comparing it to the interface/anon class hell in Java. A JS dev will tell you "isn't that what I do every day?" Data classes is mostly duct tape upon the Java infrastructure of java.lang.Object Extension functions are cool, but it's not something you'd write every day unless you're developing some DSL Sealed classes are just selling short to languages that have unions If expression is just syntactic sugar around ternary operators (unless your audience suffers from Golang). But When expressions are really cool indeed; if it is something original in Kotlin, it's a great breakthrough.
👍 1
g
Extension functions are cool, but it’s not something you’d write every day unless you’re developing some DSL
I disagree, this is super powerful concept and used a lot by us and many other developers without any kinds use cases related to DSL
s
Maybe I should call it "fancy API" instead of DSL
But do people actually define (not just use) it every day?
g
Yes, we do
s
Oh right
I was just thinking about extension functions inside classes
g
Built-in immutability does not make sense for a beginner to programming
You right, but usually you introduce language to people who already have experience
s
If we're talking about bare extension functions as well, yeah, they're great
Although I'm a more extreme guy who'd rather have extension functions in usage rather than definition
After all, all the time I find it more intuitive to use number.cos() rather than cos(number)
Same to lots of other functions
Sealed classes might be more attractive (although still duct tape) if there is https://youtrack.jetbrains.com/issue/KT-4075
r
You right, but usually you introduce language to people who already have experience
That is my concern . I watched Hadi's talk . He also introduced Kotlin with comparison to Java , which is fine as it was for Android developers . But with coming of Kotlin/Native , Ktor (for backend) Kotlin-Js(have to thoroughly look why it's better in practice than JS), Kotlin is not restricted to Android realm anymore . That is what I want to make students realise . But since Kotlin initially was made with Kotlin/JVM I am thinking starting with Kotlin/JVM , introduce with comparison to Java. And introduce cool things like extension functions and if/when expression (personally like) And then move to Android dev, then move to other platforms Is it right ? Any more suggestions ? @SOFe @gildor?
I disagree, this is super powerful concept and used a lot by us and many other developers without any kinds use cases related to DSL
Any powerful example please ?
s
I think it's mostly about replacing
f(x)
with
x.f()
r
But thats not powerful 😅
s
I mean, I felt so much excitement in Kotlin when I just started, seeing so much improvement from Java.
But when I calm down and compare it with other languages, it's not that cool (not to the extent it is better than almost any other language like I initially thought)
@Rohan Maity actually it's powerful when you see it from an IDE perspective
At least I can check the methods I can operate on an object from auto completion
💯 1
If it is a parameter (not receiver), I can't do that on an IDE and explore APIs so conveniently
g
But thats not powerful 😅
It’s not powerful for simple examples, but much more powerful if you work with other APIs, you can check stdlib and see, that almost everything there is an extension function
which is fine as it was for Android developers
JVM as a platform is much-much more than Android
But when I calm down and compare it with other languages
Isn’t this about combination of factors, Kotlin never tried to be something innovative, provide some features that not exist in other languages, just be pragmatic and productive. It really depends on your use case
Kotlin is not restricted to Android realm anymore
And never was. Originally Kotlin targeted only JVM and never target Android as a platfom and originally even didn’t work due to some bugs of DEX, all the rise of Android came from community, not from JetBrains
s
There's a lecturer in my university that claims Kotlin is for Android development in a CS beginners course 😂
g
But I want to highlight other Kotlin features and make students know use Kotlin language .
There are a few people in this Slack who also do the same, Also, there is Atomic Kotlin book for people without other programming experience - https://www.atomickotlin.com/
r
And never was. Originally Kotlin targeted only JVM and never target Android as a platfom.
Sorry for that. I know Kotlin targeted JVM . But alot people here in my country think as Kotlin for Android only .
Also, there is Atomic Kotlin book for people without other programming experience
Thats seems something . Can I use it for introducing Kotlin ?
g
Book is not published yet, as I know
but yes, it written for people without other programming experience
s
But it's confusing for people who don't know Java
Such as the val get() thing
g
Oh, there is Atomic Kotlin course https://stepik.org/course/15001/
But it’s confusing for people who don’t know Java
Why do you think so? every real language has a lot of things that may confuse, but it doesn’t mean that it cannot be used to learn programming
Such as the val get() thing
How this related to Java experience? Also it’s not unique for Kotlin, for example C# has similar syntax
r
How this related to Java experience? Also it’s not unique for Kotlin, for example C# has similar syntax
I agree
s
If you know Java or similar OOP languages, you have an idea about getters and setters
Btw C# is supposed to be a Java killer anyway
g
I just don’t understand your point.
r
If you know Java or similar OOP languages, you have an idea about getters and setters
But this thing shouldn't be that much of problem for beginners either
g
It’s pretty clear concept imo, nothing complicated and easier to write than in Java
s
What's the word
val
supposed to mean, despite context?
It's supposed to mean "read only" right?
g
Students study Haskell, C++, Fortran, Lisp and a lot of other languages that much harder to learn than Kotlin
s
Val being immutable is a result of its read-only property, or Val being read-only is a result of its immutability?
g
val mean that you cannot set this value, only read
s
Yeah so it's readonly
But when people learn kotlin, they learn variables before learning class properties
So they would first see that val implies immutability, not that val implies read-only
They're the same thing, but the intrinsic meaning is different
That's why I find it difficult to explain to people about val get
g
no, val not implies immutability even for local functions
it just means that you cannot set this property again
it’s very easy to explain, I did it to my wife when teach her programmin
You have a lot of languages with exactly the same concept. And many of those languages super popular: JS, Swift, C# (partially), Scala
even java now has
var
and
final var
s
I know it doesn't imply constant, but that's how one would understand it without learning OOP anyway
g
in general, I just want to say that I agree, that maybe there are better languages to learn programming, but Kotlin definitely not the worst, also has some really good points comparing to other languages
but practice shows that it’s not a problem Common, people study C++ as first language and you think that val and var hard to explain?
Teaching is hard, studying is hard too %)
My general suggestion, that you should know background of your audience and adjust your talk/course to this, there is no universal advice
r
But since Kotlin initially was made with Kotlin/JVM
I am thinking starting with Kotlin/JVM , introduce with comparison to Java. And introduce cool things like extension functions and if/when expression (personally like).And then move to
Android dev
, then move to other Advanced things like
Kotlin/Native , Coroutines , Ktor
etc . And would refer
Atomic Kotlin
for making students understand Kotlin language features along the way I want to engage people in development with Kotlin Lang . What you guys think ?
g
introduce with comparison to Java
But it make sense only for people who already familiar with Java
r
I would refer
Atomic Kotlin
first for introducing and also with compare with Java for highlighting feature . Also Alot of people here learnt C++ (also OOPs ). So thinking for beginner purpose could compare with C++ in OOPs little bit for highlighting Kotlin
g
It’s very wide course that even includes Android, good look you with it, but it’s just so big area that really hard to cover
r
I won't gonna cover the book . My primary motive is to make people use Kotlin in production . Also Our society is more inclined towards development and "FOSS" . So just want to make people use Kotlin , more
t
Well, I am really glad, that we do not work together @SOFe :)
s
@Tom Adam what?
t
Just reading Ur aswer it looked like U have very hard thoughts about things:) Many of the Kotlin features have their right scenario to use them, and certainly things can be misused as well. So I would not judge features in general, like if as expression is good or bad or if extension functions is good or bad. A lot depends on the domain, the project, etc. It is always about tradeoffs, never black and white. :)
s
Did I say anything is bad? 🤔
I'm just saying that the meaning of the keyword is a bit ambiguous.
t
Np, just Ur answer was a bit overwhelming on my suggesstion about the kotlin intro content. Do not take it too seriously:)
s
Well if we are working together, that means I have to work on the same thing too, so I would definitely not have hard thoughts to produce myself more work 😝