Tuesday, September 06, 2016

Time Machine eating its own tail on a FreeNAS ZFS share

I work on a Mac and the OSX Time Machine is a very nice and simple feature to have backups.

While I have some other Apple gear I didn't get an Airport Time Capsule because I already had a tiny Airport Express, the Time Capsule is pricy and I'm not certain it does RAID.

So, what I use instead is the FreeBSD-based FreeNAS on an N54L MicroServer. FreeNAS allows you to easily create a Time Machine Apple Share and it works seamlessly.

The nice thing here is that the FreeNAS share is stored on a ZFS disk! And I have periodic snapshots for those shares.

So, on one side you have Time Machine storing periodic snapshots and only deleting when it needs space.

And on the other side you have the ZFS snapshots that guarantee that nothing is truly deleted!

This proves to be an interesting combination because Time Machine does not expect such a situation when you are low on disk space.

When you are low on disk space OSX's Time Machine will try to remove some data to free some space. But if you have recent snapshots on your ZFS filesystem, deleting files will not create any free space!

So Time Machine will keep on going back in history and delete more and more in order to have enough space to do a backup. I'm pretty sure eventualy it will try to delete the whole history.

Once Time Machine goes free space berserk you have to stop it and fix the problem on the ZFS side.

Either you delete some snapshots, you increase the filesystem quota or move it to a larger array.

In order to prevent the damage Time Machine did, you have to use zfs rollback to go back to a good snapshot. And in order to find a good snapshot it might be worth using zfs diff too.

The Oracle documentation for ZFS Solaris is good enough for this although you might also want to look at the FreeNAS User Guide for your version.

Time Machine doesn't seem to be bothered by a rollback and will gladly continue using the same share and finish the backup!

All in all I believe it's a pretty good combination. In an alternate universe OSX and Time Machine knows ZFS natively but until then FreeNAS gets the job done.

Tuesday, August 23, 2016

Signing NetBeans modules with a Time Stamping Authority (TSA)

Signing JAR files is a very good practice. And while a proper certificate is not worth the price and effort, self-signing is still a step in the right direction.

Ever since Java 5 jarsigner supported a Time Stamping Authority (TSA) with the --tsa and --tsacert parameters. A Time Stamping Authority is basically an online digital notary that certifies the point in time the jar was signed -- it is designed to prevent signing files after the certificate expired.

It turns out that while you can sign NetBeans modules using the FAQ steps, there is no support in the build harness for a TSA.

I found bug #243213 which also mentions NBM problems and I submitted a patch there.

So, if you want to also add a timestamp to your NBMs, apply this small patch on top of your NetBeans source repository and rebuild NetBeans.

Then, you just have to define in nbproject/project.properties another key with your TSA (I'm using StartSSL's here):

tsaurl=http://tsa.startssl.com/rfc3161


Wednesday, August 03, 2016

Forcing export of internal API in Java 9 with -XaddExports

I've long been a fan of NetBeans' module system and of OSGi so Java 9's modules are a big improvement to me.

Except modules are really good at enforcing API boundaries and stop allowing one to freely use any public class.

An error such as this is no fun:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.IllegalAccessError: superclass access check failed: class A$1 (in unnamed module @0x3fb6a447) cannot access class jdk.nashorn.internal.ir.visitor.NodeVisitor (in module jdk.scripting.nashorn) because module jdk.scripting.nashorn does not export jdk.nashorn.internal.ir.visitor to unnamed module @0x3fb6a447

I've assumed that this has to be tweaked at SecurityManager level and played with -Djava.security.manager and -Djava.security.policy and the very handy -Djava.security.debug.

Alas, that doesn't help. (Although I'm still convinced it should, unless there is a bug somewhere).

What one needs to use is the magical -XaddExports flag. This forces an export and allows the code to run:

java -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.ir.visitor=ALL-UNNAMED A


Wednesday, July 06, 2016

String.trim is an optimization hack

Turns out java.lang.String.trim() has its own unique definition of "whitespace" in order to be able to reuse the same underlying char array.

This blog post from 2008 talks in a lot of detail: https://closingbraces.net/2008/11/11/javastringtrim/

Monday, April 04, 2016

BSD on Raspberry Pi 2

Raspberry Pi 2 is the version that finally seems a good purchase to me with its quad core processor and 1GB of memory. If you need WiFi, Pi 3 is even better since an external WiFi dongle consumes more power.

But I would prefer to use an official release of a known operating system instead of using custom forks like Raspbian.

FreeBSD provides an official image, but to them ARM is a tier 2 platform "not supported by the security officer and release engineering teams". So, no freebsd-update. The existing image is for CURRENT ie. bleeding edge. RELEASE would be nice.

OpenBSD has no plans to support it.

The winner is NetBSD: they have an official image since NetBSD 7!

So now NetBSD and this little Pi 2 will replace a much bigger and nosier machine for a dedicated task. I'm curious how it holds up!

Sunday, June 09, 2013

NetBeans - PalmOfMyHand - Dance Demo

I like making NetBeans dance:

NetBeans - PalmOfMyHand - Dance Demo from Emilian Bold on Vimeo.

The above video is a little something I've obsessed about this weekend. It all started from a song actually: Swedish House Mafia - One (Your Name). But I couldn't publish a video with that as a soundtrack so I've used this little Creative Commons gem instead.

It's basically a NetBeans module that plays an mp3 and syncs everything else to the beat.

There are a lot of NetBeans Platform and NetBeans IDE APIs touched in this simple demo. See if you can make a full list: Progress API, StatusLineElementProvider, Editor API, etc.

If people are curious I might write more about this. Turns out on Java one of the harder things is mp3 playback.

Tuesday, November 06, 2012

nbnotify.com is back up


I forgot to publish this, but it's been a month since I uploaded a new version of nbnotify.com, the OSX notification plugin.

Based on Bootstrap, this new site is as simple as it gets: all static, a stark contract to the old PHP Wordpress.

I brought the old site down in August because the Wordpress I had there was too insecure.

Right now this plugin is looking a bit old. After all, it needs the original Growl, not the new commercial Growl. Also, OSX Mountain Lion has its own notification API which I do not support yet.

Friday, June 29, 2012

Everything takes time

I read somewhere that as you get older you don't necessarily get slower, you just trade speed for quality. This sounds about right.

Here is my time with an UI regression in the new version of a large Swing app:

I start investigating the problem manually and look at the code to see what might be the cause.

I find a quick way to duplicate it.

I deduce from the code what might be the cause but I'm wrong, it could be that, but it isn't, because there is extra code to check for that condition.

I start probing with a BTrace script to see the Swing events.

I finally find the actual cause and I'm stupefied - it's a failure of an underlying system and not of the UI.

I make an unit test that fails for the regression. I also find a possible fix.

Since I'm a bit surprised by how that system worked, I go and check the problem in the previous version of the Swing app. The problem is not there! It is a regression indeed.

Now I'm really surprised - what changed?

I start debugging the unit test on the old version in order to figure out what behavior changed and I finally figure it out when I look at the diff between the versions.

This diff gives me a 2nd way to fix the code. I patch the new code but it fails subtly in another way -- it wasn't changed for nothing, after all.

I decide that the initial fix is the right one and I apply it.

I am finally done!

At this point my fix was a few lines of code and a large unit test.

But besides this I have various byproducts: the BTrace script, the 2nd fix that didn't work as well as my notes file with my remarks, various stacktraces from the BTrace script and the debugger and errors.

Investigating, writing little scripts, running in various configurations and on top of various versions then finally checking the final fix and wrapping up took a lot of time.

Thursday, June 28, 2012

A Swing window is just as transparent as a web page

I'm a fan of the web and I admire how powerful the browser has become. Since I'm almost always in a browser (even to type this blog) I would certainly love to see even more useful apps, like, perhaps, an online IDE. So, although I work with desktop apps I like this cloud and web app kool-aid a whole lot.

One of the advantages I see in web apps is how transparent they are. It's all text, with code in an easy scriptable language. It's easy to inspect and change. Easy to deploy.

But I don't work with web apps. I work with large desktop Swing applications, usually on top of the NetBeans Platform.

I routinely debug these Swing apps with the debugger, VisualVM, BTrace and simple apps or unit-tests that reproduce the issue.

And it occurred to me after a debugging session to me that Swing apps are quite transparent too! The fact that Java code is compiled is just a decoy. As a developer you have access to the source code anyhow but, even as an user, you have about the same freedoms as you have with a web app.

Just as I could look into the DOM hierarchy in the browser, I have the Swing hierarchy of components.

Just as I could add my own Javascript event handlers, I have Swing listeners.

Although existing code is compiled, I could make a small BTrace script to see its execution and inspect parameters and values.

Without having to recompile, I can easily use reflection to look into private data and even tweak it.

So, although Swing would seem pure binary, there is nothing you don't have access to. It's an open book!

Monday, May 14, 2012

Our own NetBeans Summer of Code

My company is having a Summer of Code for students.

We suggested a list of project that might interest students and we are offering them a paid summer internship to complete their favorite pick.

Since most of what we do touches NetBeans or the NetBeans Platform in some way, a big part of the list is a valid suggestion for the community too.

So, today, we are opening the projects for NetBeans community members too!

Let's see, excluding the items that don't apply, the list has:

#1. Swing based Git Repository Browser

We want this as a standalone app, but it could also be used to enhance NetBeans.

#2. UnQL interpreter

An ANTLR-based parser is needed and a simple UnQL interpreter. This could easily be integrated into NetBeans to provide syntax highlight and perhaps even completion. The interpreter might be just a simple executor or something that visually explores the database.

#5 NetBeans Linux notifications

Just as NBnotify.com displays OSX notifications using native calls, we need something for Ubuntu and Chrome(OS). People seem to want to be notified about long builds and other IDE events and we should provide this natively on more OSes.

#8. Dynamically compiled NetBeans

This is my favorite idea: how about distributing NetBeans only as source code? With some binary bootstrap and a smarter module system I think we could actually have an usable system that compiles everything on demand. Plus -- imagine getting updates as simple text patch files!

If any of these interest you, please contact us! Or email me, tweet me, I'm easy to find.

For a Romanian student we could arrange an internship.

For a NetBeans community member we could provide the resources, mentoring and swag.

Saturday, March 03, 2012

Apple, job creation and the App economy

The Apple job creation page is pure PR: they claim to have "created" or "supported" over 500.000 jobs.

It sounds like the kind of thing a politician would say. Because they even add transportation, health care and "the app economy"!

It's kind of like you claiming to be a job creator because you buy local and burn electricity.

Anyhow, what's interesting is that the App economy is estimated at 210,000 US jobs and Apple has paid over $4 billion to App developers world-wide, ever!

Assuming those $4 billion were all to US app developers in a single year, that ends up to about $19.000 / job in total or about $1600 / month / US developer if that amount is split over 12 months.

What this shows is quite interesting: the App economy isn't self-sustaining.

If the 210,000 US jobs are real then App Store sellers are burning cash.

Considering the money sellers make must follow some sort of distribution then most of those "app economy" jobs aren't even making minimum wage in profit.

Now, one might say: "yes, but those App creators are making money some other way -- perhaps they are giving the apps for free". I disagree. There are few brands that afford to have developers doing apps just so they make money in another way.

If you think about it Apple wants their 30% on every sale you make through the app. That's why the Kindle app removed their Amazon store button.

So it must only be that most of these "jobs" will go away once they realize there is no profit to be made. Or that most of these jobs don't exist to begin with and are nothing more than hobbyists coding after their real job.

It might be just a coincidence, but my company just dropped out of the iOS Developer Program. We were too busy with out other Java-based projects and iOS demand seemed to have leveled anyhow so it made no sense to keep paying those $99/year.

It might just be the start of a trend.

Friday, March 02, 2012

Intellij needs to introduce the Lookup API

I'm looking today at the toolbar classes from IntelliJ IDEA and I'm surprised by the amount of instanceof I see.

For example, NavBarPresentation.getIcon looks like this:

public static Icon getIcon(final Object object, final boolean open) {
    if (!NavBarModel.isValid(object)) return null;
    if (object instanceof Project) return PROJECT_ICON;
    if (object instanceof Module) return ModuleType.get(((Module)object)).getNodeIcon(false);
    try {
      if (object instanceof PsiElement) {
        Icon icon = ApplicationManager.getApplication().runReadAction(new Computable() {
          public Icon compute() {
            return ((PsiElement)object).isValid() ? ((PsiElement)object)
              .getIcon(open ? Iconable.ICON_FLAG_OPEN : Iconable.ICON_FLAG_CLOSED) : null;
          }
        });
        
        if (icon != null && (icon.getIconHeight() > 16 || icon.getIconWidth() > 16)) {
          icon = IconUtil.cropIcon(icon, 16, 16);
        }
        return icon;
      }
    }
    catch (IndexNotReadyException e) {
      return null;
    }
    if (object instanceof JdkOrderEntry) return ((JdkOrderEntry)object).getJdk().getSdkType().getIcon();
    if (object instanceof LibraryOrderEntry) return IconLoader.getIcon("/nodes/ppLibClosed.png");
    if (object instanceof ModuleOrderEntry) return ModuleType.get(((ModuleOrderEntry)object).getModule()).getNodeIcon(false);
    return null;
  }

That's just horrendous!

What they need to do is introduce a mechanism similar to the Lookup API from NetBeans.

Then, if object is a Lookup.Provider, just call getLookup().lookup(Icon.class).

The above method becomes

public static Icon getIcon(final Object object, final boolean open) {
    if (!NavBarModel.isValid(object)) return null;
    if (!(object instanceof Lookup.Provider)) return null;
    Lookup lookup = ((Lookup.Provider)object).getLookup();
    return lookup.lookup(Icon.class);
  }

and each of the individual classes (Project, Module, PsiElement, JdkOrderEntry, LibraryOrderEntry, ModuleOrderEntry) will have to add into their lookup the given Icon.

As it is right now, the existing code has a lot of imports. What looks like a little Swing module (com.intellij.ide.navigationToolbar) imports hundreds of classes from all over the place and seems to be a pain to read and maintain.

Truth be told, the code is from 2008 -- perhaps the newer stuff already has a similar mechanism.

PS: While I am a NetBeans guy, I'm not trying to start a flamewar. I actually want to see if I can reuse navigationToolbar but all these imports are making it really difficult.

Tuesday, February 21, 2012

Magic is just programming without knowledge

There is nothing more cringe-inducing than seeing somebody try to program something without actually knowing what's going on. With some exceptions, programming allows you to know precisely what's going on. Not knowing how something works should trigger some alarm bells.

Magic might be an ancient form of "programming" nature where most of knowledge has actually been lost. Without factual information, only rituals were kept and some basic notions.

I wouldn't be surprised if in 1000 years or so we have a high-priest class of programmers that need to take care of computerized systems so old they forgot the logic behind them. They will basically become magicians.

Wednesday, February 15, 2012

LTS means ancient?

I was surprised today to see that Ubuntu 10.04 LTS comes with Mercurial 1.4! The latest Mercurial release is 2.1

Mercurial 1.7 also introduced a repository change, the dotencode requirement. This means any repository created after November 2010 with 1.7 and dotencode will not be accessible by the Mercurial from the Ubuntu LTS. This error should be familiar:

abort: requirement 'dotencode' not supported!

One solution is to use the Mercurial PPA to get a newer release.

But, it doesn't make sense to use an LTS if you are going to use software from PPAs, no?

With sun-jdk being pruned from the repositories, I'm starting to get annoyed by Ubuntu. I'm starting more and more to manage dependencies by hand instead of relying on the system. Which, imho, means the system is broken.

Thursday, May 05, 2011

I will release an OSX-focused IDE distribution

I plan on releasing a NetBeans-based IDE distribution. Just as there are a whole bunch of Linux distributions, I believe there should be more IDE distributions.

What I intend to focus on is OSX support since, although a lot of people use NetBeans on OSX, it always looked to me like it needs more polish.

Native OSX integration is one of the reasons I wrote the NBnotify.com plugin, which shows IDE notifications via Growl. And there are other areas where NetBeans needs to pay more attention to the way it does things in order to be in tune with OSX.

I have many features in mind, but I'll leave you with just two low-level ones:

  • Drag and drop installer

    The IDE should be available as a simple dmg which users just open and then drag and drop the application wherever they feel like it. You shouldn't need administrator rights just to install the application.
  • Using proper OSX folders

    The ~/.netbeans folder will go away entirely. There are some standard places to store caches, preferences and everything else on OSX, usually in the Library folder. The IDE should be a proper citizen and store data there so that users and helper tools know what it represents, which is important and which may be discarded if disk space is becoming an issue.

Of course, one of the high-level features would be Growl notifications for IDE events.

So much for the first post talking about my IDE distribution. As I get closer to a release I might mention some of the other features.

When is it going to be released? Well, sometime this year, but in order to be certain let's say you should expect it in your Christmas stockings.

Why am I announcing it so early? Because I want to get some initial feedback about what people feel it's missing in their NetBeans IDE, either overall or specifically on OSX.

Also, this is as a way to commit myself to a release. So, feel free to bother me as we approach the release date.

Monday, March 28, 2011

The startup company hierarchy of needs

I've been focusing on different themes than usual with regard to my company and I've come to realize it might just be a mental shift on the Maslow pyramid.

We are still a tiny company (just 4 people) and our business isn't large in terms of income, but I think it's probably enough for me to trigger a shift into my thoughts.

Maslow's hierarchy of needs describes the stages in human growth and it seems to apply just as well to a company:



Physiological needs

The lowest level in the Maslow pyramid are the physiological needs. These are the basic survival needs: air, water, food, shelter and sex.

There is nothing fancy here. A company at this stage is basically aiming for that ramen profitability. Everything else are mostly nice thoughts, because the immediate future is all about corporate survival.

When I first started my company, this was the most important thing. I didn't care about anything else, except knowing that I had customers and I was profitable. Of course, personally I've been lucky to have some nice and decent customers where I worked on some interesting stuff, but from a corporate standpoint it was all about being profitable and having projects to keep me, and later my team, busy and liquid.

Safety needs

Wikipedia has a nice explanation:

These needs have to do with people's yearning for a predictable orderly world in which perceived unfairness and inconsistency are under control, the familiar frequent and the unfamiliar rare.

This is where I find myself to be since about last summer...

Ever since the financial crisis came in Romania too, the government has made a lot of unexpected and rash changes: laws changed over night, tax legislation changed, corporate expenses limited by law in weird ways.

Also, corruption was left basically unchecked, while the government still found enough time to waste money.

So, I've started yearning for some predictable legislation (fiscal, labour, etc) as well as a reduced threat of corruption.

I still haven't found a solution to this. Since changing Romania first is impractical, I've been reading a lot about incorporating into other countries.

This is a complicated equation involving corporate specific variables such as taxation, accounting expenses, rent as well as personal variables: I'd probably need to relocate or travel a whole lot more and that's hard.

Love and belonging

Love and belonging has two levels in a company: internal and external.

Internally I don't think we have a particularly strong belonging feeling since we were very focused on just getting the job done. We are distributed in 3 cities quite far away so there is no physical closeness which I think hinders us a bit.

This is something we should work at, but I guess it's not on the list yet. One of my future plans is maybe get an actual corporate office but that's a problem in itself and it would split us: 2 guys would work in an office and 2 guys 500km away.

Externally, the company sends upstream bugfixes for the open-source code we work on, we support the localization effort into Romanian of an open-source product and this year I want to get a junior researcher / student into a part-time position doing open research (it's basically a sponsorship disguised as a job since legally it's way simpler).

But, sadly, the company isn't involved at all in the local community.

Esteem

Esteem means wanting respect, status, fame and attention as well as self-respect, competence, mastery, self-confidence, independence and freedom.

So far the company is very low level and mostly "behind the scenes". We basically do contract work so the end users never know anything about our involvement.

It would be nice to be known by our users and even nicer to be independent and actually sell products to end users directly. But we are not there yet.

Self-actualization

"What a man can be, he must be." Realizing the full potential.

I'm not even sure what to speculate here. I believe we have something interesting and I'm rather proud of my team but I couldn't say exactly what the full potential is. Still searching this one.

Conclusions

