Tried to use java for pulumi - it’s 3x amount of c...
# java
Tried to use java for pulumi - it’s 3x amount of code comparing to other langs like Python|TS Kotlin could be so much better, but java code is generated in a way that can’t effectively utilize Kotlin features. eg example here could look like
Copy code
import com.pulumi.asset.FileAsset;

fun main() = { ctx -> 
    // var bucket = ...

    // Create an S3 Bucket object
    BucketObject("index.html", BucketObjectArgs(
         bucket = bucket.getId(),
         source = new FileAsset("index.html"),
personally I think kotlin is the best designed programming language I've ever seen just because of the concept of companion objects. We have an issue here and would love any thoughts that come to mind.
lol just saw your comment
Thanks I’ve already posted in this issue thread.
🙏 2
Haha, main language designer used to say that companion objects was the biggest mistake he made while designing Kotlin🤣
really??? static fields/methods is so hard to read. just group all of the state and methods together. gonna look it up
Your not supposed to use companion objects as a replacement for statics. You use package-level functions and extension functions. The only time you should ever use a companion object is for creating factory methods.
the reasoning is the best thing I've ever read. yeah static is bad.
yep:) You actually don’t need companion object to group static methods, just put it in separate file. If you want to scope them - extension functions 🙂
I think static is great:) I used to use functional programming with Kotlin(not in crazy Arrow way) and best way to do it is to have a bunch of static functions
👌that sounds nice. pulumi is written in go so I can only really use structs.
Go is a great language except for Generics implementation🤣
I'm still getting used to Go's approach. I've just discovered tags while typing out this message to complain about default values.
cc: @steep-minister-28895
👀 1