I tend to have this redundant naming in case classes:
abstract class MyTree
case class MyTreeNode (...)
case class MyTreeLeaf (...)
Isn’t it possible to define Node and Leaf inside of MyTree?
What are best practices here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since class, trait and object names are package scoped, why not use the package to provide insurance against aliasing with other nodes and leafs and call them simply
NodeandLeaf, while leaving them outside any other scoping construct (i.e., an object)?