 |
Teach the Children Well
Posted by hansmuller on November 03, 2003 at 08:23 AM | Comments (13)
Last night my sons and some of their friends were visiting and one of the boys took me aside, said he had a question. He's 15 years old, very bright, and growing up in a world that's somewhat different then the one I remember. There are some similarities. There's a war on although fortunately there's no need for a teenager to worry about being drafted. Cars and girls seem to hold the same attraction as before however attitudes have changed. I hear this Good Charlotte (that's a band) lyric enough to be tired of it: "Girls don't like boys, girls like cars and money". So, desperately trying to channel Ward Cleaver, I braced myself for the inevitable question about the inexplicable. He said: "I have a question about Java".
Today's fifteen year old has lived with a mix of personal computers and networks since they were old enough to type ctrl-alt-delete. They've been schooled on desktop computers with mice and windows and GUIs and realistic 3D multiplayer first person shooters. Given so many rich ways to interact with computers, it's no surprise that few of them choose to learn how to write software. And yet, just like long ago, some of us do respond to that siren song, even if the most satisfying thing about the results is an obedient machine clack-clacking only-funny-to-a-child drivel on a teletype. I was faced with someone who'd had the patience to learn how to write Basic programs for a graphing calculator and who now had the desire to learn Java. He'd even bought a book on the subject that was tailor-made for teenagers, with advice about writing games and gags and lots of black and white pictures of silly programmers.
The book began with some simple instructions. Go to java.sun.com and download the latest J2SE SDK. This was no problem for our modern teenager and thanks to broadband, it didn't take very long either. According to the book, step two was to "add Java to your PATH". In your mind, imagine the sound of a car screeching to a halt and crashing into a brick wall.
First question: "what's a PATH"? I indulged in a brief description of command processing shells. This only led to obvious follow up questions which quickly forced me to confront the fact that, despite ten years of experience with computers, this teenager had never spent any time typing commands at the DOS shell. That's because he never needed to. Returning to the key question of how exactly to "add Java to your PATH" I was greatly relieved to find out that my student had already found a likely looking chat forum, asked about doing this, and within a few minutes recieved the proper incantations. Which was a good thing, since my memory of hacking the DOS PATH has me struggling to edit a long line of crytpic text through a small window
in some kind of shell environment editor dialog mess. For the last N years I've been using Cygwin and bash and although that's more familiar to me, I'd hate to have to try and convince a teenager of its charms.
As fate would have it, the fun was only beginning. Our Java programming book began with the legendary "Hello World" example. Creating the text in WordPad was easy enough, but where to put the file? No, not in the C:\J2DSK Folder (what's Java doing there anyway?), and not at the top level in the "My Documents" folder. I advised creating a HelloWorld subfolder for the app. More confusion about getting the "Command Prompt" started in the correct working
directory and then (finally) typing:
> javac helloworld
javac: invalid flag: helloworld
With hands waving I explain that javac isn't going to just guess that the file you're referring to is "HelloWorld.java". Software that can't be relied upon to DTRT isn't common in the teenage world of game consoles and web sites and chat clients; but we persevered. Sadly, it feels like climbing up a steep hill with a backpack. And the backpack just got heavier.
We return to the problem reinvigorated by the introduction of an actual shortcut - the arrow keys restore commands typed at the DOS prompt.
> javac helloworld.java
helloworld.java:4: package system does not exist
system.out.println("Hello World\n");
^
Gack. You have to realize that our teenager is bright and resourceful and so while I'm contemplating the injustice of being forced to explain what's gone wrong, he's busily comparing the text in the book with the text he's entered. It all looks exactly the same and that's frustrating. As I launch into an explanation of case sensitivity in Java identifiers while trying to avoid divulging what "System.out" means he begins to glance furtively towards the XBox in the other room. His brother his playing a game that involves racing around a city at night in a vehicle packed with large caliber weapons. There are explosions. The backpack we're carrying is getting heavier.
Back we go to the task at hand. This time we're successful and I think I detect a hint of pride as we view the newborn .class file. The book explains the finale simply: type "java HelloWorld". He types:
> java Hellworld
java.lang.NoClassDefFoundError: Hellworld
I suppress the urge to weep. It's not clear if my explanation about the difference between filename command line arguments and command line arguments that represent Java identifiers does any good. At this point the machine gun fire from TV in the next room is sounding almost seductive and the fact that I've made a career out of software engineering has gone from a source of pride to embarrassment. Yes, we do learn navigate through this thicket of details and gotchas. The backpack is feeling like it's crammed full of plutonium.
> java HelloWorld
Hello World
In your mind, imagine the sound of a chorus of angels singing. As we stand atop the mountain, hurling adolescent variations of "Hello World" over the side, all seems well. Until I'm asked what the equivalent of the Basic command for generating a random integer between 1 and 10 is. The angels begin hacking and coughing. The singing ceases. I consider explaining what floating point numbers are, the rules for mixing types in arithmetic expressions, and what it means to cast an expression to an int. Then I consider playing games on the TV.
While we're blowing up cars people and buildings on the game console, I'm thinking about what this experience means. Growing the Java developer base is important. We can rely on classroom instruction for
some of that growth, and the migration of experienced programmers for some more. When I was 14, a PDP-8, Basic, and a Teletype were enchanting despite the fact that learning how to program was strictly do-it-yourself. Today's teenage computer explorer has very different expectations about the process of learning and I don't think we're meeting them. Learning the basics of programming with Java has got to be easier.
Here are a few things I think we could do to make it easier for someone without much experience who's interested in an introduction to Java programming. I'd like to hear what other people think. The most obvious thing to do would be to provide an alternate Java download for students that came with an easy to use IDE, like
BlueJ. I don't know of other IDEs or IDE plugins that are designed for the complete novice however I'm sure they're out there.
Learning by modifying small working programs seems like a good idea and it would probably help to defer trying to explain object oriented programming until the student was comfy with variables and expressions
and so on - just within the main() method. Examples that incorporate some bundled classes for graphics and animation would probably be more intriguing than variations on computing Fibonacci numbers. Finally,
trivializing deployment to the internet is an area that even professional developers could use a hand with. It would be great if the friendly IDE came with a button that uploaded whatever example the student was working on to a public internet site as an applet or a web started app. That way they could IM their friends and encourage them to try their creations and maybe convince them to experiment with building a little software of their own.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Re: Teach the Children Well
In my experience, learning Java can be just as frustrating for developers with lots of experience in other languages.
I have a friend Charlie who has experience with VB, PHP, and C++. He picked up the Java language real quick, but as we developed an application together, he got pretty frustrated with some of Java's shortcomings:
"There's no always on top?"
"You can't drag from Mozilla or Nautilus to Java on Linux?"
"You can't get the coordinates of the mouse cursor on the screen?"
We wanted the coordinates of the mouse cursor on the screen to position a JFrame when the user dragged a certain region of the window. We tried using SwingUtilities.translatePoint with the client coordinates given in the mouse event, but it didn't work. On Windows and Linux, when you tried to drag the window, it would jiggle around the cursor. On OSX, it worked fine. We spent two days working on this problem, and we were sure the code was right (after all, it did what it should've on OSX), and then we gave up. We might start again when 1.5 beta comes out using the new MouseInfo class.
I was working on another project with another friend, Sam. Sam has experience with many different languages, and some experience with Java. I was helping him write an SSL-based chat system, which was eventually going to evolve into a file-sharing system. He wanted to use NIO, so I helped him understand how to use channels and selectors and whatnot. He implemented the chat server and client using plain (non-SSL) NIO sockets first, planning to add SSL later. He then tried to add the SSL stuff to it, and was getting weird problems. After a lot of web searching and attempts at adding the SSL stuff, we read that it was impossible to use SSL with NIO sockets. We then gave up on the project.
Sam later tried to make a sticky notes application. It showed a little tab on the side of your screen, and you could click and drag from that tab out onto your desktop to create a new sticky note. First he was angry that Java didn't have "always on top," but he worked on it anyway. He got the basic dragging and creating a new note window with a textbox in it working on Windows XP, and sent it over here on Linux. Over here, the little "undecorated" 5x20 tab was not only in the center of my screen (instead of on the right hand side like on Windows), but it had a taskbar icon as well. Dragging out from it did nothing. If it wasn't going to work on all platforms, Sam wasn't going to write it, so he ditched that project as well.
On a related note, I'm working on an art project in Java that renders some video and audio based on user interaction. On Windows it looks fine, but on Linux there's about a half-second delay between when the audio is generated and when I hear it. I think Java's inadequacies can be frustrating even for experienced developers.
Also, you might want to tell your son about Random.nextInt(int).
I taught a group of kids Java last summer, and they didn't have much of a problem. I taught with IntelliJ IDEA, which dealt with stuff like imports and creating classes and compiling/running automatically.
Posted by: keithkml on November 03, 2003 at 10:34 AM
-
Why not MAKE it easy?
When you install J2SDK why can't the installer ask:
"Do you need help to get started?".
If the developer answers yes, a simple wizard appears, asking questions like:
1) Where on the hard disk would you like to put the installation files?
* the default place (C:\Program Files\j2SDK\)
* specify :
2) Do you want to associate java source files with an editor so that you can double click them?
* Yes (this one: )
* No thanks
3) Do you want to set up a simple test project and get some simple instructions how to compile and run it?
* Yes
* No, I do it myself.
4) How should we keep your java developer environment up-to-date?
* Inform me of new releases [settings...]
* I'll check my self
5) Should I add some shortcuts to good programming site to your internet browser?
* Yes, and keep the up-to-date
* Yes
* No
etc...
People of today are more intolerant and impatient when they do something, it should just work, or they lose interest. Microsoft is good at this unfortunately.
This wizard need not to be state of the art, it can be done in a few days. And I believe it would get many more "hooked" on Java developing.
IMHO,
Mikael
Posted by: mgrev on November 03, 2003 at 10:40 AM
-
Re: Teach the Children Well
Ok, the SSL/NIO incompatibility is a bug that needs to be fixed. There's no reason that the two should in any way be related at all. One involves encryption at the socket layer, the other involves what one actually does with the streams once decrypted.
Personally, I consider "always on top" to be rather rude of applications, so I don't mind Java not having it.
The Linux sound delay isn't java's fault. ESD does that to a number of other apps including RealPlayer, and even xmms. Trouble is, Linux never built mixing into the sound system, which is why ESD was written in the first place.
The faults involved are faults in the libraries, not the language itself. Personally, coming from Java for the last 7 years, I have extreme problems dealing with Microsoft C++ (in spite of having worked with C++ for 5 years before that), mostly because of how difficult some basic things like threading and networking sockets are. There's nothing simple or intuitive. C# and the .NET libraries fix some of that, but there are so few examples because most people writing C# articles/books are coming from a MS C++ background and don't even know about all the features C#'s libraries have going for it.
Posted by: acroyear on November 04, 2003 at 06:54 AM
-
Re: Teach the Children Well
First of all, I'm not using ESD. But more importantly, if other applications' sound isn't delayed, why is Java's?
Posted by: keithkml on November 04, 2003 at 10:26 AM
-
Why not java.net?
An IDE geared toward teaching Java is probably appropriate here.
http://www.bluej.org/
The real solution would be for java.net to step up to the plate and provide a simple web-based IDE.
A web-based IDE could make all of the problems the article talks about go away. I could write such a thing pretty quickly, but alas I lack Sun's servers and bandwidth.
This is a bare starting point for the concept.
http://www.chami.com/webide/
Isavix used to have such a beast for server side applications. Sadly, they abandoned it. If Sun is serious about increasing the developer pool, they should integrate some targeted web-based IDEs into java.net.
http://isavix.net/index.jsp
I say this often.
https://java-net.dev.java.net/servlets/ProjectForumMessageView?forumID=93&messageID=282
Lastly, I have long since found that changing your PATH or CLASSPATH for Java globally is the way to madness. Writing small scripts and .bat files is a much better approach. This allows multiple JREs, JDKs and applications to live in harmony on a single machine.
Those scripts are a pain to write and maintain, which points to Java's pitiful lack of a standardized launcher.
Posted by: coxcu on November 04, 2003 at 11:04 AM
-
Re: Teach the Children Well
Re: Teach the Children Well
Re: Teach the children well
Last year I taught an 8th grade elective on Programming using Java. In order to capture their attention I wanted to get them writing simple programs as quickly as possible.
I immediately found that the existing Java IDEs were too complex and "dry" for the students. I set to work writing a quick & dirty environment that they could use. It was patterned after Logo in that it used Turtle Graphics, however the programming language was.
The IDE was dubbed Jurtle (Java + Turtle) and was a great hit. After the class I decided to productize it so I have spend the last 8 months making it production quality and writing a series of lessons to introduce the novice to Java. It also comes with many examples of drawing on the screen with and without Turtles.
Jurtle 1.0 was just released this week. You can learn more about it at
Posted by: btschumy on November 05, 2003 at 07:45 AM
-
Re: Teach the Children WellRe: Teach the Children WellRe: Teach the children well
I had a similar experience with 8th graders (boy did I gain respect for my full-time-teacher wife) and I found that robocode (from IBM's alpha dev) was just the ticket. For those who haven't experienced it, it's a "battle-bot" type game where you customize your robot's behavior by overriding event handlers. This gave the kids incentive and immediate feedback, making the initial learning curve of the language syntax much more bearable. I didn't make it to the "write a standalone application" point, but I had laid the groundwork.
Posted by: johnreynolds on November 05, 2003 at 10:43 AM
-
Why not java.net?
I don't understand the appeal of a web-based IDE. I'd much rather edit my source code in an IDE or test editor than a tiny text-box on a web page. Surely I must be missing something.
I agree that launching is a problem. The "standard-launcher" for a Java application is probably the double-clickable JAR. But creating the Manifest entries is no less horrendous than editting script files. And to the user, it's not intuitive to that you should double click a jar.
A theme that is echoed on the recently GUI-blogs is that Java has become a language for developers, by developers.
Posted by: jimothy on November 05, 2003 at 11:25 AM
-
handy tools to try
As taken from steltenpower.com/techy.html:
- Practical programming tools:
Inca X (Jini IDE),
Vamp(Application WebPublisher),
Omniscient Debugger, Apache's Maven and Gump
Posted by: steltenpower on November 05, 2003 at 04:53 PM
-
Re: Teach the Children Well
I've seen this on Linux on my own machine. It isn't just Java, several games also do it, such as Quakeforge and Quake3. The solution in my case was to stop using the Monster Sound MX400 sound card whose drivers were apparently broken, and started using my crappy on-board VIA sound card, which worked no trouble.
My issue was of course present using both OSS and ALSA. The previous commenter is probably also assuming OSS when he talks about the mixing issues on Linux, ALSA of course handles multiple outputs to a single sound card quite well, neither ESD nor ARTSD really being required these days with a half-decent sound card and drivers.
Posted by: trejkaz on February 08, 2004 at 04:18 PM
-
Hello,
I hope you dont mind me using your article as reference in my MSc thesis for my final project. I am doing a Web-based IDE for Java.
Thank you.
Posted by: kpetrianakis on September 06, 2007 at 03:41 AM
-
wow power leveling
wow powerleveling
wow power leveling
wow gold
wow items
feelingame.com
wow tips
Most Valuable WOW Power Leveling Service
wow power leveling faq
cheap wow power leveling
wow power leveling
wow powerleveling
wow power lvl
Posted by: wowleveling3 on December 13, 2007 at 07:07 PM
-
网络营销软件
网络营销软件
网络营销软件
群发软件
群发软件
---
群发软件
网络营销软件
论坛群发软件
网站排名软件
群发软件
推广小助手破解版
论坛群发软件
网站排名软件
群发软件
推荐给你很好的群发软件和信息群发软件和供求群发软件
推荐给你很好的群发软件和信息群发软件和供求群发软件博客群发软件网络营销软件网络营销软件
网站排名软件网站排名软件网站优化软件信息群发软件信息群发软件信息群发软件论坛群发软件网站推广软件网站推广软件博客群发软件博客群发软件
群发软件群发软件博客群发软件论坛群发软件网络营销软件论坛群发软件
信息群发软件推广软件网站推广软件网络营销软件网站推广软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件群发软件网站排名软件网站推广软件博客群发软件论坛群发软件
网站排名软件
博客群发软件
网站排名软件
网站推广软件
群发软件信息群发软件
免费论坛群发软件
论坛群发软件
网站排名软件
免费博客群发软件
网站推广软件
群发软件
博客群发软件
网站排名软件
网站推广软件
群发软件信息群发软件
免费论坛群发软件
论坛群发软件
网站排名软件
免费博客群发软件
博客群发软件
信息群发软件
论坛群发软件
信息群发软件
博客群发软件
qq群发软件
邮件群发软件
博客群建软件
企业名录搜索软件
信息群发软件
邮件群发软件
论坛群发软件
博客群发软件
网站推广软件
网络营销软件
全能营销破解版
网络营销软件
论坛群发软件
论坛群发软件
论坛群发软件
网络营销软件
信息群发软件
信息群发软件
信息群发软件
群发软件
论坛群发软件
网络营销软件
网络营销软件
网络营销软件
群发软件
群发软件
---网络营销软件
网站推广软件
Posted by: info0089099 on December 25, 2007 at 04:29 PM
|