The Daily Parker

Politics, Weather, Photography, and the Dog

Bach-Barnes tempering

During the A-to-Z challenge, I discussed tempering, which is the art of tuning each note on the scale.

I'm a member of the Apollo Chorus of Chicago, and serve on its board. Every year since 1879, we've performed Händel's Messiah. Given the piece premiered in 1742, modern equal tempering would neither have been an option nor would it have sounded pleasing.

In a conversation yesterday with Dr. Stephen Alltop, our music director, I asked him what tuning we use. He replied:

We use an unequal temperament called Bach-Barnes. Messiah keys range from four sharps to four flats so I tweak the temperament to sound as good as possible in that range of harmonies.

So that's interesting. We perform an 18th-century work with 20th-century instruments using 21st-century tuning.

(We perform it next on December 15th and 16th at Harris Theater in Chicago.)

Z is for Zigeunerlieder

Blogging A to ZToday the Blogging A-to-Z challenge comes to a close, and for the fourth time this year, I have to punt.

Search all you want: music theory really doesn't have any important terms starting with Z. So today, I'm going to talk about one of my favorite vocal works: Brahms' opus 103, "Zigeunerlieder" (Gypsy Songs). I performed three songs from the cycle with the Illinois Music Educators Association All-State Honors Chorus in 1987, 100 years after Brahms wrote it. (Yes, back then I was one of the 256 best high-school age singers in the entire state. I am, right now, blowing on my fingernails.)

Enjoy it. As the score scrolls by, see how much of what I discussed this year you recognize. And enjoy it; it's a cool song cycle.

That's it for the A-to-Z challenge this year. Next April, I'll have a timely topic. Before then, I expect to publish my 7,000th blog entry (probably mid-October), take my 100,000th photograph (probably this month), and live my 18,000th day (almost certainly December 17th).

Thanks for reading!

I hate Scala

"It is no one's right to despise another. It is a hard-won privilege over long experience."—Isaac Asimov, "C-Chute"

For the past three months, I've worked with a programming language called Scala. When I started with it, I thought it would present a challenge to learn, but ultimately it would be worth it. Scala is derived from Java, which in turn is a C-based language. C#, my primary language of the last 18 years, is also a C-based language. 

So I analogized thus: C# : Java :: Spanish : Italian; therefore C# : Scala :: Spanish : Neapolitan Italian. So as with my decent Spanish skills making it relatively easy to navigate Italy, and my decent C# skills making it relatively easy to navigate Java, I expected Scala to be just a dialect I could pick up.

Wow, was I wrong. After three months, I have a better analogy: C# : Scala :: English : Cockney Rhyming Slang. Or perhaps Jive. Or maybe even, C# : Scala :: German : Yiddish. That's right: I submit that Scala is a creole, probably of Java and Haskell.

Let me explain.

Most C-based languages use similar words to express similar concepts. In Java, C#, and other C-based languages, an instance of a class is an object. Classes can have instance and static members. If you have a list of cases to switch between, you switch...case over them. And on and on.

Scala has a thing called a class, a thing called an object, a thing called a case class, and a thing called a match. I'll leave discovering their meanings as an exercise for the reader. Hint: only one of the four works the same way as in the other related languages. In other words, Scala bases itself on one language, but changes so many things that the language is incomprehensible to most people without a lot of study.

Further, though Scala comes from object-oriented Java, and while it can work in an object-oriented fashion with a lot of coercion, 

As in Yiddish or Gullah, while you can see the relationship from the creole back to the dominant language, no deductive process will get you from the dominant to the creole. "Answer the dog," a perfectly valid way to say "pick up the phone" in Cockney (dog <- dog bone <- rhymes with phone), makes no sense to anyone outside the East End. Nor does the phrase "ich hab' in bodereim," which translates directly from Yiddish as "I have (it) in the bathtub," but really means "fuck it." The fact that Yiddish uses the Hebrew alphabet to express a Germanic creole only adds to its incomprehensibility to outsiders.

These are features, not bugs, of Jive, Gullah, Yiddish, and other creoles and slangs. They take words from the dominant language, mix them with a bunch of other languages, and survive in part as a way to distinguish the in-group from the out-group, where the out-group are the larger culture's dominant class.

I submit that Scala fits this profile.

Scala comes from academic computing, and its creator, German computer scientist Martin Odersky, maintains tight control over the language definition. Fast adoption was never his goal; nor, I think, was producing commercial software. He wanted to solve certain programming problems that current computer science thinking worries about. That it elevates a densely mathematical model of software design into commercial development is incidental, but it does increase the barriers to entry into the profession, so...maybe that's also a feature rather than a bug?

Scala isn't a bad language. It has some benefits over other languages. First, Scala encourages you to create immutable objects, meaning once an object has a value, that value can never change. This prevents threading issues, where one part of the program creates an object and another part changes the object such that the first part gets totally confused. Other languages, like C#, require developers to put guardrails around parts of the code to prevent that from happening. If all of your objects are immutable, however, you don't need those guardrails.

A consequence of this, however, is that some really simple operations in C# become excruciating in Scala. Want to create a list of things that change state when they encounter other things? Oh, no, no, no! Changing state is bad! Your two-line snippet that flips a bit on some objects in a list should instead be 12 lines of code (16 if it's readable) that create two copies of every object in your list through a function that operates on the list. I mean, sure, that's one way to do it, I suppose...but it seems more like an interview question with an arbitrary design constraint than a way to solve a real problem.

Second, this same characteristic makes the language very, very scaleable, right out of the box. That is actually the point: "Scala" is a portmanteau of "Scaleable" and "Language," after all. That said, C# is scaleable enough to run XBox, NBC.com, Office Online, and dozens of other sites with millions of concurrent users, so Scala doesn't exactly have a monopoly on this.

Not to mention, Scala gives frustrated Haskell programmers a way to show off their functional-programming and code-golf skills in a commercial environment. Note that this makes life a lot harder for people who didn't come from an academic background, as the code these people write in Scala is just as incomprehensible to newbies as Haskell is to everyone else.

All of this is fine, but I have developed commercial software for 25 years, and rarely have I encountered a mainstream language as ill-suited to the task of producing a working product in a reasonable time frame than this one. Because the problem that I want to solve, as a grizzled veteran of this industry, is how I can do my job effectively. Scala is making that much more difficult than any language I have ever dealt with. (There are a number of other factors in my current role making it difficult to do my job, but that is not the point of this post.)

Maybe I'm just old. Maybe I have thought about software in terms of objects with behavior and data for so long that thinking about it in terms of functions that operate over data just doesn't penetrate. Maybe I've been doing this job long enough to see functional programming as the pendulum swinging back to the 1980s and early 1990s, when the implementationists ruled the day, and not wanting to go back to those dark ages. (That's another post, soon.)

This cri de coeur aside, I'll continue learning Scala, and continue doing my job. I just really, really wish it had fewer barriers to success.

Three nights, three hotels

I'm traveling this weekend, starting with a night about a block from my office. Tonight is WhiskyFest Chicago, starting in about 90 minutes (though they let us start gorging on cheese and crackers at 5pm). For easily-understood reasons, I'm staying at the same hotel tonight, then heading to my college radio station's 60th anniversary party tomorrow morning. Not my first choice of timing, but I had no control over either event.

Sunday I head into Manhattan, and coincidentally the Yankees are in town...

The view from my room today fails to suck:

Starting the April entries

It may appear that blogging will slow down a little bit going into the last week of March. That's because Blogging A-to-Z entries take a little more time to write. This year might be a little ambitious, also, because I plan to provide musical snippets to go along with the text (otherwise what's the point?).

My goal today: get through a chunk of the first week of April. And figure out when I can write the rest for that week.

I've also written an entry for an historical anniversary mid-April.

Stay tuned.