Rice University logo
 
Top blue bar image Comp215: Introduction to Program Design
Prof. Dan Wallach, Fall 2019
 

Welcome, Fall 2019 Students!

 

Welcome to Comp215 for fall 2019. At this web site, you’ll find the course syllabus and schedule. Lecture slides and weekly assignments will appear on Piazza (you’ll be invited to our private Piazza when classes begin). Grades will appear on Canvas. Students who are not enrolled will not be able to do the assignments or participate in the Piazza discussions.

We will soon have a SurveyMonkey signup sheet so we can know a little bit about you. That will appear here this fall.

Meanwhile, we often get questions in advance of the class from students looking for how they can better prepare themselves.

Laptops

As you probably know, Comp215 will have you do all of your coding in Java, and we’ll be moving to the latest Java11 this year, using the IntelliJ IDEA environment. If you’re using an older, slower laptop, or if you only have a Chromebook (*), you’re going to need a “real” laptop computer for Comp215. IntelliJ runs just fine on Mac, Windows, and Linux; use whatever you prefer. The exact CPU doesn’t matter much either. We recommend a minimum of 8GB of RAM and a 256GB SSD, giving you sufficient space, plenty of speed, and some robustness against you dropping your computer on the floor. Hard drives with spinning parts have more space, but they’re much more fragile. Also, in the past few years several students experienced hardware failures at inopportune times. Make sure you’ve got good warranty coverage on your machine. We do have loaner laptops to cover if necessary.

Also of note, our exams will be “open Internet”, which means that the world is your oyster. Make any query to Google, read any thread on StackOverflow, etc. However, we cannot guarantee a power outlet for every student in our exam rooms. You need to be confident that your laptop’s battery can survive three hours of continuous usage. Battery life generally gets worse over time, so make sure your laptop is up to the task.

So what should you buy? You don’t need a top-of-the-line gaming rig. Those are heavy and expensive. Instead, we recommend you get something from the 13-14″ lightweight category. If you like Apple products, a MacBook Air or MacBook Pro will do everything you need (**). If you prefer a PC, you’ve got tons of choices (***). Also, many PCs are available with “2-in-1” touchscreens; even if you never touch the screen, it will be more resistant to scratches and other damage.

If this represents a financial hardship for you, please email us as soon as possible so we can make appropriate arrangements.

If you learned Java in high school

You’re probably good to go. You may have learned to program with Eclipse or some other Java IDE. We’ll be using IntelliJ, because it has a variety of sophisticated features that aren’t available anywhere else. You might want to take some programs that you’ve already written and play around with IntelliJ to get comfortable with it. Or maybe just refresh your memory and follow the instructions below.

If you’ve never written a line of Java code in your life

Don’t panic! While you don’t need to do anything beyond passing the prerequisite Comp classes, a couple hours of advance work over the summer will make your life a lot easier in the fall, since we hit the ground running fast. Luckily, there are some excellent and free online resources to help you from Udacity, edX, Coursera, and more. We recommend CodeAcademy. CodeAcademy’s “Learn Java” tutorial is free, simple, and self-paced, and you don’t have to install any software. (You can optionally pay them money for additional projects. That’s not necessary.)

After you work through CodeAcademy, you might then install IntelliJ and go to the exercises below. If you want to try one of the other MOOCs, go for it, but CodeAcademy seems like the right level of detail.

While you’re at it, play with the Unix command line

We never explicitly teach this in Comp215, but it’s a fantastically useful thing to know. Inside every Mac is Unix, and when you run the Terminal app, you’re talking directly to an old-school Unix command-line shell. It’s also there from the start on every Linux machine. On Windows 10, you can install the Windows Subsystem for Linux or the minimalist MinGW, which is also part of Git for Windows. (We’ll have you install Git For Windows for Comp215.) But what is the command line? How do you learn it? Why should you bother?

Once again, CodeAcademy has a free tutorial. (You can skip the paid parts.) See also the “Learn Enough” Command Line TutorialLinuxCommand.org, or the UNIX Tutorial for Beginners.

