Skip to content

Instantly share code, notes, and snippets.

@mbbx6spp
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbbx6spp/8760920 to your computer and use it in GitHub Desktop.
Save mbbx6spp/8760920 to your computer and use it in GitHub Desktop.
Small sample of reasons why the Scala standard library (especially collections) might need rewriting (many taken from Paul Phillips talks on the Scala Collections library):

Scala WTFs

Small sample of reasons why the Scala standard library (especially collections) might need rewriting (many taken from Paul Phillips talks on the Scala Collections library):

scala> List("a", "b", "c").toSet // the only reasonable line of code in here                          
res1: scala.collection.immutable.Set[String] = Set(a, b, c)
                                                           
scala> List("a", "b", "c").toSet() // seen this when learning Scala first time. ROFL.                        
res2: Boolean = false                                      

scala> List(1, 2) ::: List("a", "b") // it'd be funny if you didn't care.      
res3: List[Any] = List(1, 2, a, b)         
                                           
scala> List(1, 2) ::: List(3, 4.0) // sad panda       
res4: List[AnyVal] = List(1, 2, 3.0, 4.0)  
                                           
scala> List(1, 2, 3) contains "wtf?" // LMAO if it didn't hurt so much     
res5: Boolean = false                      

scala> Double.MaxValue - Int.MaxValue == Double.MaxValue // I don't even ...
res6: Boolean = true

scala> 555555555.round // LOL                                    
res0: Int = 555555584                                      
                                                           

Anyone interested in a fork of Scala? Because I think, realistically, it has got to be coming. No?

Maybe also simplify the language too. While we are at it! Think of it as a Scala tribute language without the Java-Interop-At-All-Costs mentality. Like a tribute band of a famous band that doesn't perform any of their crappier songs, because why bother?

Discuss.

PS Mostly I enjoy and am productive in Scala today, but... I want it to be better. When it is irritating, it is super irritating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment