From 3e7742c1965f8d49de681aee30f7f9f10b240db2 Mon Sep 17 00:00:00 2001 From: abo64 Date: Thu, 1 Dec 2016 08:07:56 +0100 Subject: [PATCH] Add hints to hello-world exercise --- exercises/hello-world/HINTS.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 exercises/hello-world/HINTS.md diff --git a/exercises/hello-world/HINTS.md b/exercises/hello-world/HINTS.md new file mode 100644 index 000000000..327a6d9b7 --- /dev/null +++ b/exercises/hello-world/HINTS.md @@ -0,0 +1,8 @@ +## Hints +For this exercise two Scala features come in handy: +1. [Default Parameter Values](http://docs.scala-lang.org/tutorials/tour/default-parameter-values.html) +2. [String Interpolation](http://docs.scala-lang.org/overviews/core/string-interpolation.html) + +#### Common pitfalls that you should avoid +- `null` is usually not considered a valid value in Scala, and there are no `null` checks needed (if you don't have to interface with Java code, say). Instead there is the [Option](http://danielwestheide.com/blog/2012/12/19/the-neophytes-guide-to-scala-part-5-the-option-type.html) type if you want to express the possible absence of a value. But for this exercise just assume a normal non-`null` String parameter. +- Scala is an [expression-oriented programming language](https://en.wikipedia.org/wiki/Expression-oriented_programming_language), so there is usually no need to use `return`.