Saturday 29 September 2012

Explaining Java's Graphics System | Java's Poor Documentation

One of the hurdles in teaching graphics early is that Java handles graphics in a way that's hard to explain. This results in the graphics code that's handed to the student being treated as a piece of "black magic" for some time. At least with Swing being a standard part of Java now (though the observant student will wonder about that javax.swing thing) it appears more functional.

Sun's explanation makes interesting reading. If you're into doing jigsaw puzzles, this will be right up your alley. I especially like this particular comment near the beginning:

Both the AWT (abstract windowing toolkit) and Swing provide such a [graphics] framework. But the APIs that implement it are not well understood by some developers -- a problem that has led to programs not performing as well as they could.

Since this basically translates as, "Bad programs are written by programmers who can't read our minds," it's not a very flattering comment for Sun's readers.

Teaching Graphics Early

I'm a firm believer in teaching students to program a graphical application as early as possible. Since the intricacies of callbacks, contexts, and so on is too much to lump on a beginner, this usually involves having a certain amount of "black magic" code in examples at the outset. However, I think the payoff overcomes the disadvantages.

In the days when the console or command line interface was the normal computer interface, beginners were plenty satisfied with learning to write programs to that interface. Now the normal user is familiar with a graphical interface, and command lines feel odd, awkward, or otherwise weird and unreal.

Thursday 27 September 2012

Mini-Review: Head First Java, 2nd ed. by Kathy Sierra and Bert Bates

Head First Java by Kathy Sierra and Bert Bates, cover image.
Head First Java, 2nd Edition
Head First Java is a great book for describing many of the confusing aspects of the Java language. It is easy to read, written in a light style, and it uses lots of graphics to break up long runs of text. Many of the graphics in the book illustrate key concepts of Java.

Not For Raw Beginners, But Close to It

For an experienced programmer new to Java, it can be used to learn enough about Java to get a strong basis in the language. It covers a lot of the language, enough to get someone from just starting out to the point where they're capable of carrying on learning with the official documentation or books on specific programming subjects within Java. It starts out at a point that will probably not be basic enough for non-programmers to start learning, but if the non-programmer has a mentor, or another book specifically intended for non-programmers, it will make an excellent supplement.

Trying Out LiveCDs

I'm still looking for a Linux or FreeBSD LiveCD for my high school computer class. I've had some success, but there's more to do. The idea is to have an OS disk that we'd run off of during class with the tools we need all there, ready to go.

No Room, No Room!

The computers in our lab at school have very limited disk space. Windows XP is installed on them, along with programs needed for other classes. That doesn't leave much room for graphics programs and development systems that I'd like to use for my classes, both the middle school and high school classes. So I thought I could use LiveCDs to solve the problem. Only the student's data files would need to be stored on the hard disk.

The Groovy Language

I've had a chance to play with the Groovy programming language just a little now, and I have to say it looks great for my needs as a teacher. It provides enough access to the system to allow the students to make nice GUIfied applications. The syntax is clean and simple--I wouldn't have to spend a lot of class time explaining purely "structural" code.

It's also got the strong real-world presence I'm looking for in a language. The Grails element has made Groovy a popular web-development language. This is great for the students in my class who will want to expand on what we do in class.

What I've done so far isn't enough to teach with it, not by a long shot. But it's pretty darn promising. I haven't seen a book on Groovy for non-programmers, yet, so no textbook. So I'd have to develop a lot of my own lesson materials between now and January if I'm going to start teaching it this year.

LiveCDs with Groovy Included?

I doubt I'm going to find a LiveCD that includes Groovy. Though it's looking like I'm not going to find one that meets my needs as-is anyway. So I'm going to have to look into:

Finding a LiveCD distro that works on all the school's lab computers and is likely to work on most student's home hardware.

Figuring out how to modify the content of the LiveCD distro to add the elements I want.Whether I can manage to put together 32-36 lessons in Groovy as well between now and January while meeting all my other commitments remains to be seen. On the other hand, I can expect to throw it in at the end of the year as an extra with maybe a half dozen lessons or so, then expand that to a full semester the following year.

OpenSolaris

My OpenSolaris LiveCD arrived yesterday and I've had a chance to get a first brief look at it. I ordered it as part of my search for a LiveCD that I can use as a development environment for my high school computer class. I chose OpenSolaris in part because it's not already represented in the school's computer lab (I try to expose my students to as many different OSes as I can), I like Solaris in general (ever since it got over its teething pains after the change from SunOS), and I figured there'd be a high likelihood of the JDK being pre-installed on it.

It started up fine on my iMac (Core2Duo), and presented me with a very nice desktop. It's got some nice apps installed. The audio didn't work, even though it claimed to have a driver for it, and neither the ethernet or wireless networks had compatible drivers, which was disappointing.

No JDK? On a Sun OS? Really?

A bigger disappointment was the lack of a JDK. The JRE was there, but no JDK. In fact, I didn't find any development tools on the disk at all, except for python.

I realize that the space on a CD is pretty limited when delivering a modern OS, but it seems to me that if there's room for lots of media-related apps and sample media for them on a disk, there's room for some developer tools, too.

Certainly you'd think Sun would want to make the Java SE's JDK the 21st-century's equivalent to BASIC or K&R C? I guess python's got that role, it's just a shame that python doesn't address more of the system without having to use platform-specific APIs.

Keep Looking

Well, OpenSolaris isn't entirely out of the running for my class. This particular LiveCD is, but after some searching for a LiveCD that contains the JDK I turned up BeleniX. I downloaded the latest ISO last night, hopefully I'll have time to burn it and give it a spin soon. The list of packages claims that it has the JDK version 5 (presumably 1.5), which is good enough for a beginner's class, though I'd prefer 1.6. At least I'll have the Scanner class.

Wednesday 26 September 2012

Singular Web Template Free Download

Free CSS Templates are provided by aapzin.com as free download for everyone. All CSS Templates are absolutely free to download, modify and apply for your websites without restrictions. All of them are W3C standards-compliant free CSS templates.

Download Template


Support Us

Feel free to use our templates for any purpose. Please support us by providing a credit ( Designed by Aapzin Solutions ) at the footer of your websites. Thank you very much!