Crisis of Choice (software, not an actual crisis)

I’ve been writing Scala code for about 9 months now daily.  I just recently completed (as much as one can complete software) a small project at work that took much longer than expected due to things that didn’t seem like they should take very long taking an eternity to figure out (Marshaling and UnMarshaling data is a huge pain in the ass using spray-json.  I highly recommend fasterxml if you don’t want to waste shitloads of time battling the library itself.  It works like the Play libraries, which is nice.)

Once I get things working, they work reasonably well, although I feel like what I have built is fragile.    Things that should be easy are a huge pain in the ass.  It’s been running for 30 days with no problems, which is nice, but that’s mostly because Akka is solid.  I just don’t feel like I have my head around this language.  I was a dumbass and decided that using a web framework for what I was doing was overkill, so I tried to build it with Akka, Spray, and Slick.  It was a waste of time, other than for learning Akka/Spray/Slick.  I should have stuck with Play and used traits to make testing my code easier.   The previously mentioned huge pain in the ass (which I never did get working) would have never occurred, it just works in Play.  My primary complaint about Play was it was hard to test, but that was actually my problem not really understanding how useful traits are when it comes to testing.  Anyway, you live and learn.

It’s an interesting place to be.  Nine months seems like it should be enough time to grok a language; however, I still feel like I’m scratching the surface.  I’m not expecting to be an epic badass at it, but it’s harder than it should be.  I have the same feeling with Scala that I have with C++.  If I can’t get the bulk of the language into my head, I have much less confidence in what I am writing.  I think that makes me a weaker developer in some ways, but at the same time, the point of abstraction is to not have to worry as much about what’s going on within the abstraction.  Scala is so complex with its generics implementation and type system and every other thing it tries to throw in, that it just gets out of hand in a hurry.  It is an amazingly powerful language, and overwhelming because of it.  It feels like it has created a whole new set of very complicated problems for me to solve to do what should be less complicated.

Scala offers all kinds of badass ways to get concurrency and parallelism and a neat type system, but at the cost of being a really really complex language with a seemingly insurmountable amount of concepts and associated buzzwords.  I blame the JVM and the JVM community at large.  They love abstractions of abstractions with abstractions in them, wrapped in Lists of Generics, which are type erased so you can’t tell what is inside of them at runtime without writing a bunch Manifest or TypeTag bullshit, each with a different name depending on the order that the abstraction occurs.  It’s maddening.  The JVM is amazing, and also drives me nuts.  I’m starting to feel like the “solution” causes more problems than it solves.   I think I’ll always be a JVM outsider.  It just always feels a little wrong to me, even when it’s working (and gobbling up memory).

To put it in perspective, I rewrote my Scala app in Python in about 4 days using Falcon.  My Python version handles the load it needs to and actually uses less memory.  It won’t scale at even a fraction of the scale of the Scala version in its current version, but it doesn’t need to.  If that became a requirement, I’ll bet I could write it to scale in less time than it took me to write it in Scala.  Admittedly, I have been writing Python code for much longer, and since I already had the design worked out, reimplementing it is always easier than the original implementation.  I also used a framework, so it’s not as fair of a comparison as if I had used Play.  It isn’t 86 days easier though.  I’ve been looking at Go and it tries to solve the concurrency/speed/memory/complexity problems in a kind-of backwards way that is interesting to me.  It doesn’t have classes or generics, and I kind of love that idea.  They tried to intentionally keep it simple, which is the philosophical opposite of Scala.  It’s a get-shit-done language instead of an academic language.  I’ll give it a try at some point.

I’m not giving up on Scala.  The challenge is fun; however, I don’t think it will ever be a dominant language.  I don’t think it will every be possible to scale a Scala development team in most cities.  There just won’t be enough people that are actually good at it that don’t cost a fortune.  What do I know though?  I could be wrong, but it just doesn’t feel right to me.  Maybe it’s better if you love the JVM, I really don’t know.  It’s a very complex language though, and I’m not settling on it as the best way to tackle concurrency/parallelism problems.

More with Max/MSP, Ableton, and now Python!

It’s pretty neat that so much of what I’ve been interested in, as far as technology and music go, are all kind of congealing into one big mess.  This weekend I started exploring the capabilities of this software call Kapture.  It basically does exactly what my MIDI mapper does, only it captures all configurable parameters of the Live set instead of just the parameters I had the foresight to write code to capture.  It also saves them to the set instead of a separate xml file.  It’s pretty badass.  It basically lets me snapshot my entire setup, save those snapshots, and then recall them whenever I want.  The only part I was missing was a way to get it working with my FBV controller in a way I liked.   Bring on the python!

I wrote a python script last night for the FBV Shortboard MKII that lets me control live with my FBV.  It is based very heavily on the work of Hanz Petrov who has done so much work documenting the LiveAPI that the code is pretty trivial to write now.  My code draws a red box around the tracks I am working with exactly like the APC40 does, and basically makes the FBV a physical extension of what is going on in Ableton Live.  This basically gives me the ability to create snapshots of all of my virtual instruments, mixer settings, etc. with Kapture, and then I can stomp on a pedal to switch between them.  My hands are free to play instruments, and my feet control Ableton.  Pro tools may be the industry standard, but this flexibility and stability makes it feel like a dinosaur.  I can do almost anything I can think of with this software.  It’s incredible.  Python is kind of a glue language, and that is exactly how I used it.  I glued some hardware to a neat Max/MSP app and have something better than what I was trying to write earlier.  I learned a lot writing my old setup though so it isn’t a total wash.

