Arabic programming language aims to open up coding

General Discussions
Post Reply
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Arabic programming language aims to open up coding

Post by Nipuna » Sat Feb 02, 2013 7:52 am

Douglas Heaven, reporter
(Image: Ramsey Nasser)
(Image: Ramsey Nasser)
tumblr_m3t77klQkE1qb616xo7_500[1].jpg (62.32 KiB) Viewed 2617 times
Maybe you think all programming languages look equally alien. But look again and it'll quickly become clear that most code actually has a lot in common with English.

Here's a program written in Java, one of the most widely used languages in the world today:
public class Hello {
public static void main (String[] args) {
System.out.println ("Hello World!");
}
}
Even if you don't understand what the words mean in the context of the program, you'll certainly recognise most of them. Apart from the quoted "Hello World!" and the names "Hello" and "args" (short for "arguments") - which are chosen by the programmer and could just as well have been "Bonjour" and "abc" - everything above is a term of the Java language. And Java, like most programming languages, is based on English.

Does that make programming harder to learn for non-English speakers? Or, indeed, for those whose language does not even use the Roman alphabet? Many people have thought so and developed programming languages that better suit their native tongue. Ramsey Nasser, a software engineer and designer at the Eyebeam Art and Technology Center in New York, is the latest.

Nasser has created ??? (pronounced "alb," meaning "heart"), a programming language based on Arabic script, which he hopes will attract new programmers from the Arab world. In essence it is a translation of an existing programming language called Scheme.

Alb is not the first Arabic language - that was Arablan in 1995 - and similar projects have been set up in China. Some suggest that teaching children to program in their first language might help them learn more quickly. But to make their mark on the rest of the world they would have to switch to a mainstream - English-based - language before long.

Dave Reed at Creighton University in Omaha, Nebraska, who studies computer science education, notes that research has shown that being able to understand variable names - even though they are really just mathematical symbols - helps people understand how a program works. He has tested the idea himself on classes of beginner programmers by showing them code with variables - like "args" above - in German.

"Not surprisingly, it was much harder for them to understand the behaviour of code when the variable names provided no context," he says. "I would guess that this same phenomena would apply to keywords of a language for beginning programmers."
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Arabic programming language aims to open up coding

Post by SemiconductorCat » Sat Feb 02, 2013 12:16 pm

I just finished reading the code craft , the practice of excellent code.The
suggested these things,

when you chose a name for a variable these are summary of rule of thumb.
1. It should be self descriptive.

When somebody new who didn't seen your codebase is reading your code he should
probably have questions like "what this `char buffer[MAX_BUFFER_SIZE]` does ? If it's
just buffer or not comment above, then he have to it for cross reference to understand
what this variable actually do. But something like `char error_msg_buffer[MAX_BUFFER_SIZE]` will
sound and describe itself.

2. Avoid long names. prefer prefix over long names.

Let's also take this from a example. simple 'x_pos` and 'y_pos` is more sound than 'screen_x_position',
or `screen_y_position`. `err_msg_buf` is more preferable than `error_message_buffer`.

3. Avoid prefix which describe it's type.
For a example if you declare a variable like this, ' int int_count;' is a bad practice. Compiler already have
good type checking built into it and other hand a good code reader is not lazy of being referencing back
to it's declaration.

4. Use prefix to describe global variables which are belongs to a particular library or module.
For a example if you declare `char err_msg_buf[MAX_BUFFER_SIZE] , is a pollution of global namespace.
If you wring a module 'xml_parser.o' then you better have `XMLPARSER_err_msg_buf` instead of 'err_msg_buf`.

5. Use 'is' ,'not' ,'have' prefix to Boolean variables, so they would be more descriptive.
for a example

Code: Select all

  while(!notDone){
    step();
 }

5. if all the above tricks does not make it more descriptive and does not answer the question "Why the hell he
declared this variable for". Then please be kind enough to add a comment above the declaration line of the
variable.
Example:

Code: Select all

/* The number of nested classes being processed.  If we are not in the
   scope of any class, this is zero.  */

int current_class_depth;


I just told you some rule of thumb, there are many best practices , and I would like to hear them from all you.
Please add add add and share.
Post Reply

Return to “General Discussions”