3 ms·
+1 Implicits. We put very strict limits on use of implcits. They make code extremely difficult to reason about, but can also be incredibly dangerous. I once stu
by vkjv 12y ago
+1 Implicits. We put very strict limits on use of implcits. They make code extremely difficult to reason about, but can also be incredibly dangerous. I once stumbled upon an implicit cast of Int to Float... Oh, my.
- throwawuy222 12y agoIs there any linters available for IDE's to ensure conformance with a vanilla ruleset of scala? If that existed, scala would be able to shape itself up nicely.
- readmedotmd 12y agohttp://www.scalastyle.org/ http://www.scalastyle.org/ There should be a linter for whatever IDE you happen to be using.
- hohonuuli 12y agoTheir are linters available for scala (e.g. wartremover). Also, the Scala compiler supports a number of flags to warn you if your code is using some of Scala's 'more questionable' features. You can even tell the compiler to fail if any of these warnings occur. A list of useful flags can be found at https://tpolecat.github.io/2014/04/11/scalac-flags.html https://tpolecat.github.io/2014/04/11/scalac-flags.html. You might also want to look at this excellent talk titled 'Toward a Safer Scala' at https://docs.google.com/presentation/d/1tCmphnyP3F5WUtd1iNLub0TWRVyfTJsqhvzYhNS41WY/pub?start=false#slide=id.p https://docs.google.com/presentation/d/1tCmphnyP3F5WUtd1iNLu... that recommends a number of best practices that can be followed using Scala. If you're using sbt, I put together a giter8 template for scala/sbt projects that follows these best practice recommendations at https://github.com/hohonuuli/basicscala.g8 https://github.com/hohonuuli/basicscala.g8
- lmm 12y agoAny modern scala IDE highlights implicit conversions with a green underline, which I find is plenty to make them readable.