Re:I've been designing a language since 2009 – friends and I...
by jbverschoor on Sunday August 14, 2022 @05:46PM
(#32463257)
Maybe do some Ruby programming and then reconsider what you think is more readable.
the break, food out break out of the if block? Or somewhere else? It’s confusing
Re:I've been designing a language since 2009 – friends and I...
by webmobdev on Monday August 15, 2022 @01:02PM
(#32472294)
That's silly - this isn't Ruby. It's a new language still under development and thus will have its own syntax. Obviously any language will be unreadable if you don't understand its grammar (syntax). Readability is tied to the syntax of a programming language. (And Ruby is great example of this - I am used to Python and I found reading Ruby code to be very cumbersome because of its weird syntax, which I didn't bother to learn). This a C / C++ / D like language.
(I would have preferred if the _OnBreak and _OnComplete statements was inside the for loop as that removes any ambiguity that it is part of it and effects the for loop).
However, `if v == 11 {break}` is definitely more readable than `break if v == 11`. If you are using curly braces as part of your syntax, and for blocks of code, it's better to use it with consistence. That can be confusing with `break {if v == 11}` as it breaks the syntax grammar, when you consider what break does.