Philip Andrew, Hong Kong, Scala Programming and I.T. business

Icon

Predicting Prometheus the movie

It looks to be a movie about a company with a “directive” from the boss, an order which governs how the company functions in the longer term. The order is to get the power of the Gods, to make the company boss into a “God”. The company sends spaceships around trying to find technology which will give them that power. *Just a guess*

Good article on the timestep for computer games

http://gamedev.stackexchange.com/questions/8623/a-good-way-to-build-a-game-loop-in-opengl

How to ssh to a virtualbox guest OS from the host

http://linuxconfig.org/unable-to-ssh-into-virtualbox-guest-machine

Just follow step 2 and first part of step 3.

How to develop Google App Engine Google Go applications on Windows using IntelliJ

Ok, the short answer is, don’t develop ONLY on Windows, use a combination of Windows and Linux.

The longer answer is, yes its OK to use IntelliJ on Windows to write the application. However to run and test its really necessary to use a Linux to build and test the application. So assuming you are on a Windows PC as I am.

1. Download Oracle’s VirtualBox so that we can run a Ubuntu Linux.
2. Download and install a Ubuntu Linux ISO on the Oracle’s VirtualBox. Yes, its a big ISO file, and takes a while to download.
3. Make sure that you have Ubuntu running, work out how to get to a Linux shell prompt.
4. Install Google Go App Engine as per the instructions.
Currently we are at Google Go version 1 beta 3 downloadable from here.
A discussion of the go1beta is here.
5. Run a test Google Go application, use the built in browser in the Ubuntu to http to the local VM machine and test.
6. Set up a share so that you can copy files between the Windows and the Ubuntu machine. Then create a shell script to copy files and run the Google App Engine for testing.

That’s it from a high level. Works well, so I develop in IntelliJ on Windows, I run a shell script in Ubuntu in the VM to copy the files across and run the GAE test environment.

Javascript

Now I remember why I don’t like Javascript, its hard to reason about the relationships between objects where there is not much type information in the IDE and at debugger at run-time.

NodeJS vs Scala and Liftweb

There is a trend this past year and a bit more for developers to go towards NodeJS, and now it has an active community with many libraries being added. This is not a new idea, Aptana Jaxer created some buzz when it first came out but that diminished quickly. The general idea of Javascript on the server is exciting but Jaxer was a top down effort and did not form such a large community following as NodeJS has. The main difference for NodeJS is that it is creating buzz from the bottom up from the developers themselves who add code to Github and do social coding, sharing their NodeJS libraries to interface with MongoDB or perform other functions.

The idea was always good, as one developer said about Jaxer “I think this would be great. I can write my jQuery validation code once and run it both on the client and server side.”. However the idea is also bad, Javascript is not designed to perform computations quickly, where it is going to shine is in getting data from the database, transforming it slightly and sending it to the user. Where it is not going to do well is when computations are needed, where it is necessary to generate images on the server side or perform many calculations on data, it is going to fall over and not succeed. The javascript on the server as a tool is only suitable for the average use case of being a gatekeeper between the user html page and the database. Well, that’s mostly all we need as web developers anyway.

The main problem I have is that it is easy to get started, that’s why people are excited, but when you get into the details of the larger project, the important issues come up such as the security of the server, how to read and write to the database, caching, what libraries to use. In terms of security, protecting it from hackers, client data security, spam attacks, hackers performing denial of service, its a cold hard world out there, NodeJS will not have any protection against this sort of thing and since its Javascript, DOS attacks will be easier against it due to its slow computation. However, if you play by the rules with Liftweb, all of these issues are not as important as Liftweb has been designed to cope with difficult security problems.

Liftweb is difficult to get started with, there’s a LOT of information to learn, Scala and all of its libraries, what are Snippets, how best to do things but at least, there is a “best” way to do anything. Liftweb has already explored the territory and knows what is the best way to solve a problem. In fact, it is a fairly mature technology with book(s) to read. However, you MUST follow the rules and you MUST know how to solve the Liftweb problems according to the rules. Not following the rules will lead to a mess and a headache. Also its more difficult to get Scala and Liftweb developers, they are not cheap and not easy to find as Javascript programmers, and a developer who does not know Scala is going to take weeks at least to get up to speed to learn Scala and Liftweb.

If NodeJS was as mature as Liftweb, most of the issues that I’m worried about would go away, but it is not, its a new technology with risks and unknowns. Unknown ways of solving problems means difficulty in deciding how to solve the problems. A typical NodeJS project is going to include many modules which may disappear or become less popular over time. This means that programmers who come back to the project will have to look at modules and API’s which are different in years to come. Also the Javascript language is not typed which is annoying and its really not such a great language, I guess you can program NodeJS in Coffeescript which helps.

Yahoo might release something about NodeJS this year. If there is larger company support then it will help.

Ultimately I prefer Liftweb over NodeJS, but for me, they are both very close in terms of preference. NodeJS may be best in a team environment where the programmers can all know Javascript. Liftweb requires the programmers to know the more difficult Scala and Liftweb, this is a risk if your Scala programmers are not available and you need to hire new Scala programmers. I just like Scala better than Javascript, sorry, and the maturity of the framework.

Then you can ask, why am I only comparing NodeJS with Liftweb in Scala? The reason is that these are my two favorite technology’s for server side development at the moment, and my other slightly less favorite general category for web development is SEAM Framework or JEE or Spring. Really the advantage of SEAM, JEE or Spring is that the API’s will not change much over time and there are very standard ways of solving problems. However, they are relatively heavyweight, although Spring would say it is not. These heavyweight environments can be slightly slower to get started in, but ok in the end.

Computer languages I would like to learn in full detail

Forth
Any good descendant of Prolog
Any good descendant of Lisp (Clojure)
Haskell

High performance Java libraries

http://vanillajava.blogspot.com/2012/02/high-performance-libraries-in-java.html

Good quickstart for Liftweb

is here

Seatgeek uses…

By looking at its Javascript code, Seatgeek uses:

backbone.js

http://raphaeljs.com/

underscore.js
JQuery

About Philip Andrew

I am a business owner and I.T. professional of over twelve years commercial experience currently located in Hong Kong.


I enjoy programming in the Scala computer language on the Java JVM platform and am developing an open source CMS, OrsaCMS on the Scala Liftweb framework.


My company, Orsa Studio develops websites and software for clients in Hong Kong.

Hong Kong