Friday, February 16, 2007

Programming Languages.

We where talking about M151 - new course indevelopment at the open u. I said I think there are programmers out there that want to keep abreasts about new languages out there. Supose somene says I've been to three interviews and they want t to know If I could program in a language called Flubble* where can I go to learn that ?' What I found intreasting was that three people asked me later on what this Flubble lanauge was... (so I told them I just made it up )

*I just invented this on the spot as an example.

On the subject of languages. things I would like to see in language X


override void mymethodthing( int x | ( x > 0 :"no negative array arguments ") | , Object o | o != null && o.valid() )
{
//being method
}



this would mean that when someone called this method like this
thing. mymethodthing( -3 , this ) ; // this is the calling line.

that is the line | ( x > 0 :"no negative array arguments ") | is an assert sayign the first integer argument is non negative.

there would be a COMPILE TIME error or a RUNTIME error on the calling line ( not the sub routine ). After all the subroutine interface clearly states the limits of the method/function and you have just crossed the line. the problem is with the calling code not the method ( which has clearly stated the assumtions). May be more asserts could be used to augment code generation. More programming concepts later.

No comments: