Learning Scala and Akka on new Macbook with MacOS 12 (Monterey)
What can be the optimal set up to progress on learning Scala? There are many interesting tools available, however, most of them just mess up our brand new Mac with Monterey. I would like to give you intro into my development set up as Java/Scala developer and Scala 3 (Dotty) contributor (testing modules).
Let’s start with hardware first. As this article title announced we will need a Macbook Pro ideally with Monterey/MacOS 12 installed. You should not have any difficulties with tools bellow on Intel Macs and all tools are tested on new M1 Max!
- Amphetamine (https://apps.apple.com/us/app/amphetamine/id937984704?mt=12)
Amphetamine can keep your Mac, and optionally its display(s), awake through a super simple on/off switch, or automatically through easy-to-configure Triggers. Amphetamine is extremely powerful and includes advanced features for those who need them, yet remains intuitive and easy-to-use for those who don’t need all of the bells and whistles.
Note: I am using to when I need to keep an app/environment running over night and make sure that the Mac accidentally for some reason go sleep too.
Every time you multitask with many apps open, you need all the windows arranged accordingly. Magnet makes this process swift and easy. In one drag to the edge of your display, you size a window into half of the screen. And by dragging apps to corners, you snap them into quarters. Slide them to the bottom edge to create thirds. Do the same on an ultra-wide monitor and sort your windows into sixths. Taking advantage of such arrangements eliminates app switching and greatly enhances workspace efficiency.
Note: I can not imagine to work without this tool. It is so annoying to all the time adjusting size of the windows. Magnet just simply fix that problem.
- VisualVM (https://visualvm.github.io)
MacOS Application Bundle: https://visualvm.github.io/download.html
VisualVM is a visual tool integrating commandline JDK tools and lightweight profiling capabilities. Designed for both development and production time use.
Note: The most useful feature to quickly analyse if something is wrong with my app, something is not properly closing threads is the heap monitor.
- Github Desktop (https://desktop.github.com)
- Docker Desktop (https://www.docker.com/products/docker-desktop)
- IntelliJ IDE (https://www.jetbrains.com/idea)
Both Community/Ultimate edition Scala plugin option to install straight when first time boot up. Restart the IDE to see the new Scala features.
- iTerm2 (https://iterm2.com)
Legendary terminal alternative for Mac.
- Brew.sh (https://brew.sh)
The Missing Package Manager for macOS (or Linux).
Note: I have to say the Brew is very simple package manager with lastest versions of the most common packages and I haven’t heard any security issues with this too. Many known companies offer brew package for their apps. We will use it to install most of the Scala dependencies.
Installation — open iTerm2 and run:
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
How easy is to install sbt: brew install sbt
For Scala: brew install scala
For Apache Spark: brew install apache-spark
and Kafka: brew install apache-kafka
- Visual Studio Code (https://code.visualstudio.com)
Note: I like to use both IDEs. The remote development features for VSC is something what IntelliJ struggle and on the opposite side, IntelliJ autocompletions features and code discovery is absolutely indispensable for large projects or when you working with new dependency and you are not sure how to implement it.
Important extensions: Metals — Scala autocompetion, Docker, Remote-Containers and Remote-SSH
- Ammonite (https://ammonite.io/#Ammonite-REPL)
Ammonite lets you use the Scala language for scripting purposes: in the REPL, as scripts, as a library to use in existing projects, or as a standalone systems shell.
Note: Ammonite is brilliant auto-completion alternative REPL — great fit for VSC — installation with: “brew install ammonite-repl”. It can be used through IntelliJ, VSC, iTerm2, any terminal. I am using it for testing code with different version of Scala/dependencies than used in IDE.
So now you should have all main tools deployed and ready to be used for learning…
How to re/start the learning? I assume you have some background in programming or even previous experience in Java or Scala. I can hear your answer on question how many languages you can code. “It is just about the syntax…”. True, but… Have you tried to open Vi editor, write a code in your favourite programming language to answer a code problem and run it? Autocompletion is like driving car with GPS navigation. How I suppose to drive without GPS? This is the biggest problem of the code challenges during the interview processes. It push you out of your comfort zone, out out you favourite IDE and you have to convince interviewer how comfortable you are.
How I have started with my journey to get comfortable with Scala syntax on the level enough to pass any coding interview in Scala/Akka?
- Hands-on Scala (book/pdf) https://www.handsonscala.com written by Li Haoyi, 2020, ISBN: 978–981–14–5693–0.
This book give you (even you are already familiar with Scala) excellent step by step hand-on guide to learn all the basics of Scala syntax.
His blog is also full of additional resources: https://www.lihaoyi.com
- Courses of Daniel Ciocîrlan on Udemy.com (https://www.udemy.com/user/daniel-ciocirlan/)
High quality courses worth of money. He has also free Youtube channel: https://www.youtube.com/c/RocktheJVM
Comment: my surname and title of this course is just a coincidence! :)
I will add more learning content to this article later. Please, check the updates if you are interested in learning Scala. Please, click on “clap” button if you like the article and “follow” if you want to get alert when new article pop-up.
Thank you and Rock the Scala!