Archive for Programming

Fullscreen editing

I find myself doing more and more coding in (some kind of) fullscreen mode. One reason is the omnipresence of 16:10 or 16:9 screens, and that most applications are still pretty wasteful with vertical space (think Thunderbird). Title bar, menu bar, tool bar, tab bar, status bar, window panel, whoops, an estimated 10-15% less space for coding. This is especially painful on smaller notebook and netbook screens. I also like to avoid distractions, I don’t really need to look at the clock, check the battery, or read incoming mail subjects while doing something else.

Before window-based systems became mainstream on home computers in the mid 90s, fullscreen editing was the norm. Poor DOS users couldn’t even run more than one program at a time. Window managers and higher resolutions lead to much more sophisticated coding environments, increasing both usability and visual clutter.

A few years back, tiling window managers appeared. They no longer manage applications in arbitrarily sized and positioned windows, but instead use tiles on the desktop for a semi-automatic layout process. Some of the ideas trickled down to traditional window managers as well: Windows 7 lets users expand windows to either half of the desktop, Compiz Grid and Ubuntu’s Unity achieve a similar effect on Linux. Personally I like these less extreme approaches, given enough screen estate windows are just inherently accessible and no tiling algorithm will work for all applications.

Some of my fullscreen candidates are (or were):

  • Firefox/Chrome: F11 to toggle between fullscreen and windowed mode. Unfortunately, there are slight issues in both browsers (there is no feedback whether a new page is loading, the URL bars can be a bit quirky).
  • Netbeans IDE: View –> Full Screen (don’t press the default short cut on linux). Also reduces the clutter of the already very clean Netbeans layout by removing the toolbar.
  • IntelliJ IDEA: unfortunately the full screen mode was kicked out of IDEA 10, at least on Linux. You can remove the toolbar, status bar, and the docked windows panels, leaving you with a menu and the editor window.
  • vim: there’s a native plugin, gvimfullscreen_win32, for Windows that basically works but struggles when the window layout changes. For Linux I just use (grid-) maximized console windows.
  • Gnome Terminal: F11 toggles between fullscreen and windowed mode, too.
The main problem I keep running into is that current desktops don’t tend to work well with fullscreen applications at all (perhaps unavoidably so). As long as I have one monitor for each program I work with at a time this is not an issue, but even one additional program breaks usability, leaving the alt-tabbing user in agony. Recently I started using Ubuntu’s Unity at work, and (for all its flaws) I like the basic ideas – thinking in applications (versus application windows), encouraging keyboard navigation, optimizing desktop space usage (combined menu/title bars in a global menu). But sometimes having just one application on the screen, one thing to concentrate on, helps so much that I wonder if the classic desktop metaphor can actually be fixed.

Comments (1)

Planes, Textures, and Soft Shadows

My toy raytracer written in Scala got a few new features:

  • Planes
  • Textures
  • “Soft Shadows” (distributed raytracing)
  • Supersampling Anti-Aliasing

Textures don’t add much to the computation time, but distributed raytracing is a real performance killer (at least when implemented naively, as in my version). Essentially, when determining the surface color at a given point, instead of sending just one ray to a lightsource to see if it’s obstructed by any other object, many rays (typically at least 25) are sent out to an area that describes the light source (e.g. a box). The return values (black if the ray was obstructed, the light source color otherwise) are then averaged, leading to smooth transitions at the edges. And it does look nice… combined with supersampling (anti-aliasing) it now becomes easy to spend hours rendering a single image at, say, 1024×768 pixels.

Pool Scene

Next idea: writing a parser combinator for (a subset of) POV-Ray’s Scene Description Language (SDL) to skip the painful step of modeling scenes in compiled code. This will also enable me to do some Scala coding again, since adding new features to the raytracer itself usually means spending much more time wrapping your head around math stuff than actually writing code.

Leave a Comment

Everything Is A Sphere

When I was down with a cold last week I dug out a book about computer graphics that I bought during my university time (3D Computer Graphics by Alan Watt). It provides a mathematical foundation for many core techniques in CG, and it got me interested again. About 8 years ago when I bought this book I wrote a small raytracer in C++, and since I am really in search for new hobbyist projects to teach myself Scala, I figured I could give it another shot.

Scala is a statically typed functional/object oriented language for the JVM and the CLR, and at least on the JVM it is known for providing performance similar to Java (in contrast to dynamic JVM languages such as Groovy or JRuby). This is the first scene that provides something my 8-year-old project couldn’t, namely a checkered surface (composed of two other surface instances). The code is pretty newbie-like and a bit unstructured, so for now I’ll leave it at that. FWIW, it took about 5 seconds to render this picture on my rather mundane home machine (Athlon X2 @ 2.2GHZ, Windows XP) using the 1.6.0_11 server JVM.

A World of Spheres

Leave a Comment

Book Recommendation: Beautiful Code

I’m not even halfway through yet, but O’Reilly’s Beautiful Code really is a great book on the arts of programming. It contains about 30 essays by top-notch programmers, including veterans like Brian Kernighan or Charles Petzold, on what they consider beautiful code or programming concepts. The chapters vary greatly in difficulty, including both (rather) easy-to-understand concepts like a regexp matcher in 20 lines that show why simplicity is often a win and very specialized contributions like an image filter in Microsoft’s Intermediate Language. I think this is a book best read not cover-to-cover, instead just pick the most interesting chapters for you and see how elegant code can be.

One thing that also comes to mind reading this book is how short-lived many of the contributions were. Once-glorious hacks like Windows’ bitblt() implementation do not have much relevance in today’s world, where Google’s Map-Reduce provides the foundation of an enormous technological success story.

Leave a Comment