This functionality has obvious live music implications, but it turns out that it is so efficient that I can probably use it when recording and mixing too.  I barely have to touch my laptop which is awesome.  I am now working on getting my Maschine integrated with everything and I should have a really flexible setup with a pretty minimal effort.

I am cleaning up the code now and I am going to try it out over the next few weeks.  I’ll post the code if anyone wants it, but for now I am going to play with it a bit first to make sure it all works as expected.

Excitable Boy

Anyone that knows me knows that I am not a particularly animated person. When I feel like I am making an exaggerated movement or making a fool of myself, I often later find out that I looked foolish because I was moving so little in comparison to everyone else. My life is in monotone; my humor depends on it and my social awkwardness is amplified by it. Today is a special day though. It may look like any other day because I lack the ability to emote effectively; however, I assure you that this day is different. Jason Legler got himself 4 pre-sale tickets to Radiohead in Seattle and more importantly, he was one of the first people to get them so he thinks that they’ll actually be good tickets. I am jumping out of my skin with excitement which from the outside likely looks like I might have some kind of subtle stomach issue.

Historically I always get hosed on this kind of stuff. I usually don’t hear about the tickets going on sale until they are already sold out. This time though, I watched the band site like a hawk and found out what day the tickets went on pre-sale. I then wrote a little tool in Python that checked the pre-sale ticket site every minute. If the program detected that anything had changed at the site it played metal as loud as my computer could be turned up. This allowed me to sleep and monitor the site at the same time. At around 6am today my computer began blasting metal and I was able to procure some tickets. I’m stoked as hell that I got tickets and completely dorking out on the fact that I wrote software to allow it to happen. That being said I have recently discovered that programs exist for doing this task already and are much cooler and MUCH more flexible than what I wrote. I don’t care though, it was cool as hell.

I’ve gotten to see Radiohead twice in my life and both times were outdoor venues. In both instances I was far enough back that the sound was washed out and I couldn’t see much. I really hope that my determination in getting good tickets pays off and the tickets I bought will let me get close enough for this to be a really good show. Anyway, that is it. I got Radiohead tickets. I’ll let everyone know where the seats are when they actually get assigned. Here is Thom rocking a little Bangers + Mash Phil Collins style.

We Prepare

Heather and I are supposed to be getting ready for our trip to Mexico next week.  Instead I am sitting on the couch trying to find ways to distract myself and she is with her sister at a potluck at the adoption agency her sister is using to give up her child.  Randy Craig is in my basement working on vocals.  I would go assist with that but he seems to get better takes when I am not around.  Besides, it’s hard for me to sit in a room while he sings the same phrase 300 times.  I don’t know how he has the patience for it but the performance ends up sounding good so I don’t complain too much.

I have several solid 8 hours days of work to do on the 4 songs we want to have done before Christmas and I have to get those days in before December 15th when Heather and I leave.  Randy and I have been working on this record for over a year and we have 4 songs close to being done, 3 or so on deck, and probably 3 more in the incubator… yet to be inspired.  I would like to work on my own music, but I can’t seem to make the time.  We really need to get Randy’s new record done so I can move on to some other things.  I like working on Randy’s stuff but I am 28 and would like to get some of the ideas I have for songs down before I am 30.

I also have lots of work to do at my actual job.  I’ve become an asset to the company I suppose and I actually really like what I have been doing lately.  I have a sense of pride in my work, as corny as that sounds; however, it is exhausting at the end of the year when everyone wants everything done immediately and right now I just want to go on vacation.

I decided earlier this year that I wanted to learn a programming language.  Programming was directly responsible for the difficulty I had in college and I kind of want to kick its ass now that my mind is a little more agile.    I had originally wanted to learn Java; however, the syntax gets in the way and the whole process just seems kind of clunky.  I spent 3 weeks writing a very simple piece of code that logged into a remote Oracle database, grabbed some data and analyzed it, and then updated some tables in said database based on a csv file provided by another company.  I got it about 90% of the way done but that last 10% was a pain in the ass.  I figured I would try python because everyone rants and raves about it.  I literally did the same project, having no experience with python, in about 4 hours only it worked as a standalone app and was much more robust.  It just proved to me that my logic was good but the language was getting in my way.  I’ve always struggled with foreign languages and programming languages don’t seem to be an exception to that.  I’m not bagging on java.  It has its place in the world for sure; but it was actually fun to write python code and not have to look shit up constantly to be able to do it.  Now that I am done with it, I have all kinds of little parts I want to change; however, the project I wrote it for will be over at the end of next week and I’ll probably dump all the code.  Oh well, it was a good learning experience.  If I get bored I will finish the java version.

Anyway, I just started this page and I want to be able to post about the things that interest me.  It’s probably going to be strange mix of all the little things I like to do but it will be good for me to write down.  Sometime later I will put something up on why I think writing it down is important; however, for now I am going to do something a little more productive.  With that, I leave you with a picture of Scarlett Johansson because she’s hot as hell and I’m down with that.