Over a million developers have joined DZone.

Leon LaSpina: Why NetBeans IDE is Great for Teaching Java

· Java Zone


We've now met several teachers using NetBeans IDE in the classroom: Michiel Noback (Netherlands), Zoran Sevarac (Serbia), Pieter van den Hombergh (Netherlands) Tushar Joshi (India), Johannes Weigend (Germany), Milen Petrov (Bulgaria), and Ken Fogel (Canada). Now let's travel to the US and meet Leon LaSpina. -- NetBeans Team

My name is Leon LaSpina and I teach computer science at Bethpage Senior High School in New York.

I moved to NetBeans IDE in my classroom a few years ago and have been very pleased with that decision. Here are some reasons why NetBeans IDE is great for teaching Java from the perspective of a high school computer science teacher:

Code Navigation

I love the fact that I can CTRL-click any method and the IDE jumps to the source code definition for that method. Then navigation works just like a web browser, for example, CTRL-left arrow works like a back button. Sometimes I might use CTRL-click a few times in a row to dig down into what a method is doing. After I learn what I needed or made some change, I can hit CTRL-left arrow a few times to get back to where I was.

For students this is quite helpful. As they try to understand some code I might give them, they can spend more time reading through the code and less time hunting around for the code they should be reading. The first time a student is presented with a project that involves more than a few classes with more than a few methods each, just navigating around the code can be intimidating.

Auto-Generation of Try/Catch Blocks

I like to introduce file access early on, because it makes it easy to test the programs students write. They run the program on an input file I give them and the student and I both know right away if the program did what it was supposed to do. I  can quickly test a student's work on a number of different input values without having to type them in.

Unfortunately, Java introduces a bit of boiler plate code for file access while checked exceptions add another layer of complexity that distracts from my main objective, e.g., teaching to use String methods or doing some math processing on a list of numbers. Students quickly learn they can have NetBeans IDE make the try/catch block for them by hitting alt-enter over the error.

Auto-Generation of Method Skeletons

Auto-generation of method skeletons for methods required by an interface is also supported by NetBeans IDE. For my own purposes, this is just a nice time saver. For my students, it helps them through the syntax and emphasizes the requirement to provide concrete implementations for abstract methods and interface methods.

For example, we might write public class "Student implements Comparable<Student>". As soon as the student starts writing this class, an error is visible.

When they click Alt-enter over the error, it allows us to let NetBeans IDE generate the "compareTo" method.

Generation of Getters, Setters, and Constructors

Taking care of boilerplate is great for everyone, but when students have limited class time to write code, this is very helpful. Once they understand what a "getter" and "setter" is and how to write them, creating these is really just a typing exercise. In a class with 4 or 5 fields, having NetBeans IDE generate getters, setters, and constructors saves time for more interesting things.

Git Support

I love the built in Git support.

It has allowed me to use source control for my own projects and to coordinate work with students without really knowing how to use Git! 

Are you also using NetBeans IDE as a tool in the classroom to teach Java or another language or technology? Write to netbeans dot webmaster at gmail dot com and we'll work with you to promote your work in the classroom.



Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}