about | help | home | prefs | create account
CodingBat code practice

About CodingBat

CodingBat is a free site of live coding problems to build coding skill in Java, and now in Python (example problem), created by Nick Parlante who is computer science lecturer at Stanford. The coding problems give immediate feedback, so it's an opportunity to practice and solidify understanding of the concepts. The problems could be used as homework, or for self-study practice, or in a lab, or as live lecture examples. The problems, all listed off the CodingBat home, have low overhead: short problem statements (like an exam) and immediate feedback in the browser. The idea for CodingBat came from my experience teaching CS at Stanford combined with seeing how student's used unit-tests in more advanced courses, and crystalized when I saw an Owen Astrachan demo of a unit-testing thing he uses with his Duke students.

New Report Feature

The report page now features a filter control so you can select between java/python student problems, and "stock" problems from the front page vs. custom written problems. Now only sections (e.g. java.Logic-2) where a student has done a problem are shown in the table.

New Python Feature

The big new feature is Python support. The addition of Python prompted a change of name, from JavaBat to CodingBat (creative, I know). All the old JavaBat features, old urls etc. still work.

New Authoring Feature

We're rolling out an experimental authoring feature -- access it at the Authoring page, and see the Authoring Docs.

There are Java help pages based on the handouts I created to teach Java at Stanford: If and Boolean | Java Strings | While and For Loops | Arrays and Loops

Theory -- Coding in the Large and Small

To excel in Java, or any computer language, you want to build skill in both the "large" and "small". By "large" I mean the sweeping, strategic issues of algorithms, data structures, ... what we think of basically as a degree in Computer Science. You also need skill in the "small" -- 10 or 20 line methods built of loops, logic, strings, lists etc. to solve each piece of the larger problem. Working with students in my office hours, I see what an advantage it is for students who are practiced and quick with their method code. Skill with the method code allows you to concentrate on the larger parts of the problem. Or put another other way, someone who struggles with the loops, logic, etc. does not have time for the larger issues.

JavaBat is all about building and practicing method code. The number of problems in each area is pretty large, so you can repeat and solidify your code skill in that area.

Coding Practice

If you want to build skill in running, what do you do? You run. To build skill in method code, write methods. Ok, that's pretty obvious, but with this site, I'm trying to create an environment where people can concentrate on the coding with nothing else to get in the way. With all the surrounding structure taken care of, you can get a lot of coding practice done in just an hour or two. I'm conscious that the problems do not have realistic stories to motivate what's going on. Instead, they are stripped down to have short problem descriptions with as little ambiguity as I can manage. Of course programming problems with realistic stories are a very important part of CS, but I leave those for larger take-home assignments. JavaBat is just about lots of little problems to provide opportunity to practice.

I also like the way you can get immediate, positive feedback. It's a simple mechanism, and yet I find it satisfying to try to finish enough check marks to get that gold star!

Right now, the problems are the sort you would see in a first or second Computer Science course. Click on a problem, type some code into the method body, hit the Go button, and work it from there until you get the green check mark.

The name of the server is JavaBat, based on the Greek word "bat" meaning "this domain was available". You can always get back to it from my Stanford home page. Most recently at Stanford, I've been teaching CS108.

To help you pass time outside of coding, here's my old free dice for Settlers of Catan java app.


If you have any thoughts or suggestions about this server, please don't hesitate to email me at nick.parlante@cs.stanford.edu

Site uptime monitoring by SiteUptime.com