logo       

Some initial suggestions (or perhaps things I don't understand): msg#00012

lang.scala

Subject: Some initial suggestions (or perhaps things I don't understand)

So far Scala has been really great, and it's made me way more
productive in the construction of an XML facade that analyzes an
annotated schema and loads classes to construct fragments of the
document described therein from a database on the fly based on the
annotations. Functional programming in a Java environment is
excellent. Here are some initial thoughts:

Constructors and instance variables in Scala are confusing and sort of
frustrating. For example, if I use the default constructor, then it
seems I have to commit myself to using its arguments as values rather
than variables. I would really like to be able to specify mutable
instance variables in the default constructor.

Not being able to reference local variables with the "this" keyword is
also a little frustrating. It means that if I want to refer to
instance variables within accessor methods then I must give the formal
parameters slightly different names. In Java I have often used a
trailing underscore on instance variables but that isn't allowed in
Scala either.

Also, a convenient way of defining accessor methods for values and
variables that didn't rely on using case classes would be really nice
to have.

Maybe these issues are just me missing some larger point. I'm sure
there are good reasons behind the team's design decisions, but I just
thought I'd bring it up.

Also, a question... what happened to the Ord trait mentioned in
Programming In Scala? Has it become Ordered? I used "view bound types"
in place of the book's example that used Ord, and things seemed to
work. I guess I need to look more into views. Thanks again for
creating this awesome language.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise