4 ms·
I don't want to cause false hopes, but I think the roadmap is quite conservative and designed to no disappoint people if things don't go according to the plan.
by frowaway001 12y ago
I don't want to cause false hopes, but I think the roadmap is quite conservative and designed to no disappoint people if things don't go according to the plan. (Especially with people complaining that the next few releases don't improve things they care about ...)
HLists are planned for Giovanni, but I considering that even Typesafe-related projects are now either depending on shapeless or shipping with their own HList implementation, I think there is a lot of desire to standardize on one (probably compiler-known (to deal with the huge increase of compile-time)) implementation.
As far as I know 1.3 and 2.1 are blocked by the need for a migration tool. Scala developers are certainly not expected to fix their code by hand, but let a "go fix"-like tool handle everything for them.
I think having the IDE assign Unit-returning methods a special color would retain some of the benefits of procedure syntax while fixing the issues caused by procedure syntax.
Tests are one case where procedures might be heavily used, but I think this can either be handled by a better API. (I never understood the reason why testing frameworks required the "assert + return Unit" pattern. Why don't they just allow tests to return Boolean and get rid of the assert boilerplate in simple cases?)
def someTest("foo should equal bar") { assert(foo == bar) }
|
v
def someTest("foo should equal bar"): Unit = foo == bar
|
v // or even:
`foo should equal bar` test { foo == bar }
- benjaminjackman 12y agoWell having just written a unit test framework[1](because we needed one that cross compiled to ScalaJS and couldn't use utest for reasons relating to difficulty of getting it to produce reasonable output for all our legacy tests) I side stepped the issue by using a FunSuite style. I prefer using a series of assertions to simply returning true or false because often times you want to put multiple assertions in the same test. However the unit test case alone is a pretty valid one. I am all for making it a compiler flag (opt-in or opt-out). I still haven't been given a single real problem with procedure syntax other than "it's different" and because "it's different" it therefore confuses new users and increases the complexity of the language. I don't think that follows logically and in my experience empirically. For the programmers I have introduced to Scala, or that I have talked to who use it none of them have gotten caught up by procedure syntax. This includes traders taking the Scala course that have never programmed before in their life. The color/formatting is a good idea, that should just be done already. However given that the intellij guys still don't give an option[2] to color member variables defined in a constructor differently than ones defined in a method I'm not hopeful about that. 1: https://github.com/cgta/otest https://github.com/cgta/otest 2: https://youtrack.jetbrains.com/issue/SCL-2811 https://youtrack.jetbrains.com/issue/SCL-2811
- frowaway001 12y agoThanks for your helpful information! I think as soon as scala.meta is released, it will be vastly simpler to write your own refactorings (like converting tests using test library X to test library Y). From what I have seen on Parleys, the person behind macros even show-cased such refactorings in a talk at the last ScalaDays.