[julia-users] Re: Why does julia use END for block end?
Well said. +1. On Saturday, May 7, 2016 at 1:49:16 AM UTC-7, DNF wrote: > > I find 'end' to be the best choice of block terminator among the ones I > have seen. > > It is very clear and explicit, there is no doubt as to what it means, > unlike '}' which is way too small and ambiguous (does it mean end of block, > or end of dict definition, etc.), and just does not jump out at you the way > it should. > > You are also wrong that it takes longer to read, since you read it as a > single unit, you don't parse every single letter, unless you are in the > process of learning to read. And since it is so unambiguous, it is much > faster to read than any alternative I've seen. > > As for whitespace-dependent, Python style, block delimiters, I have been > working with those over the last few months, and have learned to abhor > them. They are very brittle, outdent something by accident and the code > breaks, perhaps completely invisibly. If you share code with someone that > uses 2-space indentations (as I have), fixing that is a big headache. Last, > but not least, it completely lacks the tidy symmetry and definitiveness of > begin-end blocks, the code seems to slide across the page and then just > trail off like a bad idea abandoned in mid-thought. > > I love 'end', please keep it :) > > On Friday, May 6, 2016 at 8:26:15 PM UTC+2, Ford Ox wrote: >> >> Is there any reasoning behind it? It seems to me like a weird choice >> since you have to type three letters, which is the complete opposite of the >> goal of this language - being very productive (a lot work done with little >> code). >> On top of that, brain has to read the word every time your eyes look at >> it so you spend more time also reading the code - tho this should be easy >> to omit, by highlighting this keyword by other color than other keywords >> (the current purple color in ATOM just drives me crazy, since it is one of >> the most violent colors, so my eyes always try to read that useless piece >> of information first, instead of the important code). >> >
[julia-users] Re: Why does julia use END for block end?
Personally I love end tags. If I were allowed to make one change to Python, it would be to add them in! As for verbose, I'm used to Octave where you also have the option of the even longer endif, endfor, endwhile, endswitch, and endfunction, which I find very handy for figuring out what level you're at in long functions. I'm actually still writing end #if in my Julia code (I'll probably get over it at some point). On the other hand, Julia allows you to write for i=1:n, j=1:n, k=1:n; ... end which is nicely terse, and I use it so often that I really miss it in Octave. Jamie
Re: [julia-users] Re: Why does julia use END for block end?
DNFwrote: > It is very clear and explicit, there is no doubt as to what it means, > unlike '}' which is way too small and ambiguous (does it mean end of > block, or end of dict definition, etc.), and just does not jump out at > you the way it should. 'end' is extremely verbose, just like 'function', 'global', 'local' etc. You are also wrong about the curly brace's ambiguity. If you find it ambiguous, that is because you live in a world overflown with syntax. You don't need end of blocks or dict definitions to be different things. You only really need an end of /expression/. And BTW, I have a hard time figuring out why 'end' wouldn't be ambiguous while '}' would be, especially since 'end' ends so many different things in Julia. Finally you are also mistaken about the size (yes, size matters). The curly brace isn't too small. It's too big. It's too noisy. See this little nasty peak in the middle, on the right? It's aggressive, it's impolite, it hurts my eyes. No, really, the only 'end' that makes sense, should be soft, discreet, gentle, almost invisible, in perfect harmony with the Universe. There's only one candidate. It's... the right parenthesis ')'. -- ELS'16, May 9-10, Krakow, Poland: http://www.european-lisp-symposium.org Lisp, Jazz, Aïkido: http://www.didierverna.info
[julia-users] Re: Why does julia use END for block end?
Also, since you're using Atom you could just edit your stylesheet (go to Settings => Themes and click the link at the top) to include something like atom-text-editor::shadow .keyword.control.end.julia { color: gray; } which would make the end a bit more subtle. Am Freitag, 6. Mai 2016 20:26:15 UTC+2 schrieb Ford Ox: > > Is there any reasoning behind it? It seems to me like a weird choice since > you have to type three letters, which is the complete opposite of the goal > of this language - being very productive (a lot work done with little code). > On top of that, brain has to read the word every time your eyes look at it > so you spend more time also reading the code - tho this should be easy to > omit, by highlighting this keyword by other color than other keywords (the > current purple color in ATOM just drives me crazy, since it is one of the > most violent colors, so my eyes always try to read that useless piece of > information first, instead of the important code). >
[julia-users] Re: Why does julia use END for block end?
I find 'end' to be the best choice of block terminator among the ones I have seen. It is very clear and explicit, there is no doubt as to what it means, unlike '}' which is way too small and ambiguous (does it mean end of block, or end of dict definition, etc.), and just does not jump out at you the way it should. You are also wrong that it takes longer to read, since you read it as a single unit, you don't parse every single letter, unless you are in the process of learning to read. And since it is so unambiguous, it is much faster to read than any alternative I've seen. As for whitespace-dependent, Python style, block delimiters, I have been working with those over the last few months, and have learned to abhor them. They are very brittle, outdent something by accident and the code breaks, perhaps completely invisibly. If you share code with someone that uses 2-space indentations (as I have), fixing that is a big headache. Last, but not least, it completely lacks the tidy symmetry and definitiveness of begin-end blocks, the code seems to slide across the page and then just trail off like a bad idea abandoned in mid-thought. I love 'end', please keep it :) On Friday, May 6, 2016 at 8:26:15 PM UTC+2, Ford Ox wrote: > > Is there any reasoning behind it? It seems to me like a weird choice since > you have to type three letters, which is the complete opposite of the goal > of this language - being very productive (a lot work done with little code). > On top of that, brain has to read the word every time your eyes look at it > so you spend more time also reading the code - tho this should be easy to > omit, by highlighting this keyword by other color than other keywords (the > current purple color in ATOM just drives me crazy, since it is one of the > most violent colors, so my eyes always try to read that useless piece of > information first, instead of the important code). >