Maslaw's pyramid seems to be a quite nice simplification. Of course, the layers intertwine and evolution isn't linear like that but it seems to apply quite nicely for a startup too (which isn't entirely surprising since a company is a social construct.)

It might be an interesting exercise to analyze your own startup through this hierarchy and see where do you stand as well as what you should be focusing on.

Monday, March 14, 2011

The IDE must move onto the server

Here is a video of my prototype online IDE (watch it in 720p if possible):



It's basically a subset of how I think a browser-based IDE should look like and where we should get, pretty soon.

I've just focused on some essential parts in my prototype:

  • The IDE must be accessed via a standard browser and should be installable (ie. your own startup should be able put it on a dedicated server).
  • Project/user timeline with commits, bug reports, code reviews, etc.
  • Good editor: syntactic and semantic highlighting, project-based code completion, code folding.
  • Running tests locally (a signed applet gets disk access if needed) or remote. I guess the local part is just for reassurance and, perhaps, offline fallback.
  • Some form of chat for internal communications.
  • Integrated metrics and reports from various sources (FindBugs, build server, project planning tools, etc).

The most important thing is the editor: I still don't see a good Javascript-based editor and certainly not one for Java, which is what I would need.

The next thing is the proper integration of the various external tools. You could hook the build server test results and findbugs warnings straight into editor hints or error stripe, for example.

I also think nobody is focusing on the kind of automated learning we could apply to projects once everything is in one place. Nothing says progress like a browser Clippy saying Hey, it looks like you're solving almost the same threading problem as John did on this other bug 3 months ago.

All in all, my work is just a prototype. But I do hope that in the near future I wouldn't need a workstation to do my job -- just a humble device with a decent network connection.

Tuesday, January 25, 2011

About the Hudson debacle

There are some big discussions about forking Hudson. Oracle's latest response seems to have triggered this reply from Hudson's main developer Kohsuke, now hired by CloudBees.

Personally, I don't see all that much negativity in the Oracle message. Actually, it seems very well balanced.

One thing I agree entirely: there is no such thing as a project "renaming". We are talking about a fork. Even if the Jenkins fork becomes the one with the biggest market share, it's still a fork.

This reminds me of the EGCS fork of the GCC which became so good it actually became the next 'official' GCC release. There is still a chance this might happen for Hudson/Jenkins so I don't see why Kohsuke seems so eager to burn all the bridges with Oracle.

I am also part of the "community", using Hudson since before it was so fashionable, and I don't see why should I be so enraged about all this? I guess I am too cynical not to notice that there are two companies involved: CloudBees and Oracle and only one of these two makes money almost exclusively from Hudson-based services. I think there's a natural conflict when for-profit companies make money from open-source software -- they'll always want to keep some proprietary "added value".

What I did understand is that Oracle has some fear of using non-Oracle infrastructure (github, etc) which seems to annoy some of the developers. But, other than that, I don't understand the need to fork the project.

Friday, January 21, 2011

Slow hardware means lost opportunities and developer frustration

At my first job, after a steady pace of desktop applications, I was asked to make a web application.

It was 2006 and JSP was the big game in town (ah, taglets), Struts had just become a toplevel Apache project, JSF was just starting and Spring Framework was the only same-looking thing, at some 1.x version.

Having worked with Java on the desktop, the options were Java on the server side too or learning something new (I ruled out PHP quite early).

Thus it came to choose between something that seemed very flashy, called OpenLaszlo or a servlet-based Java solution, with PostgreSQL as the database (I didn't like MySQL either).

OpenLaszlo was quite interesting because it compiled to Flash so you could create quite beautiful pages. It would have also mapped quite nicely with the application as we required some rather custom stuff. Also, the site was used by management so charts and other flashy, interactive content would have been welcome.

In the end I picked a Java servlet solution, using Spring framework and a whole lot of the solution was custom-made.

The reason ? The laptop I had back then could barely run OpenLaszlo locally!

It was some clunky Compaq with 1GB of RAM (I got 2GB at some point) so it could barely keep up with a normal XP/Eclipse/Browser/email configuration, let alone run my local database and local OpenLaszlo server.

Of course, that might also have been a blessing in disguise, because who knows how easy it would have been to actually implement everything with OpenLaszlo? But, the problem is, we'll never know.

Ever since, I consider that developers need to have access to good machines. Software development is a hard job as it is, you don't need to fight your machine too.

Sure, some low-level computer might be used for testing purposes, but expecting the programmer to use a slow machine just because that's what the users have (or because there is no budget) is the seed to a lot of lost opportunities and developer frustration.

Thursday, January 20, 2011

The 'miserable programmer paradox' isn't about technology

I've read a blog today which states that there is a miserable programmer paradox:

A good programmer will spend most of his time doing work that he hates, using tools and technologies that he also hates.

And the conclusion seems to be that it's all about the technologies that the programmer is using:

The bad technologies take big chunks of time and concentration. The good technologies take little time and concentration. The programmer has a fixed amount of time and concentration that he can give every day. He must give a bigger piece of the pie to the bad technologies, simply because they require more. In other words, he ends up spending most of his days working with tools and technologies that he hates. Therefore, the good programmer is made miserable.

This conclusion seems flawed because it assumes the programmers have no desires and preferences.

The conclusion reminded me of this interview called Edsger Dijkstra -- Discipline in Thought.

In this video, at 11:48 we have a very interesting quote:

And the programmers weren't interested [in faultless programs] because they derived their intellectual excitement from the fact that they didn't quite know what they were doing. They felt that if you knew precisely what you were doing and didn't run risks, it was a boring job.

I think this is a much better explanation for the miserable "good" programmer paradox (as defined above).

The good programmer is miserable because he doesn't get to use the shiny tools and technologies and because he feels bored by the fact there is nothing new.

But he is also good because he knows exactly what he is supposed to do.

Technologies and tools might have a part, but I think the humans in the equation are much more important to look at when searching for answers.

Findus and the Christmas Tomte

Sven Nordqvist's Pettson and Findus series is beloved for its cozy portrayal of rural Swedish life. An eccentric old farmer, his talking...