I just learned today that within Google there are only 4 approved programming languages:
- C++
- Java
- Python
- JavaScript
Random thoughts about software development
I just learned today that within Google there are only 4 approved programming languages:
Marketing people have a concept they use known as "branding". As a capitalist and entrepreneur, I love the idea of branding. I'm impressed by anyone who can get otherwise intelligent people to pay $50 for a five dollar t-shirt. I wish I could I could do that!
But with that said, as a consumer I find branding kind of insulting.
I suspect that Lexus, Toyota and Scion (all Toyota brands) do not represent 3 categories of car as much as they represent categories of marketing strategy. In other words, different people respond differently to different sales gimmicks. By creating 3 virtual car companies, Toyota can ensure that each person receives the exact sales message that works on them.
There is nothing inherently wrong with this kind of thing. Obviously it works on some people - maybe all people. But none the less, it's annoying to me - just as it's annoying when the used car salesman uses a cheap sales line on me.
So JavaFX is my new favorite programming language. Thats right - JavaFX is a new programming language.
I think a lot of people might be getting the wrong idea about JavaFX because of the marketing hype. When I first heard about JavaFX, it was positioned as an alternative to Flash (or Flex). As a way to create (and deliver) Rich Internet Applications. But upon further inspection one realizes that, at its core, JavaFX is really a new language that runs on the JVM. I would say that comparing JavaFX to Groovy (or even Spring) would be more appropriate than comparing it to Flash.
[Correction: Technically speaking JavaFX is a brand - JavaFX Script is the name of the programming language.]
I'm low on time right now and can't go into many details, but let me say this: JavaFX is not just another language that runs on the JVM, its a very cool language. By cool, I mean that JavaFX has a number of innovative features that produce immediate and pronounced payoffs. For example:
1. Type-safe JSON
Any one who has used languages like Ruby or Groovy or even JavaScript knows that those languages don't need all those damn XML files that are part and parcel to modern Java frameworks.
Essentially, any language that has syntax for array literals PLUS map literals has built-in support for declarative, XML-ish constructs:
For example in JavaScript:
var company = {
name: "Smart Soft",
url: "www.smart-soft.com",
people:[
{firstName:"Dave",lastName: "Ford"},
{firstName:"Michelle",lastName: "Goldstein"}]
}
var company = Company{
name: "Smart Soft"
url: "www.smart-soft.com"
people:[
Person{
firstName:"Dave"
lastName: "Ford"
},
Person{
firstName:"Michelle"
lastName: "Goldstein"}
]
}
Here are the absolute simplest steps to get a demo of JavaFX up an running:
javafxrt.jar
Filters.jar
swing-layout.jarHello.fx:
import javafx.ui.*;
Frame {
content: Label {
text: "Hello JavaFX"
}
visible: true
}
java net.java.javafx.FXShell HelloHello is resolved via the classpath (not the file system).
~/DavesJavafxDemo/classes/Hello.fx
~/DavesJavafxDemo/lib/javafxrt.jar
~/DavesJavafxDemo/lib/Filters.jar
~/DavesJavafxDemo/lib/swing-layout.jar
~/DavesJavafxDemo/classes
~/DavesJavafxDemo/lib/javafxrt.jar
~/DavesJavafxDemo/lib/Filters.jar
~/DavesJavafxDemo/lib/swing-layout.jar
cp=./lib/swing-layout.jar:./lib/Filter.jar:./lib/javafxrt.jar:./classes
java -classpath $cp net.java.javafx.FXShell Hello
set cp=.\lib\swing-layout.jar;.\lib\Filter.jar;.\lib\javafxrt.jar;.\classes
java -classpath %cp% net.java.javafx.FXShell Hello
Here is a specific, concrete example demonstrating one of the benefits of a dynamic language (like JavaScript and Ruby) as compared to a static language like Java.
Suppose you want to do some ad hoc profiling (and you don't have a profiling tool handy). Here would be one way to do it in Java:
long t1 = System.currentTimeMillis();
slowMethod();
long t2 = System.currentTimeMillis();
long delta = t2 - t1;
System.out.println("slowMethod: " + delta);
executeAndTime(slowMethod);
executeAndTime looks like:
function executeAndTime(f){
var t1 = new Date();
f();
var t2 = new Date();
var delta = t2 - t1;
document.write("Delta for [" + f.name + "]: " + delta + " millis");
}
In the world of computer programming, a lot of thought goes into deciding "what to hide" - in particular, what to hide from the computer programmer.
For example, at some point in history people wrote applications in machine language. Today machine language is hidden from the developer and we see something more human-friendly, like C or Java. The stuff that gets hidden is usually closer to the way machines communicate. The stuff that remains visible is closer to the way humans communicate. At least that's the idea.
The terms high-level and low-level are used to convey this concept. Low-level technologies are more machine-ish and ripe for hiding. High-level technologies are more human-friendly. The high-level technologies are often referred to as abstractions that encapsulate or hide the low-level technologies. Today's high-level technology often becomes tomorrow's low-level technology.
This is my addition to the already over-blogged "table-based vs. CSS-based layout" debate. The older, tried-and-true technique for laying out web pages is to use HTML tables. A newer way is to use CSS Floats. Neither floats nor tables were ever intended to be used for page layout. I won't restate what's been stated but here are my 2 cents on the issue: