Monday, November 29, 2010

New algorithms are painful in any language.

I think this set of examples from langref.org helps to show the pain of unexpected algorithms. It's a simple case, but note that none of the examples is remarkably clearer or shorter than most of the others. Library and language niceties often help for common use cases (hashtables, sorting, matrix multiplication, ...). With time, the set of what's common grows. Most programmers don't need to write new algorithms. But if you do, you can't always expect your language or library to save you.

Monday, November 8, 2010

Trying to exit Java

Just before the Oracle vs. Google lawsuit, I started a Java project for my PhD research. It was my first Java project in a while. I do more C++, MATLAB, and Python these days. I chose Java because I know it well and it simplifies cross-platform for me. I considered JavaScript, but this project included (2D) physics. I wasn't convinced by the JavaScript physics engines out there compared to the state of JBox2D.

Well, I'm one of the folks that has been convinced that Java isn't really open source nor independently implementable. If you get in the way of Oracle revenue, they will sue you. That's not open. Sorry.

So, where do I go?

I have a language idea of my own with primary output targets being JS (for client) and C++ (for speedy batch programming or native apps), but I don't really have the time to implement that. I could use haXe. It's the most credible JS/C++ targeting language out there, in my experience, but I'm not convinced I want to go that route either.

My current plan is to improve my C++ skills. Really. Anti-C++ rhetoric is strong in the Java community, but I'm being convinced that it can be used for good instead of evil. I also plan to stay in touch with JS land. And maybe someday I'll make or use a language that targets both (such as haXe).

I just wished I'd used C++ for that 2D physics project.

Sunday, November 7, 2010

Mormon Articles of Faith: Number 1

I've recently felt like sharing some of my beliefs about more important things than tech. I belong to The Church of Jesus Christ of Latter-day Saints. In other words, I'm a Mormon. We get that nickname because of the Book of Mormon, which we believe is a record of ancient Christians living in the Americas. That, among other things, makes us different from many other folks.

We are also called LDS (Latter-day Saints, from the name of the church).

To share our beliefs, I feel like working from our Articles of Faith. (See here for what "articles of faith" are in general and here for the full list of the LDS articles.)

I'll start with our first article:

1. We believe in God, the Eternal Father, and in His Son, Jesus Christ, and in the Holy Ghost.

Here's a great discussion of this subject from Gordon B. Hinckley, who under Christ's direction was the leader of the church at the time of his passing in 2008. He had authority to speak officially for the church, and I don't.

Still, I may continue this thread and speak from my own understanding. If I do that, I may emphasize that it's what I personally believe, not what we believe. Again, I don't have authority to speak for the church, and I definitely don't know everything. But I still try to stay in harmony with the teachings of the church and with the will of God as I understand it. I do my best (sometimes). Note that even President Hinckley (the term we use for the leader of the church) used the phrase "I believe" in his discussion. Despite his authority, I think he also liked to emphasize a personal perspective sometimes. I once listened to President Hinckley speak at a soccer stadium in Guatemala City. (Here's a reference from him to that occasion in Guate.) He said (to the extent I remember his wording), "If you remember one thing from today, remember you heard Gordon Hinckley say that he knows God lives." I actually do remember very little else from his message that day.

Anyway, to summarize my take-aways for the first article of faith: I believe in a personal God, not just universal forces. Even more specifically, there are three distinct persons to which I refer as God. All three can be called "one God" because of their great unity. While I seek to follow the promptings of the Holy Spirit in my life, I understand Him less as an individual. That's just where I'm at. The Father and the Son are clearer to me, even if I haven't seen them myself during my time here on earth. The Son, Jesus Christ, came to earth (as discussed in the New Testament in the Holy Bible) as a manifestation of God on earth. He also came to be like us. He knows first hand what we go through. I find that comforting. Further, knowing the Son helps us to know the Father.

If I continue this subject, I'll have more to say about Jesus. Mormons really are Christians in the sense that Jesus is at the center of our belief and worship.

Finally, again, in case anyone skims too much (as I do): Everything I say is my personal perspective. I don't speak officially for the church by any means.