From: Rune Allnor <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error in MIN and MAX
Date: Sun, 30 May 2010 13:38:19 -0700 (PDT)
Lines: 48
Message-ID: <>
References: <htrjji$34i$> <hts20o$vt$> 
	<htt5bg$fli$> <httm7f$14t$> 
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1275251899 6785 (30 May 2010 20:38:19 GMT)
NNTP-Posting-Date: Sun, 30 May 2010 20:38:19 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 
	.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322),gzip(gfe)
Xref: comp.soft-sys.matlab:640746

On 30 Mai, 15:16, dpb <> wrote:
> Matt J wrote:
> > "Steve Amphlett" <> wrote in message
> > <htt5bg$>...
> >> I still think it's a huge problem with the Matlab language.  A massive
> >> booby-trap sitting there, waiting.  
> > =============
> > I'm actually a bit dumbfounded by how often this occurs. If you're
> > trying to use the same name for two different things (function and
> > variable), I tend to think that you really don't know what's going on in
> > your code.
> OTOH, given the size of the ML namespace, in some ways my surprise is it
> doesn't happen even more often... :)
> "i" and "j" are probably the two most common index variables
> ubiquitously used in other code; it's essentially automatic to write
> them for anybody who's ever written in any other language at all.
> The min() and max() names are, while possibly could claim they always
> ought to be minx or miny or somesuch amplified naming convention no
> matter what seem perfectly reasonable to use as variable names.  And, of
> course, if one comes from Fortran (listening, Rune??? :) ) where
> function names and variable names are in different name spaces, it's
> perfectly permissible

So you are saying that it is not the programming language
but the programmer's experience that determinec what features
he will be allowed to use in his programs...?

> (altho I don't recommend it, it makes one not
> consider as carefully as otherwise might) in picking names.

This is the strength that C++ offers, which I am not aware
if exists in other languages: Use the types of the arguments
in the function call and allow the *compiler* to determine
exactly what version of the function to link with. Works both
internally in classes and for free functions.

It is an incredibly powerful feature. Once one have tried it,
one will never go back.