ajselvig
Terrier Technologies is a small startup that creates software for the pest control industry. We're looking for full stack Rails developers and business analysts looking to work on a fast-paced team making industry-leading software.
More information can be found here: https://terrier.tech/careers
In the end, we end up with a builder DSL like this:
div() {
h1("header")
p("paragraph")
div() {
p("another paragraph")
}
h2("another header")
}
In Kotlin, each function call is properly scoped inside (unseen) classes for each level, allowing the code to generate the appropriate object tree.In Scala, all functions would have to be visible in the local scope of the top-level function and we'd end up with a flat object tree instead.
To get the proper object tree in Scala, you'd need to pass explicit references to each containing object into the appropriate function literals, which makes it much more verbose and extremely error prone.
EDIT: not nearly as convincing without proper formatting...
That being said, the one really cool feature Kotlin has that Scala doesn't is the ability to build strongly-typed builder DSLs:
http://confluence.jetbrains.net/display/Kotlin/Type-safe+Gro...
You simply can't accomplish this in Scala with the same elegance.