Indentation vs. "end"s

On Feb 1, 2006, at 3:38 PM, Rubyist wrote:

I have looked at some of my and other people’s Ruby code and
often been tempted to select those last 5
‘ends’ and hit the delete button. : )

Thank God! I am not alone on the earth! ;-D
Man, you’ve made me so laughed! Hahaha!

I think we can learn a lot from programming languages and Python.
First off, we should be writing in a fixed space font so we
can take visual cues from spacing more easily.
Next, why do we need periods at the end of a sentence
when we know that two spaces after a word mean
that the previous sentence just ended Doesn’t
that make sense And do we really need caps at
the beginning of a sentence we know all sentences
are capitalized and we have just defined that
two spaces before a word means that it is at the
beginning of a sentence next we should look at
spelling double consonants don’t realy add to
the meaning so begining now we spel words by
droping repeated consonants just look at al
these great benefits we can learn from python
self.we self.just self.need self.to self.learn
self.to self.ignore self.certain self.aspects
self.that self.may self.cary self.over

2006/2/2, Jeffrey S. [email protected]:

Dirk M. wrote:

i like the "end"s, it reminds me of the old days when i programmed my
Texas
Instruments calculator and always forgot an “end” somewhere :stuck_out_tongue:

I loved my TI-82, and I remember how excited I was over my 85. Now that
I’m a grown-up, of course, I have a Voyage 200. :slight_smile:

i used the ti-83+, and still do (as i’m still in high school) i just
don’t
program it as much as i used to :stuck_out_tongue:
but anyway, one thing i would like better than the current "end"s, is
wrapping everything in do/end like this:

while condition? do
#action
end

or maybe even:

if condition?
then do
#action
else do
#action
end

greetings, Dirk.

On Thu, 2006-02-02 at 15:48 +0900, Jim F. wrote:

I think we can learn a lot from programming languages and Python.
spelling double consonants don’t realy add to
the meaning so begining now we spel words by
droping repeated consonants just look at al
these great benefits we can learn from python
self.we self.just self.need self.to self.learn
self.to self.ignore self.certain self.aspects
self.that self.may self.cary self.over


Jim F.

:))))))))))

“Programming languages and Python”. Love it.

Rubyist schrieb:

Hi,

I REALLY love Ruby very much. But I always find those "end"s somewhat
ugly ( thousands of excuses to Matz ). I sometimes feel myself wishing
that Ruby use indentation (as Python does) instead of "end"s.

if a text is accidentally reformatted (alt-q in emacs, it seems to me
ruby users are more often vim users, at least on this list) semantic is
destroyed, as in python. This is not the case with i.e. javascript or
perl.

Maybe ruby as “javascript on steroids” would have even more success.
Blocks could be written with do

container.each do(i,j) { /* like |i,j| */ … }

On 2 févr. 06, at 14:29, James Edward G. II wrote:

Erm, you probably mean dies.laughing(), right ? :>

Somehow my first message got swallowed up…

Looks vaguely like FORTRAN to me…

I can remember telling a FORTRAN compiler to “do this end” and “do
that end”.

…or maybe that was PL/I…

Mike

Jim F. [email protected] writes:

I think we can learn a lot from programming languages and Python.
spelling double consonants don’t realy add to
the meaning so begining now we spel words by
droping repeated consonants just look at al
these great benefits we can learn from python
self.we self.just self.need self.to self.learn
self.to self.ignore self.certain self.aspects
self.that self.may self.cary self.over


Jim F.

Nice Twain.

Steve

On 2/1/06, Robert K. [email protected] wrote:

I don’t even think about them. I just use the language as it is.

That sums up my opinion on “end” in Ruby as well.

later…
jim

On Feb 2, 2006, at 12:48 AM, Jim F. wrote:

I think we can learn a lot from programming languages and Python.
spelling double consonants don’t realy add to
the meaning so begining now we spel words by
droping repeated consonants just look at al
these great benefits we can learn from python
self.we self.just self.need self.to self.learn
self.to self.ignore self.certain self.aspects
self.that self.may self.cary self.over

James Edward G. II

“Jim F.” [email protected] wrote in message
news:[email protected]

I think we can learn a lot from programming languages and Python.
spelling double consonants don’t realy add to

Classic!

; )

Hi,

In message "Re: Indentation vs. “end"s”
on Thu, 2 Feb 2006 15:07:27 +0900, Hal F.
[email protected] writes:

|Not a bad idea in itself. In fact, I think that really old Ruby
|versions (prior to my learning it with 1.4) did something like
|that. When modifiers were introduced (x if y, x while y, etc.)
|parsing became difficult and they were dropped. I think that’s
|the case.

