{
  "$type": "site.standard.document",
  "canonicalUrl": "https://oli.zilla.org.uk/2010/11/08/writing-scala",
  "description": "A comparison of Scala and Java syntax, highlighting pattern matching, companion objects, and potential pitfalls.",
  "path": "/2010/11/08/writing-scala",
  "publishedAt": "2010-11-08T00:00:00.000Z",
  "site": "at://did:plc:2ngsl5btroik454wzz7vpbzq/site.standard.publication/3mn67n3cam32w",
  "textContent": "Writing Scala after Java\n\nHere is a list of rough edges that Scala polishes away, and the surprises that will stub the toe of expectation.\n\nDifferent and better\n\n Pattern Matching. Just plain awesome. I hate switch blocks. I love matchers.\n Generics isn't an after thought. I have always hated generics because dispite their utility they make my code look hideous.\n Check preconditions with require (p99)\n\nJust different\n\n No static members. Scala uses companion objects to store singleton state. In usage the effect is minimal but you need to know how to write it.\n Operators are methods. Doesn't affect your day to day usage. Allows for DSL's. Precedence and notation are unchanged.\n implicit conversions. like autoboxing but more generally useful, and controllable.\n default scope is public, but who uses the default scope?\n\nStubbed toe different\n\n equals and == is reversed.\n If you forget to add the = in a def it means unit return. Combine\nthat with the type inference and you get a method that doesn't return\nwhat you think.\n order of mixins is important",
  "title": "Writing Scala after Java"
}