Scala wrapper for Java NIO(github.com)1 points·by pathikrit·11 ปีที่แล้ว·1 commentsgithub.comScala wrapper for Java NIOhttps://github.com/pathikrit/better-files1 commentsPost comment[–]room271·11 ปีที่แล้วreplyI have a (genuine) question about this, as I'm interested. What is the benefit to supporting so many ways to instantiate a File object: val f = File("/User/johndoe/Documents") val f1: File = file"/User/johndoe/Documents" val f2: File = root / "User" / "johndoe" / "Documents" val f3: File = home / "Documents" val f4: File = new java.io.File("/User/johndoe/Documents") val f5: File = "/User" / "johndoe" / "Documents" val f6: File = "/User/johndoe/Documents".toFile val f7: File = root / "User" / "johndoe" / "Documents" / "presentations" / `..` Why not just the first one, and string interpolation/composition if you need 'root' or 'home' ?
Why not just the first one, and string interpolation/composition if you need 'root' or 'home' ?