Thanks. About the "&&", although "I do not find it more readable" too, I
have started using it...

> So instead ask for removing the end keyword and using indentation.

Well, while I had hated Python forced indentation at first, I soon begin to
like it and realised it didn't get into my way since it was something we
already do anyway.
When I started using Julia I missed the compactness of no "end" lines. Now
I'm used to it and I tend to think that this issues are more a matter
of habitude than something else.




On Sat, Apr 5, 2014 at 11:12 PM, <klimah...@googlemail.com> wrote:

> There is no need for a "then" key word. Use brackets for readability
> if (x<0) x=-x end
>
> I don't like the "then" keyword in IDL.
> But I love it the python way:
> if x<0: x = -x
>
> So instead ask for removing the end keyword and using indentation.
>
> The && option seems just like a work around for this propose and I do not
> find it more readable.
> x<0 && x = -x  mixes conditions and execution statements.
>
>
> Am Mittwoch, 19. März 2014 16:33:57 UTC+1 schrieb Cristóvão Duarte Sousa:
>>
>> Hi,
>>
>> Sometimes I see myself writing one line if-elses like `if x<0 x=-x end`,
>> which I think is not very "readable".
>>
>> What is your advice for that?
>> "That is ok", "always put a semicolon after the condition" or "totally
>> avoid one liners"?
>>
>> BTW, have you Julia devs ever considered introducing a "then" keyword
>> which could optionally be placed after the condition (à la Ruby)?
>> `if x<0 then x=-x end` seems much more readable.
>>
>> (I know the ternary operator, but I'm considering cases where no "else"
>> action exists.)
>>
>>

Reply via email to