4
10Dev
3y

Looking into Kotlin, and it seems pretty cool, but I just can't get over how unnatural and annoying the mapOf syntax is.

In JavaScript: const obj = { a: 1, b: { c: 3, d: 4 } }

In Kotlin: val obj = mapOf("a" to 1, "b" to mapOf("c" to 3, "d" to 4))

Comments
  • 1
    Python: { "a": 1, "b": { "c": 3, "d": 4 }}
    OR
    Python: dict(a=1, b=dict(c=3, d=4))
  • 3
    Wtf who thought that this Syntax is acceptable and can be published
  • 2
    To be fair, JavaScript makes working with json a dream. Nothing supports it like JS. Not even close.
  • 1
    Looks like being able to design supreme IDEs doen't imply ability to design a language that doesn't suck...
  • 4
    @Root it's almost as though JS was specifically designed to handle JSON...
Add Comment