4 ms·
It's personal preference and very minor thing but I don't really like end keyword to end a block. Those don't save space over braces (well at least not over K&
by bluecalm 12y ago
It's personal preference and very minor thing but I don't really like end keyword to end a block. Those don't save space over braces (well at least not over K&R style braces) and are less readable than them (eyes naturally focus on words so the code with a lot of ends is more difficult to read). Why not just indentation or if that's too troublesome standard {} braces ?
Discussion about such things is usually quickly dismissed here but I wonder how other people react to syntax things like that.
- CyberDildonics 12y agoIt's quickly dismissed probably because that, along with 1 indexing (instead of 0 offsetting) are such minor negative decisions compared to all the extremely apt decisions made in the design of Julia. Those two are both controversial with minor pros and cons, but larger scale core design issues like multiple dispatch, integrated multidimensional arrays, a packaging system based off of github, the ability to immediately generate llvm or native code etc. far outweigh the cosmetic issues people might not be as comfortable with.
- bluecalm 12y agoI agree but I also believe that cosmetic issues help with adoption and sparking enthusiasm for a language. It's silly but a lot of people are like that (I am as well). Beautiful cars, apartments, smartphones... in all of them core design is way more important but people still go for looks at least to some extent.
- CyberDildonics 12y agoI think that those two features in particular are more polarizing than anything. I don't think there is a wide consensus as to which is better even though most programmers have an opinion. Many programmers would agree (I think) that Julia is cosmetically beautiful in a lot of other ways however.
- pygy_ 12y agoThese features were precisely chosen to drive the adoption of the language among R and especially MATLAB programmers.
- Xcelerate 12y agoYeah, I think it's one of the those where you're not going to be able to please everyone, so don't even waste time on it. Personally I like the "end" statements and the 1-based indexing better than the alternatives, but that's just one preference among many. If syntax is important, you're going to alienate many potential users no matter what decision you choose.
- StefanKarpinski 12y agoGuy Steele once quipped (paraphrasing) that the most challenging thing about programming language design is the small number of paired brace characters in ASCII. Wasting one of these pairs for blocks the way C does is criminal. This forced C++ to co-opt < and > for templates, with all the parsing horror that ensued. Think how much nicer it would be if C++ template parameters had their own legitimate brace pair – like say { }. Having significant indentation like Python is another option, but one I've never cared much for – it makes cutting and pasting code a bit of a nightmare, among other things.
- ced 12y agoPython indentation (and Lisp parenthesis) saves up a lot of vertical space. It allows me to see many functions at once.