I hate it when I find myself Java bashing. It’s just a language, it has its uses. But I pretty much did a Julia Louis-Dreyfus when I read this reddit post….

Operator overloading? You might abuse it… chop. Multiple inheritance? You might abuse it… chop. Creating a new object? You’d best type the type of the object three or four times before we’ll believe that you got it right. You want access to internals, subclass the compiler objects, closures, iterators, lazy evaluation, the list goes on chop chop chop
It’s often hard to point to a language’s philosophy because it is embodied in a long sequence of little decisions that are easy to dismiss in isolation, but that’s how I see the philosophy of Java.
Of course, that didn’t work, so a large aftermarket in prostheses has sprung up, and lately the language has been sort of growing some of the power features it previously rejected, although they pretty are much bolted on. Many people have even forgotten that there is a whole world full of people who don’t get around in powered wheelchairs and don’t need machines to help them chew, and argue passionately about how much they love their Chewing Completion and Integrated Mobility Environments and how easy it is to sort of slowly shamble up stairs on these prosthetic legs (which sounds impressive after you’ve spent five years in a wheelchair), endlessly haranguing those who choose to run on their own two feet about what they are missing by not getting their legs chopped off.

Of course none of this covers the fact that Java was THE ONLY SANE WAY to write portable code for about 15 minutes during its greatest fame…

I don’t think anyone in good faith can discount the navigation benefits of a modern IDE.  Yes my favorite is still written in C++, as is my favorite editor (put that vim and emacs shit down, son, it’s time to code…I KID), nothing beats speed when you just want to type code.  But JetBrains has shown how they can provide amazing IDE features for all kinds of code: C++, Python, Scala, etc. with their Java library stack.  Yes you pay a performance price and yes we’ve been burned by slow Java IDEs before, haven’t we, Eclipse… but JetBrains has really hit a critical mass of solid IDE functionality,  and I’m going to give it another good try.  Here are some rolling notes, made in cronological order…

  • the soggy keylag is KILLING me… but I love the navigation power… hrmph…
  • it’s not THAT laggy considering all it is doing… and my other dev environment is through a VM anyway (does that make it better or worse, not sure yet…) continuing…
  • on a VM, all hope is lost.  Even sublime is uselessly unusable.  Back to emacs.  Sad world.
  • The speed is now pretty good, I don’t know if it got everything indexed and it’s faster, or if I got used to it.  I think it’s faster!  Just in time for my open source license to expire… and JetBrains renewed it!  Yay, thanks guys.
  • Some things just take some adjustment.  Keymaps, panes, etc.  Also, don’t expect to copy/paste huge chunks of code as fast as you can in a dumb editor – it causes a ton of analysis to occur.  In a non-VM fairly-decent environment, CLion is humming along now.
  • CLion is undeniably faster than Sublime on my VM.  It is downright snappy at editing code compared to Sublime.  Happily shocked!
  • Uhoh… lots of clion lockups on laptop… doh, whoops, out of disk space.  Don’t let it happen!  🙂

Fun tips:

  • You can open a file into an existing clion session by running the startup script with a full path to the file, or do this:
    clion `pwd`/myfile.cpp
    or use the little bash script to do it for you:
    # if $1 does not start with [/], prefix it with `pwd`
    if ! [[ $MYFILE =~ ^/ ]]; then MYFILE=`pwd`/$1; fi
    cd /home/m/apps/jetbrains/clion/bin
    ./clion.sh $MYFILE $2 $3 $4 $5 &
  • For the huge hirez monitors I have gotten addicted to using with i3, make sure you enable this (which is oddly disabled by default):

    File > Settings > Editor > General > [x] Change font size (zoom) with Ctrl+Mouse Wheel

  • CLion will auto-create projects from CMakeLists.txt, really nice.  It seems to auto-create Debug config using ./cmake-build-debug.  To create Release config too, go to:

    File > Settings > Build… > CMake > click +, it will auto-create Release (a little weird but it was what I needed)

Here’s a one-liner to get around evil Oracle’s “click the EULA” nonsense, and download their stupid JDK from the linux shell (in this case, the rpm version):

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-7u17-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-linux-x64.rpm --no-check-certificate -O jdk-7u17-linux-x64.rpm

Note that you’ll have cruft at the end of the filename after downloading unless you use the -O option (thanks Byron).

For other downloads, just change the target and output.

What fun. Original magic cookie fu by this guy, thanks!

I am loving cross-platform development with Qt, it’s robust and logical and leads to amazing native desktop apps. Before getting started, I expected that there would be lots of platform-specific hackery required, and going cross-platform would slow down the end product by 20-30%. But Qt is so reliable, and well-laid-out, and provides so much more than just lowest-common-denominator functionality, that I’m finding it to be much faster than, e.g., developing a desktop app with C# or Java.

Another reason it is giving me leverage: [n] compilers are better than one. (continued…)

Gentoo updated the way Java is configured. To fix it up I did this:

emerge -C java-config
emerge -1 java-config:0 java-config:2
java-config-1 --set-system-vm 1

I now have blackdown selected for 1.4, and sun for 1.6. Eclipse is working again.