This article reviews some of the courses available with the EduTools Plugin in IntelliJ IDEA where you can read up on the theory and then practise completing exercises directly in the IDE. The advantage of this approach is that you are applying what you have learnt straight away. You also gain familiarity with the Integrated Development Environment, IntelliJ IDEA and you benefit from all the compile time checks and power tools of working in the IDE. All of the courses can also be done using Android Studio.
Table of Contents
- Atomic Kotlin
- Jetbrains Academy Kotlin Tracks
- Kotlin Koans
- Kotlin for Java Developers
Installing IntelliJ IDEA Edu
The IntelliJ IDEA Edu is a free IDE for learning and teaching programming. You can download it here: https://www.jetbrains.com/idea-edu/
To add educational functionality to an existing version of IntelliJ IDEA you will need to download and install the EduTools plugin available with instructions here: https://plugins.jetbrains.com/plugin/10081-edutools
Any issues installing IntelliJ IDEA Edu or the plugin please refer to the Troubleshooting guide
On opening IntelliJ IDEA Edu for the first time you should see this screen:
IntelliJ IDEA Edu screen when first installed
Select learner and then you will be presented with the Welcome screen:
Next, go to ‘My Courses’ and select ‘Start New Course’
All courses for existing installations of IntelliJ IDEA and also the EDU version can be accessed at any time by going to File | Learn and Teach | Browse Courses
Access to All Courses
The first course we are going to look at is Atomic Kotlin. Once the All Courses screen displays go to Marketplace and select it or you can use the Search course field if it isn’t already displayed.
All Courses Marketplace screen
Once you’ve selected to ‘Start’ the course it will open as a project in the IDE.
Initial Project screen
The course is made up of sections composed of individual atoms, which are small learning units built upon progressively during the course. The atoms comprise examples with theory. Once you’ve read an atom you can go on to do the exercises. Each exercise has a ‘CHECK’ button to verify your answer is correct and if you are struggling with any exercise you can get hints and use the ‘Peek Solution’ link to view a suggested implementation. This feature is particularly useful even when you’ve completed the example correctly to compare your implementation of an exercise with the one in the course, as in the solution below which shows two techniques for adding entries to a map.
Comparing solutions in the IDE
The atoms in each section of the course are clear and succinct. The explanations are straightforward and do not stretch out to cover multiple scenarios which can detract from the core points. Particularly helpful during the course is introducing and then reinforcing the most useful keyboard shortcuts for various actions within IntelliJ IDEA.
The course was created by Bruce Eckel author of the award-winning books Thinking in Java and Thinking in C++ and many other programming titles, and Svetlana Isakova, formerly on the Kotlin compiler team, co-author of the book Kotlin in Action and a Kotlin developer advocate for JetBrains.
It is targeted at both novice developers and experienced programmers coming from another language. The theory atoms are free for the first two sections of the course, but to access all of them online you will have to purchase the whole course on Stepik. Alternatively, the book is available in various formats on LeanPub.
Overall the course gets the user up to speed learning Kotlin quickly in a structured format. The course places real emphasis on learning atoms in a practical way by using multiple examples and guiding the user with accompanying theory. The exercises which follow the learning atoms reinforce the learning. There is a cost for the whole course, but it’s well worth it.
JetBrains Academy Kotlin Tracks
JetBrains is the company which created the Kotlin programming language. The training they have for Kotlin and many other programming languages is comprehensive. It uses a project-based learning platform to build working applications in an environment that is integrated with IntelliJ IDEA and other JetBrains IDEs.
To get started go to JetBrains Academy and create an account. Alternatively, you can go to File | Learn and Teach | Browse Courses | JetBrains Academy and create an account. There are detailed instructions on the set-up and configuration of JetBrains Academy here if you are having problems. You will then be prompted to select a learning track. Select Kotlin to see the available tracks:
Tracks available in JetBrains Academy
Choose the highlighted Kotlin Basics track and in the next step you need to choose a project to work on:
Kotlin Basics Track Projects
Each project has Activities composed of theory sections followed by practice:
You work progressively through the theory sections and then practise through multiple choice questions, quizzes, placeholder text you have to fill in with answers and small practical tasks you can do within IntelliJ IDEA.
A typical theory screen will look like the following:
A typical theory screen
Once you’ve finished enough Activities to apply the skills you’ve learned you have to complete a project stage. Subsequent topics build your skill level up to attempt more stages until you complete the project.
Here’s an example of a project stage screen:
A project stage screen
Once you’ve selected ‘Solve in IDE’ IntelliJ IDEA opens the exercise or project stage to complete. (You can also complete the exercise in the online Code Editor if you wish).
Completing the exercises in the IDE means synchronising the project with IntelliJ IDEA. This should only be a one time task after which the project exercises will open automatically.
The description of the exercise/project stage is viewable within the IDE as well as the ability to check your solution. For certain exercises, hints and possible solutions are available to look at if you need some assistance.
IntelliJ IDEA project stage screen
After the project is set up in IntelliJ IDEA you can open it as you would any other recent project and can also see the progress you have made in the project by viewing the courses you are working on in File | Learn and Teach | Browse Courses | My Courses
My Courses screen with project progress
What’s interesting about the tracks is they are not exclusively based on the programming language itself. There are also topics covering core fundamentals of computer science, algorithms and data structures, dev tools and essential math.
It’s a holistic approach which means that any topics in the tracks which require core knowledge to understand and complete are catered for. It’s not a hindrance to an experienced developer as you can verify you know the topic quickly and then skip it.
The JetBrains Academy is a collaborative environment for learning. When you are doing the practical exercises you can view hints shared by other users and are invited to submit your hints and solutions as well as join discussions on the topic.
The Kotlin Basics track is free and will give you a taster of the learning format and you can then decide whether you’d like to continue with paid tracks.
Overall I recommend it for learning core Kotlin which is where its strength lies. For learning libraries and more specialised topics like Flows or Coroutines, you will have to go elsewhere. This shouldn’t be seen as a weakness, however. The Kotlin Basics track is aimed at getting the novice programmer proficient in the language. The Kotlin Developer track is more suitable for experienced programmers coming from a different language.
The Koans (practices or tests) are a series of exercises which refer the user to the official Kotlin documentation before describing an exercise to be completed.
Once the All Courses screen is displayed go to Marketplace and select it or you can use the Search course field if it isn’t already displayed.
All Courses Marketplace screen
They can be done online, but for compile time checks, auto complete etc. it’s easier to do them within the IDE. Some of the exercises presume the user has a background in Java which can make them challenging for the novice programmer.
The Koans themselves dot around a bit covering various areas of the Kotlin SDK, but not necessarily in a structured way or with progressive levels of difficulty. This can also be seen as an advantage as you get exposure to completely different topics. Yes, it’s not going to teach you a subject area in depth that an individual Koan covers, but this isn’t really the point. There are only 43 Koans so completing them with a bit of application doesn’t take long which is satisfying. Moreover, they are really fun to do, so once you’ve dipped your toes starting to learn Kotlin they are a really good progression to get you working on more advanced topics.
Kotlin for Java Developers
This course (offered by Coursera), for experienced Java developers is taught with video tutorials by Kotlin project lead Andrey Breslav, and JetBrains developer advocate Svetlana Isakova. The programming assignments are projects which you complete in IntelliJ IDEA. Go to the Coursera option in All Courses to join.
All Courses Cousera screen
After watching the video tutorials and doing the playground tasks you have to complete a programming assignment after each week. If you pay for the course you can submit you solution to Coursera and it displays the pass/fail status online. (You also receive a certificate of completion when you finish the course).
Programming assignment screen with submission action
The programming assignments are quite challenging, but there is a test harness which you can run tests to verify your solution before submitting for grading. The course is a great introduction to harnessing the power of Kotlin for developers with a Java background.
Experienced developers will benefit the most from Atomic Kotlin (Stepik) as it covers the language thoroughly and is the most practical, hands-on course for learning Kotlin. For the novice developer the Jetbrains Academy Kotlin Basics course is the best place to start as it covers programming fundamentals whilst learning Kotlin. The Kotlin Developer course, also from the Jetbrains Academy is then the natural progression, as it covers core Kotlin to an advanced level. Kotlin for Java Developers (Coursera) integrates the programming assessments of video led tutorials for Java developers. Kotlin Koans from the Marketplace compliments all the other courses with its bite-sized learning chunks.
There is something for every level of developer from any programming background with the learning courses available within IntelliJ IDEA/Android Studio. They are a great asset to learn from within the IDE and are definitely worth exploring.
Alex Forrester is an Android Developer and lead author of How to Build Android Apps with Kotlin
This article was originally published on proandroiddev.com on July 01, 2022