How do I install IntelliJ?

We’ll provide detailed installation instructions this fall. The short answer is that you need to install:

  • Java11 Development Kit. We recommend Amazon Corretto 11. For Windows, download the “MSI” file. For a Mac, download the “PKG” file.
  • JetBrains’s IntelliJ IDEA Community Edition (as a Rice student, you can get the “Ultimate” edition free, but there’s nothing in it that we need for Comp215). The current version, as of June 2019 is 2019.1.3, with the 2019.2.x versions in “early access”. By the end of the summer, 2019.2 will probably be the current version.
  • Windows users: You’ll also need to install Git for Windows.
  • Mac users: You’ll need to go to your command-line, e.g., via the Terminal app, and run this command:
    xcode-select --install

The rest of the installation process is detailed on the IntelliJ web site. See, e.g.:

Again, you don’t have to do any of this over the summer, but if you’re planning to play with Java, you might as well use the same setup that we’ll be using in class.

Exercises

Feel like you’re ready for Comp215? Want something a little deeper to test yourself? Here you go: two straightforward exercises and a place to look for more:

  • Write a program that implements a Sieve of Eratosthenes and can print all the prime numbers less than some constant (https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
  • Write a program that opens a plain text file and counts the number of words within (similar to the Unix “wc” program)

Beyond that, it’s more important for you to work on your skills as a problem solver, regardless of the programming language. If you’ve got the time this summer, we recommend you try tackling the Advent of Code — 25 fun problems each year, some easy and some hard. (It’s something of an annual contest that doesn’t care about what programming language you use, with a leaderboard for who finishes fastest.)

If you already know Python and you’re starting from scratch with Java, you might try implementing solutions to those “advent” problems first in Python then rewriting them later in Java.

Hey, why aren’t we…

  • Using an older version of Java? Java8, which came out in 2014, was a huge jump from prior versions, completely changing the ways you might go about solving many problems. More recently, Oracle has released Java11 as a “long term supported” version, which makes a number of minor improvements over Java8. Several of those improvements are useful for us.
  • Using a newer version of Java? Java11 is going to be around for many years to come. The newer features introduced in Java12 and Java13 are very minor, and the other tools we use don’t support it yet. If and when Oracle releases Java14 with “long term support”, we’ll look at migrating to it.
  • Using Kotlin, Scala, C#, or some other language? Java has been around since the mid 1990’s and has been hugely influential on these and other programming languages. Once you understand Java, you’ll be able to rapidly learn these and many other programming languages.
  • Using Eclipse or some other Java IDE? IntelliJ seems to be the best of the bunch and they’re working aggressively to improve it. It’s also free and available across every major platform. A version of IntelliJ is also used for Android development (in Java) and there are versions for other languages as well, like PyCharm for coding in Python.

Notes

* In May 2018, Google just announced that they were supporting native Linux apps on Chromebooks, which includes the ability to run software development tools like we use in Comp215. You shouldn’t be dependent on “experimental” support for tools you’ll be using seriously.

** Apple goes out of their way to keep their upcoming products a secret. Pay attention to the rumors about when Apple might announce something new. Apple has made recent updates to the MacBook Pro and MacBook Air that make them competitive with any PC laptop. You may be also able to find significant discounts on last year’s machines or refurbished machines. So long as you have enough RAM and SSD storage, last year’s machine may be a good choice. If you do buy an Apple, don’t forget that you get a Rice discount.

*** Intel’s “9th generation” chips are out, resulting in some good sales on “7th” or “8th” generation machines, which still work just fine. Also, AMD’s processors are completely compatible with Intel and are both fast and affordable. For example, Dell offers an AMD-based Inspiron 13 7000 2-in-1 for $587 or thereabouts and an Intel-based Inspiron 14 5000 2-in-1 for $519 or thereabouts. If you do buy a Dell, don’t forget to explore their educational discounts and to see if there are better prices at Amazon (e.g., that same Dell / AMD machine for $579). You may find similar discounts from other PC vendors.