Skip to main content

Harder Than You Think

Posted by editor on August 27, 2007 at 7:26 AM PDT


Loading a program into your own memory

Interrupted too much to make progress on your code? I mean real progress, not the kind where you clear a P4/S4 bug by changing some link text or a background color. I mean the kind where to set things right, you have to be willing to take apart large sections of your code, change interfaces and break contracts, make the whole thing uncompilable (you might want to do this in your own local copy and not commit until it compiles again), and rewrite the sloppy stuff that you half-assed the first time, thereby eliminating all the lurking dangers that depend on it. This is the kind of thing where you need hours on end of uninterrupted focus and clarity, so you can keep in mind a vision of what you're trying to accomplish, as well as the details of everything you're having to muck with to get that all right.

OK, seriously, who has that kind of time? Hand me another cosmetic bug, Earl, the engine's gonna have to stay broken.

Paul Graham's latest essay is on the value of Holding a Program in One's Head and it's an interesting read, though you may have to hold your nose every now and then to work through the usual Paul Graham-isms sprinkled throughout (he doesn't bash Java directly this time, though he has a dubious claim that you need to use "succinct languages", such that lines of code are always inversely proportional to language goodness in Graham-land). Anyways, the key to his argument is that you have to fully immerse yourself in a program and a problem domain to really get anywhere with it, and that takes time and focus:

It's not easy to get a program into your head. If you leave a project for a few months, it can take days to really understand it again when you return to it. Even when you're actively working on a program it can take half an hour to load into your head when you start work each day. And that's in the best case.

From this, he infers that office situations are generally antithetical to achieving the necessary focus, given their high level of interruption, seemingly by design. In fact, he asserts that the random interruption may not be as bad as the regular interruption, like the useless meeting coming up at 12:30:

Oddly enough, scheduled distractions may be worse than unscheduled ones. If you know you have a meeting in an hour, you don't even start working on something hard.

Now, here's a thought... do you really think Graham's argument is true in all cases? I was talking with Substance creator and java.net weblogger Kirill Grouchnikov in the java.net booth at JavaOne, and I asked him how it was that he could keep cranking out new releases of Substance all the time, putting in significant new functionality on a regular basis. He said his approach was to always take an hour a day to hack on it. This is counter to Graham, obviously, who says you need a half-hour just to load your program into your own memory. But Kirill's approach has a huge advantage in consistency and familiarity: rather than trying to clear out huge blocks of time to work on your project, the frequent-but-short approach means it'll never go out of your memory, because you'll never go more than 23 hours without working on it.

Deep dives or frequent jams? Which works for you?


In Java Today,

Sailfin, the (SIPServlet) communication application server based on GlassFish and Ericsson's contribution, has hit Milestone 1 (56Mb). This is built on top of GlassFish v2 and offers the following features: Grizzly integration in SIP container, Administration Backend, CLI, deployment, web container, load-balancing proxy. Milestone 2 is expected in October.

Thanks to all who participated in last week's Ask The Experts on Mobile Services Architecture (MSA). Questions and answers for this event are now available to view online. For more information about MSA and other ME-related projects, keep checking the Mobile & Embedded Community page, and the M&E forums for announcements of future Ask The Experts events.

Issue 135 of the JavaTools Community Newsletter is out, with tool news from around the web, an editorial on "why your new project hasn't been approved yet", announcements of new tools that have joined the community, and a Tool Tip on investigating the working copy status using Subversion.


Bhakti Mehta has some guidance for Resolving Non RM Request or Missing wsa:Action header error in today's Weblogs. "We have been getting bug reports where users run into the following error when interoperating with MS "Non RM Request or Missing wsa:Action header". This is how you workaround this issue"

In
mercurial: Transplanting changes from one repository to another, Kohsuke Kawaguchi reports,
"I played with mercurial a bit and figured out how to transplant changes from one repository to another repository without sharing the common changesets."

Finally, Arun Gupta has a detailed guide for
PHP in GlassFish using Caucho Quercus.
"Quercus is Caucho Technology's 100% Java implementation of PHP 5. Ludo described the steps to deploy PHP web applications on GlassFish. Caucho has released a new version of Quercus since then. This blog entry is an update to the steps described earlier."


This week's Spotlight is on Project Woodstock, whose participants are developing the next generation of User Interface Components for the web, based on Java Server Faces and AJAX. The project's preview page shows off a number of Woodstock's available components, including complex widgets such as Bubble Help, Calendar, a File Chooser and Uploader, Progress Bar, and more. The latest build instituted a feature freeze, and the roadmap shows the route these components will take to inclusion in NetBeans 6.


In today's Forums,
bjoern_minkmar has some practical advice for developing Blu-Ray Java applications in the thread
Re: Verify a BD-J authoring.
"Let's assume you just want to write a real simple application, that you can mux real quick and verify in the sonic emulator, then you should take a look at the example from Sonics "Blu-ray Tutorial 1B (Hello World)". Please be aware that testing Xlets with xletview doesn't require any videomaterial, whereas the Sonic emulator needs a background-video to start the Xlet. Otherwise the screen will stay black and nothing will happen. In case you have used one of the examples from the Sonic Tutorials (and your source code contains a BDLocator, MediaLocator and a Player object amongst other objects), then you should take a second look at the values you have entered when creating the BDJO file."

cossie is a
MSc student looking for some advice.
"I'm trying to come up with some good ideas for my thesis proposal. I've been doing a lot of hobbyist j2me programming (both games and apps) since my undergraduate degree (Software Engineering) a few years ago. I really enjoy mobile device and embedded development. I'm doing an A.I. course and I'm trying think of a good application of some adaptive or evolutionary techniques that would be useful in furthering the use of Java ME particularly in areas like ubiquitous computing and assistive technologies. I'm not looking for anyone to give me a straight up idea (i.e. I'm not looking to steal anyone's idea or anything like that) but I'd appreciate any tips or suggestions for areas to look into."

Finally, in
Re: [JAVA2D] How to keep the rasterizer at bay when printing, Olivier Lefevre writes,
"Just a quick update on this: painting using the print method to a streaming Graphics2D object that writes SVG/PostScript/PDF/whatever to file will give the "correct" results, i.e., not a bitmap, provided print is used correctly (i.e., printComponent and printBorder in the widget tree may need to be overridden and customized). However to get "correct" results when actually printing to a printer you do have to set the sun.java2d.print.pipeline property to pdl. Thus I think it might be useful to bring that property out in the open, so to speak, and stop regarding it as a private testing back-end."


Current and upcoming Java
Events
:

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e">events submission form.
All submissions go through an editorial review before being posted to the
site.


Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.

Loading a program into your own memory