Very old versions of Ruby, before Wed August 24 1994, according to the
ancient record of history.

						matz.

Hi,

In message "Re: Indentation vs. “end"s”
on Thu, 2 Feb 2006 06:37:02 +0900, “Rubyist”
[email protected] writes:

|What do you think about those "end"s? Do you REALLY like them?
|Will Ruby-2 offer an alternative? Well, maybe not “indentation” but
|will another solution be available?

We are experimenting double semicolons as well as "end"s, so that you
can type

class Foo
def bar(a)
p a
;;
;;

instead of

class Foo
def bar(a)
p a
end
end

Or you can even type

class Foo
def bar(a)
p a;;;;

But I’m still not sure if it’s good enough to be remained in 2.0.
No, don’t worry, we are NOT going to remove "end"s from the language;
double semicolons are just alternative.

						matz.

I’m out of my league, but…

On 2/2/06, Yukihiro M. [email protected] wrote:

We are experimenting double semicolons as well as "end"s,

But I’m still not sure if it’s good enough to be remained in 2.0.
No, don’t worry, we are NOT going to remove "end"s from the language;
double semicolons are just alternative.

why? quite seriously, and quite naively, I don’t understand the
benefit.

Maybe it’s just me, but the

class Foo
def bar(a)
p a;;;;

looks really different from the (current) standard

class Foo
def bar(a)
p a
end
end

It sounds to me like it’ll make reading ruby libraries / code a bit
more difficult since both can exist. Is it worth that price? Am I
missing something?

Cameron

Hi,

On 2/3/06, Cameron McBride [email protected] wrote:

It sounds to me like it’ll make reading ruby libraries / code a bit
more difficult since both can exist. Is it worth that price? Am I
missing something?

No. The purpose of this experiment is hearing other opinions. So
yours is quite worthwhile.

matz.

The semicolons, imho, aren’t visible enough to the (my?) eye. I still
believe that the curly brace to END is a decent option as it already
is familiar to many others. In most other languages the semicolon
denotes an end to a statement which for newbies (such as myself) it
may get confusing.

Cameron McBride wrote:

double semicolons are just alternative.
looks really different from the (current) standard

class Foo
def bar(a)
p a
end
end

It sounds to me like it’ll make reading ruby libraries / code a bit
more difficult since both can exist. Is it worth that price? Am I
missing something?

;; is used to end case statements in some popular Unix shells. I have
to admit that ;;;; still looks a bit odd to me.

Thank you, Matz.

On Fri, 2006-02-03 at 12:46 +0900, Yukihiro M. wrote:

It sounds to me like it’ll make reading ruby libraries / code a bit
more difficult since both can exist. Is it worth that price? Am I
missing something?

No. The purpose of this experiment is hearing other opinions. So
yours is quite worthwhile.

For what it’s worth, I also strongly dislike it. It was one of my least
favorite features of OCaml’s syntax.

But here, the biggest problem is that (relative to other block endings
in pretty much any language I can think of), it’s much harder to
visually count ;;s if they are squashed together as in your example.

I think this is largely because there aren’t any visual cues to the
boundary between tokens. The gap between two ;s within the same ;; and
the gap between two ;s in adjacent ;; aren’t visually distinguishable.

-mental

On Feb 2, 2006, at 10:07 PM, MenTaLguY wrote:

On Fri, 2006-02-03 at 12:46 +0900, Yukihiro M. wrote:

It sounds to me like it’ll make reading ruby libraries / code a bit
more difficult since both can exist. Is it worth that price? Am I
missing something?

No. The purpose of this experiment is hearing other opinions. So
yours is quite worthwhile.

For what it’s worth, I also strongly dislike it.

Amen brother.

I don’t think Ruby ever needs to be ashamed of being Ruby.

James Edward G. II

The semicolons, imho, aren’t visible enough to the (my?) eye. I still
believe that the curly brace to END is a decent option as it already
is familiar to many others

I agree. Although using semicolons sounded a good idea for me, when I
saw:

def foo()
blah blah
blah blah
if blah blah
;;;;

I haven’t liked them. But curly braces may me quite better. Yes… I
think it’s worth to try without totally removing the "end"s. Just an
optional implementation. I am already very happy with Ruby’s many
optional solutions. One may use or not "then"s, one may write a single
line conditional without using "end"s etc.

def foo()
blah blah
if blah blah
blah blah }
}

On Fri, 2006-02-03 at 13:35 +0900, James Edward G. II wrote:

For what it’s worth, I also strongly dislike it.

+1

Amen brother.

I don’t think Ruby ever needs to be ashamed of being Ruby.

+1