Tag Archives: programming languages

The GRAIL Project

In 1964 the RAND corporation unveiled the GRAIL Project. GRAIL was an early example of a GUI, and (the first?) example of a tablet.

The system used a programming language called GrailLanguage, which was a high-level flowchart-based programming language. All programs were written graphically and with a pen, using character recognition for statements and shape recognition for flow control.

Watch this video and tell me that the best new talent is working on Groupon for Babies or a better way to share photos.

Tagged , , , , , , ,

Programmer Fluency

A few weeks ago I came across a really interesting comment on Slashdot (I think I found it linked on Hacker News).
A poster by the name of wrook posted this comment that deserves to be widely read.

I’m quoting some of it here (all credit to the original poster).

My current theory is that programming is quite literally writing. The vast majority of programming is not conceptually difficult (contrary to what a lot of people would have you believe). We only make it difficult because we suck at writing. The vast majority of programmers aren’t fluent, and don’t even have a desire to be fluent. They don’t read other people’s code. They don’t recognise or use idioms. They don’t think *in the programming language*. Most code sucks because we have the fluency equivalent of 3 year olds trying to write a novel. And so our programs are needlessly complex.

Those programmers with a “spark” are programmers who have an innate talent for the language. Or they are people who have read and read and read code. Or both. We teach programming wrong. We teach it the way Japanese teachers have been teaching English. We teach about programming and expect that students will spontaneously learn to write from this collection of facts.

I think that being fluent is the most important skill a programmer can have. It leads to more maintainable and readable code. Any idiot can write code that a machine can understand, only a great programmer can write code that other people can understand.

Tagged , , , ,

10 One Liners to Impress Your Friends

As a bit of a programming language geek I find that comparing programming languages is a worthwhile exercise mainly because of the different techniques and styles that you are exposed to.
Learning multiple programming languages is one of the best things you can do to gain intuition about the most expressive way to write your code in any language.
No matter how much of an expert you are in a given language, learning a new one is often a humbling and educational experience and one that we should all try to do every so often to keep ourselves sharp.

I’ve seen several articles going around showcasing ‘one-liners’ (single lines of code) in different languages to perform a set of 10 simple tasks.
The first one I saw was done in Scala, and quickly spawned a number of imitations in other languages:

They are worth a look if only for a nice take on FizzBuzz – the Jeff Atwood smoke-test of programmer competency:

Enumerable.Range(1, 15).Select((i)=>i + (i%3==0?"fizz":"") + (i%5==0?"buzz":""));

C# is getting much more expressive with LINQ extension methods and lambda expressions but I think F# still has the edge with some of the inbuilt list processing functions.
Take partitioning a list into two lists based on a predicate in C#:

var passed = new List<int>();
var failed = new List<int>();
(from bucket in new[] { passed, failed } from i in new[] { 49, 58, 76, 82, 88, 90 } select new { bucket, i }).ToList().ForEach((tuple) => tuple.bucket.AddRange(Enumerable.Repeat(tuple, 1).Where((tup) => (tup.bucket == passed && tup.i > 60) || (tup.bucket == failed && tup.i <= 60)).Select((tup) => tup.i)));

Now in F#:

[49; 58; 76; 82; 88; 90] |> List.partition (fun i -> i > 60);;

If you look at the links above and see which language is most expressive for solving each problem you can really start to understand how languages can affect productivity.
Just being Turing Complete isn’t enough these days, and thank god for that

Tagged , , , ,