Git Product home page Git Product logo

learning_scala's Introduction

My journey in learning Scala

This is my progress checker in my journey of learning Scala.

I'll be using the recommended book from the Scala website: Programming in Scala, Third Edition as the main source and a couple of other resources to do exercises.

I'll also try to stick to the functional programming style to challenge myself along the way.

Project conventions

The following tags are used in this project:

  • BUG: Bugs found in different programs. Should be followed by an open issue on Github.

  • ???: Errors to be fixed at a later point.

  • ??!: Answers to these errors. Should be of the format:

    // ???: How to import with the namespace?
    import org.scalatest._
    

    Gets answered into:

    // ??!: How to import with the namespace?
    // ??!: Scala gets around this with alising:
    import org.scalatest.{FunSuite => FS}
    
  • This prints:: Show in comments what print statements do.

  • NOTE:: Notes for exercise or code; these are not code comments.

  • Written answer:: Written answer to the question in case tests are not enough.

  • Commit: 'cfe6164' or commit: 'cfe6164' (it has to have 7 chars): Reference to a commit inside the source files.

    • Commit tags: comm0123456 tags.
  • IMPROVEMENT:: Notes for exercise or code; these are not code comments.

  • SKIPPED:: Skipped exercises (a justification must follow).

  • ERRATA:: Erratas from the book.

  • CORRECT:: Correct this part of code after correcting a chapter.

Resources

Functional Programming in Scala ("The Red Book")

Website: https://www.manning.com/books/functional-programming-in-scala.

Each chapter will have its own "take-aways" in the corresponding "readme.md" files.

There is a corresponding git page here: https://github.com/fpinscala/fpinscala.

TODO

  • ???: maybe the original fpinscala has tests; copy and paste those (use the same header for credit) and expand on existing tests.

Programming in Scala (book)

Website: https://booksites.artima.com/programming_in_scala_3ed.

Each chapter will have its own "take-aways" in the corresponding "readme.md" files.

Notes on the book

As the author says the book is not an introduction to programming. Some programming skills are necessary (even though he gives a footnote on what a "recursion" is) :) .

  • Pros:
    • The book has very short chapters much in line with today's learning materials. Even the first actual introductory chapter into Scala (chapter 02) is broken into two parts.
    • The writing style is informal and the reading is a very pleasant activity.
  • Cons:
    • No exercises included.

Discussion points

(Each chapter has its own detailed readme.md).

  • In chapter 04 the part about singleton and classes was not clear. Specifically on why would one use a object (for the singleton) and not package everything up inside a class. The apparent advantage was one of not having to instantiate any ChecksumAccumulator object.

Project Euler (website)

Website: https://projecteuler.net/about.

  • Pros:
    • Mature project.
    • Lots of exercises rated by difficulty.
    • Has solutions and examples.
  • Cons:
    • Solutions submissions are not automated.
  • Status: initiated.

Scala Exercises (website)

Website: https://www.scala-exercises.org/.

The website is great for a hands-on introduction to Scala. Unfortunately I had a problem with some of their exercises at some point but I do recommend the material.

  • Scala Tutorial
    • Pros:
      • No setup needed: your browser handles it all.
    • Cons:
      • I had a problem in one of the exercises and had to subscribe to a spammy servince in order to point the problem out.
    • Status: half way through.

S-99: Ninety-Nine Scala Problems (website)

Website: http://aperiodic.net/phil/scala/s-99/.

  • Pros:
    • Has difficulty grades.
    • Has solutions.
    • Are grouped by topics.
  • Cons:
  • Status: not initiated.

Other

Ideas for future projects in Scala

  • Create and deduplicator scanner with a similar behavior of rdfind (written in C).
    • Make use of the famous parallelism in Scala.

Miscellaneous

  • Count the Scala tokens:

    cat **/*.scala | sed -E 's/[^a-zA-Z]+/\n/g' | sort | uniq -c | sort -n
    

TODO

  • On branch dev_unstable: migrate project_euler from ./legacy_code.

  • Since branch new_dev migrate code from ./legacy_code to a scala test framework with each project as a subproject in sbt.

  • Add a Travis CI build.

    • Possibly with nested makefiles to test each program/snippet.
  • Chapter 04

    • Insert an alternative on my pre-commit file to look for a specific file to specify the build process.
      • For instance, to build ./code/scala/chapter_04/Summer.scala one must issue: scalac -cp . ./ChecksumAccumulator.scala ./Summer.scala ; scala 'Summer' a b.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.