6 ms·
I'd love to hear more about your troubles with Scala, and any examples of "clean code being hard to write". Do you think this had more to do with a lack of exp
by anthonybullard 8y ago
I'd love to hear more about your troubles with Scala, and any examples of "clean code being hard to write". Do you think this had more to do with a lack of experience with strongly typed functional languages, or more to do with Scala's mixed paradigm?
Also, thanks for sharing your story. Elixir is a great language and I love seeing it being adopted more and more everyday.
- justinator 8y ago(backend of Victorops is in Scala)
- romanhn 8y agoDefinitely not the lack of experience, there was plenty of in-house Scala experience. I'm not the author, but he has indeed written about his experiences with Scala on his personal blog: http://evrl.com/programming/scala/2017/04/04/scala-part-ii.html http://evrl.com/programming/scala/2017/04/04/scala-part-ii.h...
- mopierotti 8y agoI wish he would have gone further into detail on why "stuff like Scalaz has no place outside academia". While I understand there's a bit of mental overhead, I've found there to be much real world utility in using that genre of libraries/patterns in production. It's also interesting that he wants the ability to "run your tests for the intermediate refactoring steps that wouldn’t typecheck and then let you fix up things later."-- I'm not sure what it means to want to run code with ambiguous types in a type aware language like Scala. Type information is deeply involved in runtime program behavior. (E.g pattern matching on types, resolving typeclass instances) I certainly agree that nontrivial sbt work is rough.
- jvican 8y agoI don't know what he meant by that either, but it's important to mention that `Scala != Scalaz` and that sbt is not the only build tool used in the community (and it's certainly not built by academics!).
- gamache 8y agoI'm not from PagerDuty, but I also moved to Elixir after some years working in a hybrid Ruby + Scala shop. I concur with the author's experience that writing clean and maintainable Scala code is hard. A few reasons: * Haskell influence on the language, especially early on, encouraged the omission of dots and parentheses wherever possible. Just about every piece of sample code was written as an undifferentiated stream of tokens. There is a mental burden. * Haskell influence on the community encourages category theory solutions to all problems. This harms interop with Java libraries, in addition to requiring a number of concepts that are safely ignored in many/most other languages. * Scala's rich OO system (classes, interfaces, traits, singletons, case classes, implicits, etc) results in frequent design paralysis, not to mention taking a while to learn. Elixir suffers from none of these problems, while retaining some of the things that made Scala a pleasure to use, notably the actor system of concurrency and the use of immutable data structures.
- jvican 8y agoI work for the Scala Center and I'd like to comment on some of the points you make to hopefully explain how I see things from my side. You can expect my opinion to be biased but I'll try to stick to the facts. > Haskell influence on the language, especially early on, encouraged the omission of dots and parentheses wherever possible. This is considered an anti-pattern in the Scala community. The last library that used this at large scala was sbt, Scala's build tool, and now everyone discourages the use of infix operators. > Haskell influence on the community encourages category theory solutions to all problems. This is simply not true. First, there is no Haskell influence on the language. Scala is a functional programming language, all similarities between the two are just fundamental to how their type systems work and the foundations of the paradigm. Second, I contest heavily that the Community encourages category theory to solve all the problems. There are many subcommunities in Scala and many styles, but if you talked to some Scala developers nobody would agree that category theory should be applied to all code. In fact, most people don't. They just use Scala because it's a better Java that boosts their productivity. > Scala's rich OO system (classes, interfaces, traits, singletons, case classes, implicits, etc) results in frequent design paralysis, not to mention taking a while to learn. Absolutely agree that for someone not experienced, it may be difficult to know what's the best way to design libraries (this is more of a problem with libraries than applications). This is a big problem of Scala that I think we're solving by making the language more opinionated and being more open about what's encouraged and discouraged. If you ask for my opinion, I think we also need to make a better job at communicating all this knowledge that advanced Scala developers learn but that is usually kept to closed circles.
- nemothekid 8y agoI'm pretty sure, as far as type systems go, Elixir is strongly typed as well as fairly functional (It's built on BEAM after all). I think it has to do more with the latter. To me, Scala is too powerful - it rivals C++ in complexity, despite being half it's age. It almost feels like every Scala codebase is written in a different language, and I always felt I spent more time parsing Scala than understanding the code. It's a powerful language to write, but hard to read - almost the complete polar opposite of Go. As a result it can be very hard to bring new engineers up to scala, and even engineers that know Scala have to learn "your flavor" of Scala.
- gamache 8y agoElixir is dynamically typed, just like Erlang and the BEAM. Strong typing is a most requested feature from outside the community, seldom from inside. (EDIT correct, strong typing is not static typing. Does anyone make weakly typed languages anymore?)
- nemothekid 8y agoAccording to wikipedia, Erlang/Elixir is strongly typed. I guess you and the other poster mean static typing?
- Thaxll 8y agohttps://elixir-lang.org/getting-started/typespecs-and-behaviours.html https://elixir-lang.org/getting-started/typespecs-and-behavi... Elixir is a dynamically typed language, so all types in Elixir are inferred by the runtime.
- dudul 8y agoYou may be confusing strongly and statically typed.
- rpeden 8y agoThere's no reason a language can't be both strongly and dynamically typed (like Elixir or Python) or statically and weakly typed (like C). :)