News for hackers. Stuff that matters.
Re:Kotlin for Data Analysis by yuye on Thursday August 29, 2024 @03:18AM (#41388196)
Couldn't agree more if I tried.

Scope functions are also great.

And the syntactic sugar where `foo({ a -> a })` and `foo { a -> b }` are the same makes code so much more readable.

I've done Python for a project at a previous job for a few months and it made me realize just how awful Python is, especially because you can't chain functions on collections as easily as you can in Kotlin. I also made me realize that I don't like dynamically typed languages.

Re:Kotlin for Data Analysis by MrBuddyCasino on Thursday August 29, 2024 @06:12AM (#41389168)
> Scope functions are also great.

They are useful but I'm not sure they carry their weight. I have to look up the differences often, maybe they're just terribly named?

Re:Kotlin for Data Analysis by brabel on Thursday August 29, 2024 @06:57AM (#41389465)
> And the syntactic sugar where `foo({ a -> a })` and `foo { a -> b }` are the same makes code so much more readable.

That's 1-to-1 copied from Groovy by the way :)

Re:Kotlin for Data Analysis by agumonkey on Thursday August 29, 2024 @01:02PM (#41392953)
Always strange how genes survived over time.
Re:Kotlin for Data Analysis by hnben on Friday August 30, 2024 @08:26AM (#41400015)
> `foo({ a -> a })` and `foo { a -> b }` are the same

I am new to kotlin, so I may be missing something obvious, but shouldn't it be "a->a" in the 2nd case, too?

Re:Kotlin for Data Analysis by yuye on Monday September 02, 2024 @01:58AM (#41422960)
You're right, my brain farted somewhere in the middle.