I  agree and mostly fall in the camp of keeping the new behaviour.    in my 
experience trying to attract MATLAB users is a waste of time: the faster code 
is in MATLAB the slower it is in Julia, which makes for an awful first 
experience.   It's also not clear why at this early stage Julia would want to 
attract "non-expert" users, as the syntax is still changing each revos.

But linspace is a bit awkward as it sometimes plays a role like "ones" or 
"zeros".  Thinking about trying to teach new programmers Julia in a Math Comp 
class makes me lean towards the simplicity of it just returning a vector.




Sent from my iPad

> On 1 Oct 2015, at 11:28 PM, Tamas Papp <[email protected]> wrote:
> 
>> On Thu, Oct 01 2015, Sheehan Olver <[email protected]> wrote:
>> 
>>    I think an argument for linspace returning an Array is that it makes 
>> teaching new programmers Julia a lot easier.
>> 
>> If it returns an Array, its sufficient to teach students the Array type.  
>> But if it returns a Range, one has to teach an extra data type before the 
>> students can use it.  Teaching [1:5;] is not as bad as one can just teach 
>> that as the syntax for creating an array of [1,2,3,4,5].  (Teaching the 
>> syntax [linspace(1,5,1);]  is too over the top I think.)
> 
> Certainly it is a new concept to learn if one wants to understand the
> implementation, but it also demonstrates the elegance of Julia: you can
> have a type that behaves like an array in many respects, but at the same
> time does not store all that information explicitly. This also has
> pedagogical value.
> 
> Trying to transform Julia in such a way that it has "no surprises
> compared to X", where X is Matlab, R, C, Python, etc, has two possible
> pitfalls:
> 
> 1. there will never be an agreement about what the right X is (see the
> infamous string concatenation operator issue),
> 
> 2. many great features would be lost, making Julia nothing but an
> incremental improvement over X.
> 
> As a new Julia user, I found linspace and how it integrates into the
> whole Julia iteration framework very elegant. Sure, it was different
> than what I was used to in other languages, but I value elegance over
> familiarity -- after all, I am learning a new language.
> 
> Best,
> 
> Tamas

Reply via email to