The latest instance of the course can be found at: O1: 2024
- CS-A1110
- Supplementary Pages
- Frequently Asked Questions
Luet oppimateriaalin englanninkielistä versiota. Mainitsit kuitenkin taustakyselyssä osaavasi suomea. Siksi suosittelemme, että käytät suomenkielistä versiota, joka on testatumpi ja hieman laajempi ja muutenkin mukava.
Suomenkielinen materiaali kyllä esittelee englanninkielisetkin termit. Myös suomenkielisessä materiaalissa käytetään ohjelmien koodissa englanninkielisiä nimiä kurssin alkupään johdantoesimerkkejä lukuunottamatta.
Voit vaihtaa kieltä A+:n valikon yläreunassa olevasta painikkeesta. Tai tästä: Vaihda suomeksi.
Frequently Asked Questions
Sections on This Page
- Dealing with Acute Programming Problems
- This Ebook
- Programming Tools
- May I use different preference settings in IntelliJ than the ones suggested by O1?
- I’m on a Mac computer, and IntelliJ doesn’t type characters such as the dollar
$
and square brackets[]
. What to do? - May I use a different programming environment than IntelliJ?
- What if IntelliJ’s A+ Courses plugin doesn’t work on my computer or I don’t want to use it?
- How can I share my Scala app so that others can run it?
- Deadlines and the Course Schedule
- I forgot to fill in the mandatory end-of-chapter feedback. Did I irrevocably lose the points for the chapter?
- Could I submit the assignments a day or two after the deadline, just this once?
- If I fail to submit some assignments by the deadline, can I still submit them just to practice?
- Why are the deadlines so frequent?
- Automatic Assessment and Grading
- My program works absolutely right, but the automatic grader won’t give me any points! What’s wrong?
- I wrote the classes exactly right; I just changed some method names. Why didn’t I get full points?
- Is it an error to add extra methods or variables to a class?
- I got full points for an assignment but I know my program works wrong on certain inputs. Will I lose points later?
- You can solve some of the assignments [in the early chapters] by just copying the given code and seeing what the answer is. That’s not great, is it?
- Natural Languages
- The Scala Language
- Feedback
- Credits
Dealing with Acute Programming Problems
I’m stuck on an assignment; what can I do?!
You can talk to one of the teaching assistants at the lab sessions You can also post a question in Piazza or Telegram (see Chapter 1.1). Please do. We are happy to help.
Two channels that are not suitable for this purpose are the end-of-chapter feedback forms and e-mail.
I got an error message that says [something]; what does it mean?
In some cases, looking up the error message online helps. If it doesn’t, try the lab sessions, Piazza, or Telegram (see Chapter 1.1).
This Ebook
What’s the significance of a gray-bordered box (or a green one, etc.) here in the ebook?
See For the Reader.
How long will this material be available online?
The ebook will be available online for the foreseeable future, which means that you’ll be able to return to it later, even after the course is officially over.
Programming Tools
May I use different preference settings in IntelliJ than the ones suggested by O1?
Yes, if you want to and know how to.
I’m on a Mac computer, and IntelliJ doesn’t type characters such as the dollar $
and square brackets []
. What to do?
O1’s default keyboard settings, which IntelliJ’s A+ Courses plugin selects for you, aren’t currently fully compatible with Mac keyboards. You can fix the matter as follows.
In the top menu, select IntelliJ IDEA → Preferences → Keymap. You should see a drop-down menu at the top; select O1 MacOS Keymap there and confirm. Things should work now.
If the above did not work, read the rest below.
You were probably well ahead of schedule and installed IntelliJ before O1’s official start on September 9th, 2020. If so (that’s great, but) you may not find the O1 MacOS Keymap option as described above. In that case, follow these steps:
- In the top menu, select A+ → Reset A+ Courses Plugin Settings and confirm.
- In the same menu, select A+ → Turn Project into A+ Project and confirm.
- Now you should be able to find O1 MacOS Keymap in the settings menu IntelliJ IDEA → Preferences → Keymap.
(We’ll be updating the A+ Courses plugin to take care of that automatically, but for now this is the best solution. Sorry about the extra trouble.)
May I use a different programming environment than IntelliJ?
At entirely your own risk, yes. There’s nothing in the programming assignments that absolutely necessitates the use of IntelliJ. However, IntelliJ is the only official programming environment in O1, and O1 staff probably won’t be able to help you with any complications or technical problems that may arise if you use a different toolkit.
Using IntelliJ is particularly recommended because of its A+ Courses plugin, which makes it convenient for you to fetch and submit O1’s programming assignments, along with some other minor improvements to IntelliJ’s user experience.
What if IntelliJ’s A+ Courses plugin doesn’t work on my computer or I don’t want to use it?
A+ Courses has been created as a student project in 2020 and is in test use in Fall 2020. If you experience any problems, please let us know via O1’s feedback channels or directly at the A+ Courses plugin’s web site.
One option is to use IntelliJ and A+ Courses through Aalto’s virtual desktop (VDI). For more information, see the gray box in Chapter 1.2.
Alternatively, at the bottom of our IntelliJ page, you’ll find instructions for downloading and submitting assignments without the plugin. This is not a convenient option, however.
At the bottom of our IntelliJ page, you’ll find instructions for downloading and submitting assignments without the plugin. This is not a convenient option, however.
How can I share my Scala app so that others can run it?
See the big gray-bordered box in Chapter 5.4.
Deadlines and the Course Schedule
I forgot to fill in the mandatory end-of-chapter feedback. Did I irrevocably lose the points for the chapter?
No, you didn’t.
If it happens that you forget to submit the feedback form before the deadline, just submit it later. In individual instances that’s okay, but please be more careful next time.
Could I submit the assignments a day or two after the deadline, just this once?
No, unfortunately you can’t do that (except for the feedback forms; see above).
O1 has a lot of students and we can’t personalize the deadlines. Postponing the deadline would interfere with the way we publish the example solutions and use them as learning materials in later weeks.
If you fail to submit some assignments, you can compensate for the missing points as per the policy described in Chapter 1.1.
If I fail to submit some assignments by the deadline, can I still submit them just to practice?
Yes. You won’t score points for any assignments submitted after the deadline, but you will receive the automatic feedback.
Why are the deadlines so frequent?
Many years back, we used to have fewer deadlines that were more spread out, with more to do per deadline (night). It didn’t work.
Automatic Assessment and Grading
My program works absolutely right, but the automatic grader won’t give me any points! What’s wrong?
It is very likely that what happened is not an error in automatic grading as such but a bug in the code that you submitted.
In the automatically assessed programming assignments, any deviation from the specified interface counts as an error, and even a small deviation may result in a very low score. Sometimes, even what seems like a mere formality may be significant (see the next question below).
Please read the feedback from the automatic grader carefully. Please re-read the task description carefully. Check your code for spelling errors, including those that involve upper- and lower-case letters.
Ask the assistants to help you at one of the lab sessions or post a question in Piazza or Telegram (see Chapter 1.1).
Of course, it can happen that our grader is faulty. We’ll be happy to fix the graders if the need arises; if it does, we’ll give you additional chances to resubmit or add points for you manually later.
I wrote the classes exactly right; I just changed some method names. Why didn’t I get full points?
Many assignments ask you to define variables and methods that are part of a class’s public interface. The names (and parameter lists) of those variables and methods are also part of that interface, since any user of the class needs to know them. You cannot change the names without affecting how the class is used. Code written to such a specification is not “exactly right” unless it conforms to the specification, names and all.
In O1, your classes are used by the grader program. The grader cannot use them unless you use the specified names. Don’t change the names of any public variables or methods; don’t even add any such public members.
You are free to name the private members of the classes. You are also free to add any private members that you deem necessary or useful.
Is it an error to add extra methods or variables to a class?
See the previous answer.
Not all of O1’s automatic graders penalize you for adding public members on a class, but you should still avoid doing that. In some assignments, the graders do check that you haven’t added public members beyond those specified.
I got full points for an assignment but I know my program works wrong on certain inputs. Will I lose points later?
You won’t.
The automatic assessment isn’t perfect. We kindly ask you to report such cases so that we can improve the graders; you can use the chapter’s feedback form, for instance.
Deliberately attempting to mislead the graders is forbidden, of course, and may result in a loss of points.
You can solve some of the assignments [in the early chapters] by just copying the given code and seeing what the answer is. That’s not great, is it?
Those small assignments, too, give you an opportunity to learn. Admittedly, they also give you an opportunity not to learn.
We’ve tried to design the course so that most students will be motivated to make the most of the former opportunity. In any case, such assignments don’t count for much in the grand scheme of O1’s assessment.
Natural Languages
I know Finnish, but I’m using the English version of the ebook. Programming terms sound unnatural in Finnish. Programmers speak English, right?
Please see the corresponding section in the Finnish version of this F.A.Q..
The Scala Language
Is the Scala language in widespread use?
Compared to a random programming language: yes.
Compared to the most commonly used programming languages in the world (such as Java, JavaScript, C, and C++): no.
The language is used by many leading companies and other parties, such as Twitter, PayPal, the Guardian, Zalando, Reaktor, Capital One, Blizzard, Netflix, LinkedIn, Intel, Samsung, various financial corporations, computational scientists, etc. Some of them are listed in Wikipedia.
Why did you pick Scala for O1?
There’s no one reason that clinches it. The choice of Scala is based on a combination of criteria. Not all of those criteria concern O1 alone but the first-year programming courses and degree programmes at Aalto more generally.
Below is a list of some of Scala’s attributes. The point of this list is not to say that these features are unique to Scala. Some of the individual items in the list are better realized in some other languages. However, this combination made Scala the most attractive choice.
- Scala is a multi-paradigm language that can be used for different
kinds of programming.
- Scala is well suited for learning functional programming (which is one of the goals of Aalto’s first-year spring courses especially and relevant in O1, too).
- It is also well suited for learning imperative object-oriented programming (in O1, for example).
- The programming courses in our curriculum have a variety of learning objectives and switching languages mid-year would be less than optimal.
- Despite not being one of the most common programming languages, Scala has plenty of street cred. It’s used by many people both in academia and in the software industry.
- Compared to various other programming languages, Scala has relatively “clean” concepts. (As an example, Scala’s implementation of object-orientation is purer than that of, say, Java or Python.) This is nice for beginners, professionals, and others in between.
- Many things are relatively simple to express in Scala. Many other languages require more code to express simple things.
- If you know Scala, it’s relatively easy to learn the commonest programming languages such as Java. (The bigger challenge may be to motivate yourself to use a more limited language after Scala.)
- The language is statically typed, which is a good fit with our first-year learning objectives and enables better programming tools. Scala’s type inference ensures that static typing doesn’t “get in the way” like it does in some other languages.
- With Scala, it’s possible to design pedagogically effective courses that take one careful step at a time but that nevertheless reach deep, challenging topics.
- Our programming courses are taken by students with variable prior experience. Aside from the fact that the language can be used for teaching beginners, many of Scala’s features are familiar to students who have previously worked with Python, C, Java, and the like; those students can thus build on their prior knowledge when they use Scala. Moreover, Scala may tempt those experienced programmers to develop new perspectives on programming (such as transitioning from the imperative to the functional paradigm).
- Scala operates on a high level of abstraction, as befits a modern introductory programming course and much of modern programming. As a couple of examples of this, the language has a rich arsenal of collection types and provides automatic garbage collection so that there’s no need for manual memory management.
- Using a REPL is ingrained into the programming culture around Scala. It’s a great tool for beginners, too.
- Many specific details of the Scala language are potentially helpful
for learning to program (e.g., singleton objects;
val
vs.val
; etc.) - Scala’s libraries are wide and varied (in part because we can use Java libraries, too; Chapter 5.4).
- The available programming tools and documentation are adequate. (This is a partially problematic issue, though.)
- Scala is efficient and convenient in parallel computing, data science, and server-side programming, among other things. This adds to its appeal in various follow-on courses.
- The teachers of our introductory programming curriculum like Scala.
- We want to offer you, dear students, something fresh and a little bit different.
At Aalto, we’ve used Scala for introductory programming since 2013. It’s worked well.
Lund University in Sweden adopted Scala as an introductory language in 2016. You may wish to read what they said about their reasons.
Is Scala designed specifically for beginners or students?
No. Scala is designed for demanding professional use.
In fact, it’s relatively rare to use Scala in an introductory programming course. One reason is that the language hasn’t been established for very long; traditional teaching languages aren’t easily dislodged, and there isn’t a wealth of beginner-friendly material on Scala out there.
A second reason is that many introductory courses at different institutions have goals that are either more modest or otherwise different than ours in O1, so other languages may fit the bill better.
And a third reason may be that since Scala is so versatile, harnessing it for introductory use requires particularly meticulous pedagogical design.
Is it possible to use Scala for programming mobile devices?
Feedback
Credits
Thousands of students have given feedback that has contributed to this ebook’s design. Thank you!
The ebook’s chapters, programming assignments, and weekly bulletins have been written in Finnish and translated into English by Juha Sorva.
The appendices (glossary, Scala reference, FAQ, etc.) are by Juha Sorva unless otherwise specified on the page.
The automatic assessment of the assignments has been developed by: (in alphabetical order) Riku Autio, Nikolas Drosdek, Joonatan Honkamaa, Jaakko Kantojärvi, Niklas Kröger, Teemu Lehtinen, Strasdosky Otewa, Timi Seppälä, Teemu Sirkiä, and Aleksi Vartiainen.
The illustrations at the top of each chapter, and the similar drawings elsewhere in the ebook, are the work of Christina Lassheikki.
The animations that detail the execution Scala programs have been designed by Juha Sorva and Teemu Sirkiä. Teemu Sirkiä and Riku Autio did the technical implementation, relying on Teemu’s Jsvee and Kelmu toolkits.
The other diagrams and interactive presentations in the ebook are by Juha Sorva.
The O1Library software has been developed by Aleksi Lukkarinen and Juha Sorva. Several of its key components are built upon Aleksi’s SMCL library.
The pedagogy of using O1Library for simple graphical programming (such as Pic
) is
inspired by the textbooks How to Design Programs by Flatt, Felleisen, Findler, and
Krishnamurthi and Picturing Programs by Stephen Bloch.
The course platform A+ was originally created at Aalto’s LeTech research group as a student project. The open-source project is now shepherded by the Computer Science department’s edu-tech team and hosted by the department’s IT services. Markku Riekkinen is the current lead developer; dozens of Aalto students and others have also contributed.
The A+ Courses plugin, which supports A+ and O1 in IntelliJ IDEA, is another open-source project. It was created by Nikolai Denissov, Olli Kiljunen, and Nikolas Drosdek with input from Juha Sorva, Otto Seppälä, Arto Hellas, and others.
For O1’s current teaching staff, please see Chapter 1.1.
Additional credits appear at the ends of some chapters.