-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My Solution to the weather problem #2
base: master
Are you sure you want to change the base?
Conversation
done the second task? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very simple and neat solution 👍 .
Waiting to see you implement the football solution as well and factor out common code.
*/ | ||
object DataMunging { | ||
|
||
case class weatherLine( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch adding a weatherLine class data type! 👍 .
One tiny thing - Scala Style guide would probably suggest the CamelCase name for weatherLine i.e WeatherLine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I decided earlier to I need to put in more effort to using a style guide in coding. Thanks for the correction.
(a.maxTemperature - a.minTemperature) > (b.maxTemperature - b.minTemperature) | ||
} | ||
|
||
def main(args: Array[String]) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you could extend App instead of having a main method, but thats just a style thing. Whichever style you like is good.
val filename = "weather.dat" | ||
val fileLines = io.Source.fromFile(filename).getLines().toList | ||
|
||
/** filter empty lines **/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your solution is nice, simple, elegant. 👍
The comments would be really helpful for guys in our Meetup who are beginners. Though more experienced Scala devs may not need them, as the code itself is quite clear. 👍
No description provided.