Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!u20g2000pru.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error in MIN and MAX
Date: Sun, 30 May 2010 13:38:19 -0700 (PDT)
Organization: http://groups.google.com
Lines: 48
Message-ID: <3923b2b7-b987-42bf-bcfa-6ed2c29ed13a@u20g2000pru.googlegroups.com>
References: <htrjji$34i$1@fred.mathworks.com> <hts20o$vt$1@fred.mathworks.com> 
	<htt5bg$fli$1@fred.mathworks.com> <httm7f$14t$1@fred.mathworks.com> 
	<httojr$f0t$1@news.eternal-september.org>
NNTP-Posting-Host: 77.16.93.136
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1275251899 6785 127.0.0.1 (30 May 2010 20:38:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 30 May 2010 20:38:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u20g2000pru.googlegroups.com; posting-host=77.16.93.136; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
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: news.mathworks.com comp.soft-sys.matlab:640746

On 30 Mai, 15:16, dpb <n...@non.net> wrote:
> Matt J wrote:
> > "Steve Amphlett" <Firstname.Lastn...@Where-I-Work.com> wrote in message
> > <htt5bg$fl...@fred.mathworks.com>...
>
> >> 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.

Rune