Hacker News new | ask | show | jobs
by fknop 3047 days ago
It looks really verbose only to render simple html.

I had one really bad experience with Scala.js. When I used it, I noticed Scala was just not designed for the web (front end) and it just didn't work well for things really simple in JS.

3 comments

I'm going to go against the HN current opinion but I hate Scala. I worked for a few months on some Scala projects, the language is way too complex (the opposite of Go, they add whatever feature they think is cool) is poorly documented and readability is difficult as well. It looks like a mix of Perl and functional languages.
I hate it as well. I think it's a poorly designed language. The syntax is a mess (underscore...), the operator overloading make people overload silly operators which make code unreadable from an outside programmer. I could go on...

I prefer Kotlin which imho fix almost every bad design decisions from Scala.

If underscores and operator overloading are the biggest criticisms you have of Scala, then we're doing pretty well. For what it's worth, I think Scala has quite a large grammar that means it takes a while to learn, but once that's over it's not particularly difficult to read or to write.

Can you elaborate as to what Kotlin fixes compared to Scala?

Scala.js is not really designed for simple websites.

It's designed for bigger ones especially in which you want to share models and validations between front and back end.

Could you cite an example of how Scala is unsuitable for the web? Between Scala and JavaScript, I would pick Scala in a heartbeat for one reason alone - it's strongly typed. Both of them offer OO & FP.
Strongly typed was one of the problem I found. TypeScript offers a better alternative to typing on the web because it keeps the compatibility with javascript and also have a real any type when it's really necessary. Typescript now can import raw js without types definitions unlike Scala.
I believe Scala can use javascript libraries either dynamically or with type definitions in exactly the same way as TypeScript?

I tried to use TypeScript but the type system just wasn't good enough; when you've been working in a strongly-typed language like Scala for a while, a language without nominal types or HKT just isn't going to cut it.

Could you illustrate, preferably with an example, how weak type system would have worked better than a strongly typed system?
You can do FP in any OO language. OO is an extension on top of FP.