4 ms·
I'm currently learning Scala (background in Python and Haskell) and I have encountered a few road blocks: 1. The REPL is not very helpful: You cannot look up d
by rkrzr 12y ago
I'm currently learning Scala (background in Python and Haskell) and I have encountered a few road blocks:
1. The REPL is not very helpful: You cannot look up documentation a la IPython (i.e. myFunc?) or inspect objects easily to find out how things work
2. There always seem to be 10 ways to do the same thing. This makes it much harder to understand other people's code than when there is just one way to do it.
3. The type system seems less helpful than Haskell's (e.g. why is "asdf" + 3 not a type error?)
- yummyfajitas 12y ago(3) is because Scala attempts to preserve Java semantics for strings. I agree that this is a mistake.
- rahilb 12y ago(2) Isn't this true for all languages, and in fact isn't that the hallmark of a _good_ programming language? One could also argue that this provides evidence of simplicity, as many smaller building blocks can be assembled in different orders to produce the same (complex) result. The antithesis is when we see posts about how "Go's too simple".
- rkrzr 12y ago"Isn't this true for all languages". No, not at all. Many languages have an idiomatic way to write things. Python definitely does and so does Haskell (to a lesser degree). "One could also argue that this provides evidence of simplicity" Or one could argue that it provides evidence of complexity, since you need to hold much more information in your head to achieve the same results.
- lostcolony 12y agoFrom 'The Zen of Python' - "There should be one-- and preferably only one --obvious way to do it." I'm not sure I've seen any "Python's too simple" posts. Maybe Go's criticism is based on some other factor?
- lmm 12y ago2. There are places where this is true, but a lot of people seem to get hung up on the syntactic differences between e.g. "a.foo(b)" and "a foo b", which really are superficial and you learn to read past very quickly. 3. Some of these are backwards compatibility. You can get a more helpful typesystem by setting a few flags: https://tpolecat.github.io/2014/04/11/scalac-flags.html https://tpolecat.github.io/2014/04/11/scalac-flags.html