Templater evolved in C#. While current version doesn't resemble the first one at all, you could say that it leans on lot of .NET idioms. A lot of LINQ, anonymous types, I for interfaces and similar stuff.
Port to Scala was my first project in Scala and (excluding long forgotten university projects) JVM. If I haven't had some Haskell experience and my functional programming style in .NET I guess result would be a lot worse than an C# in Scala abomination. Over few next week after couple of cosmetic surgeries at least they don't call it abomination anymore ;) but it's still not idiomatic Scala.
How C# influenced my code style:
- anonymous classes - I was told nobody writes those, that I should use case classes or tuples. At first nobody could explain a reason why not to use it, but when we tried to proguard our code things finally clicked -> anonymous class is reflection based.
- LINQ - wrote a lot of query comprehensions.
- stage 1: chained a lot of them which mutated state inside.
- stage 2: moved most of query comprehensions to for comprehensions. Still mutated state inside.
- stage 3: used for comprehensions for pure functions and foreach for state mutations.
- interface Hunguarian-like notation - I really tried to conform to JVM style. Most of them survived (camelCased methods, EgyptianBracks, etc.) but I couldn't force myself to lose the I prefix in interface. It makes code so much more readable. It also helped me deal with frustrations about not knowing a lot of Java framework (create an instance of something - oh I can't do that - that's an abstraction, but what should I use!? - online help - oh, ok - I guess I'm Jimmy)
- extension methods - my distaste for org.w3c.dom was alleviated with implicits which added LINQ XML like methods. I didn't use many implemented methods on traits, only because they convert interface to abstract class from Java viewpoint.
- private static methods - I'm still slightly annoyed that I have to declare private object and implement methods there.
What I dislike in and around Scala:
- type inference - while type system is more advanced, when Scala is unable to infer type which .NET can infer that calls for a you can do that in .NET joke ;)
- object - while it's useful for utility classes I wouldn't use it for anything else because that feels like global variables v2
- Eclipse - while coding in Visual Studio I feel like being in strongly typed environment. Last version of Eclipse plugin is great improvement from previous version, but still it feels like stringly typed environment.
- speed - yeah, yeah, my computer is old and slow, but VS feels like a sprinter compared to Eclipse.
- method scope import - while this is no different that importing implicits it derails code readability hugely. I like my intention revealing names to be scoped to current class. Saving few chars so I can call method in another class because I've imported them, is just a bad trade. Code should be written for readability.
- option in for comprehension - I like extracting option with for comprehension, but I also like chaining calls in single for comprehension. Scala's type system forces me to call toList on option because otherwise it can't infer type on chained call which works with different type.
- some parts of idiomatic Scala - one could argue that this is a matter of taste, so I guess not very useful debating it.
- Java libraries - they feel awkward and outdated. I guess I've been spoiled with LINQ and libraries built around them.
- Scala libraries - I don't like it when libraries trade functionality for immutability. Yeah, immutability is hard, but when features are missing because of that - that only means that I can't use that library
- type erasure - debated to death. No point in repeating it. I eagerly await for 2.10 manifests.
What I like in and around Scala:
- type system - my code was riddled with toList until I realized that Scala can maintain my type after comprehension. And it can do that even without bloating implementations.
- option - at first there was .get all around codebase for extracting option with small dose of pattern matching. That evolved to getOrElse and for comprehension with even smaller dose of pattern matching.
- Haskellization - Haskell influence helped C# gain advantage over Java. Scala is a lot more functional that C#.
Is Scala better than C#? For sure. But .NET libraries feel more polished. Until Scala is not supported on .NET, C# will be my native language.