Conversation
| @@ -1,2 +1,266 @@ | |||
| *.class | |||
| *.log | |||
| # Created by https://www.gitignore.io/api/osx,vim,code,linux,emacs,windows,eclipse,intellij+all | |||
There was a problem hiding this comment.
I know nobody really looks into .gitignore but I generally dislike generated bloat like this. As a developer I want to understand what files are being created in the project directory and why. If those are my custom tools, I would ignore them at ~/.gitignore level.
There was a problem hiding this comment.
Perhaps I'll add some comments with a bit of explanation.
My goal here was to ignore all system / OS-specific files (like OSX's .DStore) and editor / IDE config files which gets generated automatically and often accidentally committed.
I'm covering three main OS (Win, OSX, *nix) and common editors.
There was a problem hiding this comment.
When the .gitignore starts mentioning files that you didn't even know existed, there is a risk of accidentally not committing a file. And the pursuit of ignoring all system files is pointless because you never know what strange tools and temp files people are going to have. That's why Git has a user-specific ~/.gitignore file.
There was a problem hiding this comment.
That makes sense... I'll revert.
exercises/intro/README.md
Outdated
| <center> | ||
| <small> | ||
| _(source: [Loop1.java](https://github.com/SingaporeScalaProgrammers/scala-workshop/blob/master/references/intro/src/main/java/Loop1.java))_ | ||
| </small> |
There was a problem hiding this comment.
What is this syntax doing? In the preview https://github.com/SingaporeScalaProgrammers/scala-workshop/blob/a5773757e08d4a1de72ce544d59927766104ca9e/exercises/intro/README.md it's not looking nice. Not sure how is it intended be rendered.
There was a problem hiding this comment.
Complete fail 😁 I'll figure out alternative format (and keep it readable in raw MD).
exercises/intro/README.md
Outdated
| program while learning core FP concepts such as: | ||
|
|
||
| * referential transparency, | ||
| * expression-based programming, |
There was a problem hiding this comment.
Thanks! Breaking down long sentences in bullet points is good 👍
exercises/intro/README.md
Outdated
| this case; | ||
| 3. `1 to 10` defines a inclusive `Range` – a sequence that can be enumerated; | ||
| 4. `for (x <- seq) { ...x... }` enumerates elements of `seq` executing the | ||
| 1. `1 to 10` defines a inclusive `Range` – a sequence that can be enumerated; |
There was a problem hiding this comment.
I know that MD renderer will turn this into a numbered list, but I prefer the text itself to be readable too (that was the selling point of MD, IIRC). A numbered list with ones somewhat defeats that purpose.
There was a problem hiding this comment.
Good point, will revert.
| @@ -0,0 +1,12 @@ | |||
| public class Loop1 { | |||
| public static void main(String[] args) { | |||
| int sum = 0; | |||
There was a problem hiding this comment.
Good idea to put all the steps there. For a small tutorial like this it's good to have all the steps constantly present and it's not too many of them.
|
|
||
| def sumOfEvenSquares(max: Int): Int = { | ||
| (1 to 10) | ||
| (1 to max) |
| ```scala | ||
| def iterate(max: Int): List[Int] = ??? | ||
| def filterEven(xs: List[Int]): List[Int] = ??? | ||
| def square(xs: List[Int]): List[Int] = ??? |
There was a problem hiding this comment.
Good trick 👍 I didn't think about using ??? to show the intermediary step here.
|
|
||
| By a lucky coincidence Scala standard library collection API already provides | ||
| most of the functions that we've just discovered. It would be a shame not to | ||
| use them: |
There was a problem hiding this comment.
This supposed to be a joke 🤣
There was a problem hiding this comment.
Wooosh 😅 I'll add air quotes, haha.
|
@shishkin I've made the changes as we discussed. I've also uploaded the diff preview files. Note that the diff links on the MD file points to the master branch (which will 404 until this PR is merged). Have a look here for a preview: https://rawgit.com/SingaporeScalaProgrammers/scala-workshop/chore/intro_code_examples/references/intro/diff/Loop3-Loop4.html |
| @@ -0,0 +1,260 @@ | |||
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |||
As mentioned in the group discussion, I've split the exercise code from the example / reference code and updated the
README.mdaccordingly.The exercise code now resides under
exercises/and the example / reference underreferences/. I've made links to the code snippets to the relevant source files to make it easier to navigate. There are also minor fixes to the example code, where a parameter argument is not being used (but I assume is needed).In regards to
README.md, mainly: