After a bumpy start with Scala on Day 1, I've moved onto the second day of Scala in Seven Languages in Seven Weeks.
Scala, Day 2: Thoughts
The second Scala chapter shifts gears to functional programming. Unfortunately, I was impatient on Day 1 and had already looked up all of these concepts (and some more) to build a Tic Tac Toe game. As a result, I breezed through the chapter.
On a side note, I was using Scala on a personal project and rewrote some Java code using Scala. As much as I complained yesterday about Scala's complexity, the slow compiler, and poor IDE support, I must admit one thing: the resulting code was noticeably cleaner, shorter, and easier to read.
The language is certainly not perfect, but I need to make sure I'm not missing the forrest for the trees: it's still likely a vastly superior alternative to Java.
Scala, Day 2: Problems
The functional programming problems in this chapter were extremely simple. I burned through them in a few minutes and present the code without further comment:
String foldLeft
Use foldLeft to compute the total size of a List of Strings.
Censorship
Write a Censor trait with a method that will replace "curse" words with "clean" alternatives. Read the curse words and alternatives from a file and store them in a Map.
On to day 3
Learn about pattern matching and actors in Scala, Day 3.
Translate
Popular Posts
-
<$BlogPageTitle$> <$BlogItemBody$>
-
2go has launch a new version with exciting new features. The new version is modify with new chatting room and wonderful background. The new ...
-
Police and EMS: Who’s the Boss? A look behind and beyond the conflict between EMS and law enforcement The Legal Guardian by David Givot My ...
-
Blue Rhino Propane Plant Tavares, Lake County, Florida Explosion and Fire Injuries: Eight people were injured, with at least three in cri...