Welcome to learncs.online
!
Your journey in computer science and programming starts now.
We’re so excited that you are here.
Learning computer science and programming is not always easy. You will get frustrated along the way. But you won’t need to struggle alone. This course was created by a supportive community of teachers and learners at the University of Illinois. And you can find more help and connect with other students on our course forum: https://forum.learncs.online. Please take a minute to log in and create an account as you get started!
Before we talk about how this course works, let’s address why: Why take this course, and why learn to program at all? (Feel free to skip ahead if you’re already convinced and want to get started…)
If you’re here, you may already have reasons that you want to learn how to program and the basics of computer science. You might think that knowing these things will help you get a job—and that might be true! You might have real-world problems that you want to solve, and think that learning to create computer programs can help—and it might! Or you might have noticed that your life is increasingly lived with and around computers, and want to know a bit more about how they work.
These are all great and valid reasons to want to programming and computer science. But if you asked us to just pick a few, here are the ones that we think are the most compelling, just in case you’re still not quite convinced:
Programming allows you to solve problems. Computers are without a doubt the most powerful general-purpose problem solving tool our species has ever created. Programming allows you to wield that tool to solve whatever problems might interest you, and change the world in ways that you care about.
Programming is an intensely creative pursuit. People who aren’t familiar with programming sometimes depict it as a boring mundane activity. Nothing could be farther from the truth! Programming fully engages your entire mind as you create code that is both beautiful and functional.
As Fred Brooks put it:
“The programmer, like the poet, works only slightly removed from pure thought-stuff. They build their castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.”
learncs.online
?learncs.online
?So you want to learn to program and a bit about computer science. Great! But why use this site? After all, there are tons of great ways to learn to program online, many of them—like this site—completely free.
First and foremost, you should use whatever learning resources work best for you. If you’re struggling to make progress here, try something else! The great thing about the diversity of online learning resources for learning to program is that there is almost certainly something out there that works for you.
That said, and without taking anything away from all of the other great online learning resources for beginning programmers, there are a few things about this site that distinguish it from the many other options:
Interactive live-coding walkthroughs. You don’t learn anything by watching. You learn by doing. That’s why we’ve created a new interactive walkthrough component that we use for all of our live coding demonstrations. At any point during the demo, you can pause and interact with the code yourself—run the program, change things, and generally experiment freely. No other site that we know of offers this feature.
A community of instructors. Sometimes an explanation for a few idea might not click with you right away. When that happens, it can be helpful to hear the concept explained differently. That’s why our materials include contributions from not one, not two, but literally hundreds of different instructors—including both faculty and students. For most concepts, we provide at least two alternative explanations, and for some many more. No other site that we know of provides access to such a large community of instructors.
Tons of programming exercises with code quality feedback. Practice makes perfect, particularly when learning to program. That’s why each of our lessons includes multiple programming exercises, which you can complete right in your browser. And we don’t just provide feedback on whether your code is correct, but also on whether it is good—properly formatted, well-constructed, and reasonably efficient. No other site that we know of provides this kind of code quality analysis.
Debugging exercises. Learning to spot small mistakes is a critical part of learning to program. That’s why we’ve created tons of debugging exercises to help you practice this essential skill. You’ll find them located throughout many of our lessons. No other site that we know of provides as much practice with this core programming ability.
Completely browser based. Unlike some other courses that teach Java or Kotlin, you can learn everything on this site with just your web browser. There’s no extra software to install. We’ve put a lot of effort into building high-performance systems for allowing you to interact with Java and Kotlin code. We hope you enjoy them!
Check out our innovations page for a longer description of the innovative technologies that power this site.
learncs.online
comprises a series of lessons—just like this one.
Lessons combine text, videos, code examples, and interactive walkthroughs, combined to teach a single concept or new idea.
Each concludes with one or more small programming exercises for you to complete, to determine whether you’ve grasped the new lesson concepts.
We suggest that you complete each lesson before moving on to the next. We also suggest that you complete at most one or two lessons per day, and then pause before continuing. Programming is a skill, best learned bit by bit, one day at a time, and through so-called spaced repetition.
Your brain will get tired when you are getting started! In many ways, your brain is like a muscle. When you begin exercising it through programming, it tires easily, and you’ll need to leave time for it to recover and get stronger. Over time, as you internalize the core ideas, you’ll find things come easier and easier, and you can move a bit faster. But don’t expect to be able to rush through all of this content all at once. Like anything worth learning, learning to program takes time. But if you apply yourself, you will succeed.
The best way to get help with the learncs.online
materials is through our course forum.
There you’ll find students and instructors available to answer questions, commiserate, offer support, and engage in meme appreciation.
When you have a question, ask it on the forum.
However! Please do not post attempted solution code on the forum. You may post output from your submissions, and other information about what you are trying and what is going wrong. But posting solutions ruins the experience for other learners.
Our lessons contain a mixture of different types of content. Some of each lesson will be text, like what you’re reading.
We also use a lot of interactive examples, like this one:
These playgrounds are editable and runnable. They are here for you to play with. Run them, modify the code, run them again. You’ll learn to program must faster if you allow yourself to experiment.
When working on larger examples your changes will automatically be saved, but you can always return to the original contents. You’ll know that an editor is saving your work when you see the green check mark in the upper right-hand corner, like this:
Sometimes we want to show you how to do something using code. In that case, we’ll provide an interactive walkthrough, which combines audio with an animated editor. Here’s an example.
Many of our walkthroughs include contributions from multiple course staff members. Confused? Try another explanation! Still confused? Ask on the forum.
Finally, we’ll also sometimes use video to explain a concept or make a particular point. Or, for us to introduce some of our pets!
Mixed in to each lesson you’ll find practice problems, like the one below. Solutions to the practice problem will be available once you’ve attempted it a few times. These problems will help test your understanding as you go along, and prepare you for that lesson’s homework problem.
Welcome to computer science! Let's begin our journey together.
As we learn to communicate with these incredibly powerful machines, we frequently need them to tell us something about what they are doing as they run our program. We do this by using so-called print statements.
In Kotlin, the programming language we'll be learning together, we use the function
println
to print a message to the console. The code below is already displaying a
message. But to complete this problem you need to modify the code so that it prints "Hello,
world!" (Note that you don't need to print the quotation marks, just what's between them.)
As you learn to write computer code, you’ll need to be able to identify and fix small mistakes with your programs. To give you more practice with this, lessons also include debugging challenges, like the one below. These give you practice at finding and identifying small mistakes in computer programs.
Throughout the lesson videos and walkthroughs, you may hear references to CS 124, CS 125, or the University of Illinois.
The learncs.online
materials were created to support an introductory computer science course at the University of Illinois, originally numbered CS 125 and then recently renumbered to CS 124.
We think that CS 124 is the best introductory computer science course on the planet!
Hopefully, by the time you’re done learning using our materials, you’ll agree.
Click here to find out more about learncs.online
.
One unique feature of learncs.online
is that we incorporate contributions from many different instructors.
Over 200 instructors and students have contributed to our online materials.
Notable contributors include:
learncs.online
and CS 124, the primary author of all course content (including Java and Kotlin lessons, Java and Kotlin programming problems and debugging exercises), and the primary developer and maintainer of this site and all its backend infrastructureWe’ll be reading and writing a lot of Kotlin computer code together. But what is code?
Computers are incredibly powerful and versatile machines. If you can get them to do what you want, you can solve any problem and change the world. But how do we tell them what to do?
Here’s one of the simplest examples of a computer program—one so special that it has its own name: “Hello, world!“.
Run the code above and see what happens. Now, play with the code. Experiment and see what happens. Maybe try and see if you can get the code to print something other than “Hello, world!“. See if you can break the code, and find out what happens when the code doesn’t run. Nothing bad will happen! But see if you can figure out what is wrong with the code based on the output produced by the computer.
Each lesson concludes with a homework problem to complete. Solutions to the homework problem will be available once you complete it!
Welcome to computer science! Let's begin our journey together.
As we learn to communicate with these incredibly powerful machines, we frequently need them to tell us something about what they are doing as they run our program. We do this by using so-called print statements.
In Kotlin, we use the function println
to print a message to the console.
The code below is already displaying a message.
But to complete this problem you need to modify the code so that it prints "Hello, learncs.online!"
(Note that you don't need to print the quotation marks, just what's between them.)
Need more practice? Head over to the practice page.