29 June 2014

Another new syntax?

Ever get the feeling that there's a lot of syntax of different programming languages that could have been kept similar? Having learned a multitude of programming languages, I've seen myself moving from a state of knowing a language very well, to a state of finding it difficult to remember the subtleties of the syntax, a few years after not having used the language.

I also know of a multitude of programmers who go through the same problem. Suddenly, at one point in their careers, it becomes difficult to program, without being able to use a search engine to refer the syntax of the language. Not because they're bad programmers, but just because every different language has been created in a different way.

People who create programming languages: If you're listening, can we please do things a bit differently?

Not that I'm against having new syntaxes. For example, I like the fact that languages like Python don't need semicolons, and I simply love the way MATLAB allows a programmer to write code.
Removing a column from a cell array matrix is this simple with MATLAB:
model(:,2) = [];

In any other programming language, you'd have to create a loop to iterate through an array or even create a temporary array and copy relevant content into it. Of course, MATLAB might be doing the same thing internally, but I understand that this is why the people who create languages want to put in their own style (which is often awesome style!) into the language.

But think about the programmer. The person who'd eventually use the language. They'd have to learn an entirely new syntax from scratch. While it is fun to learn a new concept, and a new, easier way of writing a language, the greater fun, is in being able to create awesome software quickly. It isn't really necessary to create a different syntax for the same old for loops etc.

So when I mention "Can we do things a bit differently", I'm asking if we can ensure that when a new language is created, the syntaxes for all basic operations, constructs, containers, imports/includes etc. are kept uniform across languages? If there are abstractions to be created above these basic syntaxes, then sure, go ahead and create something that's specific to the functionality you're creating a new programming language for. But otherwise, for the syntax that serves as the building tool for a software, let the syntax be uniform (perhaps we could select a popular language as a baseline?). Programmers will love you for it!

As for you awesome dudes creating esoteric programming languages, do go ahead, unleash your creativity and surprise us! We won't be using those languages in production code at least ;-) Y'know, I never actually believed it initially, when I heard that Brainfuck was a programming language!!!

p.s.: Not wanting to just leave this as a blog post, I wrote to the creators of some popular programming languages. Mr.Bjarne Stroustrup and Mr.Guillaume LaForge were kind enough to reply and the gist of their replies indicated that this problem is well known, and although there's nothing much that could be done about it, it's important to allow languages to evolve. Although I agree with what they replied, I do hope people get talking about this and at least new languages would be created with familiar syntax.

No comments: