Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Any particular reason you wouldn't recommend it at work?


As the author of this post mentioned the culture of the Java developers, the "architect" thing and the frameworks, Scala has its own similar problems: it attracts a group of academics on type systems and creates over-engineering in a completely different direction.

Also, while I think Scala is simple at its core concepts and syntax, it gets complex because it has too many features and tries to support all features present in other programming languages. Why do you want structural typing there?.

Also, I hated sbt.


> it gets complex because it has too many features and tries to support all features present in other programming languages

Which things do you have in mind?

> Why do you want structural typing there?

Isn't that a simplification? Instead of saying "here are types which you can use as e. g. parameter types, and here are types which you can't use (like in Java)", it says "all types work the same way".


I understand what it is.

I don't see the need of it if you already have a class-based system.

Go uses structural typing. But it is the only thing they have. Rust has traits, and it is the only thing they have.

I can't think now of more stuff but I remember you could even write xml in the language.


> I don't see the need of it if you already have a class-based system.

Like in Java?

    	new Object() { void foo() {}}.foo(); // Works
Ooops.

The point about XML is so stale already that I won't even bother commenting on it.


You seem to be stuck in the topic of how useful structural typing is. Which I agree with.


Eh what? No. I couldn't care less about structural types.

I care about simple, consistent rules. "X is a type, you can use it wherever you want" is one.

"X is a type, but there is also Y, which you can't really express in position A and B unlike X, but can only use it if you carefully avoid doing things #1 to #4" isn't one.


I agree with partly with you.

I don't think it helps for consistency when you have to ask yourself why some functionality is defined in terms of a trait if it could be defined in terms of the structural type and just providing the methods would be sufficient.


Oh, I also disliked implicit conversions a lot. I considered them a wart at some point. Made everything hard to read and reason about.

Almost every other way of "extending" a type would have worked better in practice eg. Xtend’s Extension Methods.


Extension methods have mostly the same drawbacks as implicits, but none of the advantages.

It's not like Scala developers didn't know extension methods before designing implicits.

Instead, they tried to come up with a more useful, principled way, which also covers a lot of the stuff which is hardcoded and implemented ad-hoc in other languages (like implicit conversions in Java).

In the end, I think they made the right call:

- Implicit parameters are the basis for abstractions which unify the "strategy pattern" of OO languages with FP's typeclasses,

- implicit classes provide extension methods, but are better in pretty much every regard (higher reusability, less error prone) and

- implicit conversions cover the ad-hoc conversions everyone takes for granted, without having to hard-code these hacks into the language (e. g. don't like Java's/C#'s/... implicit convert-everything-to-String conversion? Don't import it in Scala).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: