Saturday, September 26, 2009

Not for mere mortals...

I've been teaching myself the Java programming language for the past couple of weeks. It has been something of an "adventure", but I've actually rather enjoyed it.

I wanted to learn Java, specifically, because it is widely touted as being a cross-platform programming environment: something written in Java is supposed to run on a Windows box, a Linux machine, an Apple, or damn near anything else that can handle Java.

The downside of that kind of power and flexibility (TANSTAAFL!) is that doing things the Java way is appreciably different than what I've been used to. Doing math stuff in Java, for example, leaves one with a thorough grounding in touch-typing as a consequence of the refusal/inability of Java to automagically convert between types of numbers (integer, real, etc).

I've got my learn-by-doing program almost finished, and have run into what I reluctantly have to consider a major weakness: the inability to EASILY print simple, basic text to a (default) printer. By way of illustration, if I were using another programming language, I could do something relatively simple, like
printer.print "This is some text that I want to print"
to whatever the default printer was, using whatever passed for a default font and size.

In Java, however, it isn't that straightforward -- almost every cotton-picking little detail has to be declared, defined, and described... regardless of whether I'm printing a short line of text or rendering a copy of the Mona Lisa. While I don't doubt that the capabilities of printing in Java are wonderful, at this point it's SO damn flexible to me that I can't get hold of it well enough to actually do anything simple and basic with it.

Further aggravating my situation is that all of the tutorials that I've looked at have been of the starting-from-scratch, all-by-themselves variety; there doesn't seem to be anything that explains or demonstrates how to include printing basic text from within an existing program -- or, at least, not that I've been able to find/understand. If, or when, I finally get my head around how to print from within a Java application such as I've written, I may have to have a try at writing a "Java Printing for Dummies" tutorial.

In the mean time, it's various permutations of headache remedies and alcoholic beverages for me...

No comments: