Saturday, August 25, 2007

More or Less Java

I was comparing why it is so much more difficult to learn a programming language as compared to a spoken language. With my broken Mandarin, I could mostly get by in China. But with a "broken" programming language, there is no way the computer will understand me. The main issue is obviously rigidity in programming syntax. There is no allowance for ambiguity. But what if someone creates a programming language that allows ambiguity. For example, instead of writing:

int age;
String status;

if (age > 18)
status = "adult";

one can write:

declare age status
if age is greater than 18 then status is adult

I wonder if this will make programming easier! Some fundamental ideas need to be presented first, say variables, if-then-else, for loop, etc. What I see is a relaxing of the syntax so that programmers can have some freedom to express how they think. A pre-compiler can translate this "more or less" programming language, say Java, into the proper syntax. It may be good to do a survey on a number of non-programmers and see how they would want to express their thoughts in their language, and let this be a "relaxed" version of the programming language. Or we can even allow programmers to create their own language and let a pre-compiler to translate from their language syntax to the standard one!

No comments: