HN user

ajselvig

10 karma
Posts0
Comments7
View on HN
No posts found.

Terrier Technologies | Minneapolis, MN | Full Stack Rails Developers | Business Analysts/Project Managers | https://terrier.tech/careers | ONSITE | Full-Time

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

I was also quite surprised that the javascript components seemed to take a step backwards in design and documentation from Foundation 3 to 4. Not sure why that is.

In Kotlin, you can write a function that takes, as its last argument, a function literal that is scoped to a specific class. Last I checked, function scoping does not work this way in Scala and you'd have to explicitly pass around objects to get the same result.

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...

For some people, after looking at Scala a bit, being "watered" might be a good thing. Kotlin doesn't have as many syntax surprises as Scala does.

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.