Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby could be wildly more popular if it had ...

Reply
Thread Tools

Ruby could be wildly more popular if it had ...

 
 
james_b
Guest
Posts: n/a
 
      07-30-2003
Josef 'Jupp' Schugt wrote:
> Saluton!
>
> * Jeff Mitchell; 2003-07-30, 13:49 UTC:
>
>>Brackets.

>
>
> If that is true why isn't LISP the most popular language on this
> planet?


Becauae of the obvious criitcal differences between ( ) and { }.



James

>
> Gis,
>
> Josef 'Jupp' Schugt





 
Reply With Quote
 
 
 
 
why the lucky stiff
Guest
Posts: n/a
 
      07-30-2003
Moustaches and goatees.

Brackets of the mouth.

_why

 
Reply With Quote
 
 
 
 
Florian Frank
Guest
Posts: n/a
 
      07-31-2003
On 2003-07-31 05:59:42 +0900, james_b wrote:
> Becauae of the obvious criitcal differences between ( ) and { }.


I don't like either of them. Because of the motto "Ruby makes
programming fun again", we should opt for something like that instead:

class Example (-:

def initialize(*args) (-: @ary = args

def sum(start = 0) (-:
s = start
each (-: |x| s += x
s


def sqare_sum(start = 0) (-:
s = start
each (-: |x| s += x ** 2
s


def each(-: @ary.each (-: |x| yield x



--
You can create art and beauty on a computer.
-- Steven Levy, Hackers: Heroes of the Computer Revolution

 
Reply With Quote
 
Anders K. Madsen
Guest
Posts: n/a
 
      07-31-2003
On Thu, 31 Jul 2003 09:50:11 +0900
Florian Frank <(E-Mail Removed)> wrote:

> On 2003-07-31 05:59:42 +0900, james_b wrote:
> > Becauae of the obvious criitcal differences between ( ) and { }.

>
> I don't like either of them. Because of the motto "Ruby makes
> programming fun again", we should opt for something like that instead:
>

[snip "all the fun stuff"]

ROFLMAO!
Brilliant, but wouldn't it make Ruby be just a little too much like languages
like Whitespace, Brain**** and the likes?

/Madsen

--
- - - - - - - - - - - - - - + - - - - - - - - - - - - - - +
| Anders K. Madsen
http://lillesvin.linux.dk |
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| There are 10 types of people in the world... |
Those who understand binary - and those who don't.
| - http://bash.org |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
 
Reply With Quote
 
Xiangrong Fang
Guest
Posts: n/a
 
      07-31-2003
Hi,

A programmer's feeling is important to him/herself... It does not mean
that PHP is bad because I think it is bad

I don't know any PHP debugger. I write A LITTLE php directly on Apache
and debug in IE.

Your reason defending the ; is not well established Please note ruby
also support ; if you want to write multiple lines of code on one line.
Javascript also support OPTIONAL ;

So it is better on this regard. By the way, I have never seen a
programmer who write code in Microsoft Word, so, the statement that a ";"
is usuful to the program that it will "survive a word processor" sounds
strange to me.

Shannon


On Thu, 31 Jul 2003 13:33:45 +0900
"(E-Mail Removed)" <(E-Mail Removed)> wrote:

> > I have used PHP... it is Sh*t... mainly because of the ";". A lot of

>
> Have you used a PHP debugger? Or do you just click the refresh button in
> Mozilla? You cant say a language is s**h just because you use ; . In PHP
> the ; is very useful eg.
>
> <h1><?php $result=$db->getOne(); echo $value+$othervalue ?></h1>
>
> as opposed to
>
> <h1><?php
> $result=$db->getOne()
> echo $value+$othervalue
> ?></h1>
>
> "Nothing is more stubborn than a programmer defending a language"
>


--
Xiangrong Fang <(E-Mail Removed)>



 
Reply With Quote
 
maillist@bestworldweb.homelinux.com
Guest
Posts: n/a
 
      07-31-2003

> I don't know any PHP debugger. I write A LITTLE php directly on Apache


http://dd.cron.ru/dbg/

> Your reason defending the ; is not well established Please note ruby
> also support ; if you want to write multiple lines of code on one line.


Maybe so, but then if you care to use the ; in ruby, that defeats your
whole argument that

> > PHP... it is Sh*t... mainly because of the ";". A lot of




 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      07-31-2003

"Arthur" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) om...
> "Gavin Sinclair" <(E-Mail Removed)> wrote in message

news:<60107.203.185.214.34.1059543084.squirrel@web mail.imagineis.com>...
> > > On Tue, 2003-07-29 at 22:30, Robert Klemme wrote:
> > >
> > >> My solution is to use {} for one line blocks and do..end for more
> > >> complicated things.
> > >
> > > I tried this style for a while. But then every time I added lines

to a
> > > one-line block, I had to change {} to do/end.
> > >
> > > Today I normally used {} on all blocks, except in Rake files.

> >
> >
> > My take is: {} are for functional blocks; do..end for procedural

blocks.
> > That shows me which expressions are important for their results, and

which
> > are not.
> >
> > Gavin

>
>
> This sounds very interesting. Can you expand upon this a little?
> What do you take as the difference between procedural blocks and
> funcitonal blocks? Can you provide an example?


I guess he means

(0..10).each do |i|; puts i; end
(0..10).map {|i| i+i}

robert

 
Reply With Quote
 
Fritz Heinrichmeyer
Guest
Posts: n/a
 
      07-31-2003
Xiangrong Fang <(E-Mail Removed)> writes:

> Hi,
>
>
> So it is better on this regard. By the way, I have never seen a
> programmer who write code in Microsoft Word, so, the statement that a ";"
> is usuful to the program that it will "survive a word processor" sounds
> strange to me.


maybe there is a code snippet somewhere at the home of a programmer and
his/her non programming wife/husband sends you the snipped pasted in a
html email or pasted into word as attachment?

Isn't independence of white space treatment also an argument for
SGML, XML?

Of course IMO it can be masochistic to program/write in space ignoring
languages (i.e. XSL).


--
Fritz Heinrichmeyer FernUniversitaet, LG ES, 58084 Hagen (Germany)
tel:+49 2331/987-1166 fax:987-355
 
Reply With Quote
 
Jason Creighton
Guest
Posts: n/a
 
      07-31-2003
On 29 Jul 2003 10:22:38 -0700
http://www.velocityreviews.com/forums/(E-Mail Removed) (Jeff Mitchell) wrote:

> Then screw popularity. We don't need whimsy programmers who are
> attracted to the simulated familiarity which brackets give. Such
> shallow programmers we can do without, thank you.
>
> Then you shall continue basking in the lonely sunshine of relative
> obscurity, secure in your knowledge of what programmers should be
> like. Good luck with all of that.


Okay, I will.

> Exhibit A.
> ----------
> Ruby as it exists presently.


<snip>

> "Oh great another language trying to be different."
>
> "Pascal sucks. I hate the 'end' keyword."
>
> "My editor isn't set up to handle this language. I don't understand
> why they can't just use brackets."
>
> "A garbled mess, looks like. It's confusing without brackets to guide
> my eye."


"If you find this hard to read, maybe you should use a higher
indentation level"

> Exhibit B.
> ----------


<sniped evil bracket example>

> "Wow cool language. I see what's going on immediately."
>
> "I like how it's familiar. My eye is trained to follow brackets, so I
> can size up this code with one glance."
>
> "Hey this looks just like Java! I know Java! I can't wait to start
> using ruby as my no-separate-compile-step language!"
>
> "Dude this is gonna kick perl's ass."


"Wow, this language's syntax is incredibly brain-damaged!"

Seriously, the brackets _do_ make it a _little_ easier to read. But, what if
you had formatted it like so:

class IO
expect(pat,timeout=9999999)
buf = ''
case pat
when String
e_pat = Regexp.new(Regexp.quote(pat))
when Regexp
e_pat = pat
end

while true
if IO.select([self],nil,nil,timeout).nil?
result = nil
break
end

c = getc.chr
buf << c

if $expect_verbose
STDOUT.print c
STDOUT.flush
end

if mat=e_pat.match(buf)
result = [buf,*mat.to_a[1..-1]]
break
end
end

if iterator?
yield result
else
return result
end

nil
end
end

Or what if you used a higher level of indentation?

class IO
def expect(pat,timeout=9999999)
buf = ''
case pat
when String
e_pat = Regexp.new(Regexp.quote(pat))
when Regexp
e_pat = pat
end
while true
if IO.select([self],nil,nil,timeout).nil? then
result = nil
break
end
c = getc.chr
buf << c
if $expect_verbose
STDOUT.print c
STDOUT.flush
end
if mat=e_pat.match(buf) then
result = [buf,*mat.to_a[1..-1]]
break
end
end
if iterator? then
yield result
else
return result
end
nil
end
end

Both options, are, I think, better than adding "brackets". And both can
be done without hacking the interpreter.

> I am being more serious than it may or may not appear. I think ruby
> missed out on a big chance here. It is absurd, but it's true.


I disagree. (The part about it being true, not the part about it being
absurd. )

Jason Creighton
 
Reply With Quote
 
Gavin Sinclair
Guest
Posts: n/a
 
      08-01-2003
>>
>> But then you get some larger ones:
>>
>> set.map { |e|
>> if something
>> e.x
>> else
>> e.y
>> end
>> }

>
> [Robert:]
> Know your ternary operator:
> set.map { |e| something ? e.x : e.y }



I know my ternary operator, but:
- in my code snippet, "something", "e.x", and "e.y" were placeholders
for something far bigger than you or I could imagine
- sometimes there is multi-part processing do be done before arriving
the "return value" for the block

Gavin




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hosting - wildly different response times across the globe badger_nz ASP .Net 1 12-12-2006 04:00 AM
CPU Usage % spikes wildly; system slow overall (IBM T20 laptop, 512 MB RAM) Larry Mehl Computer Support 6 07-07-2006 11:13 PM
Re: Wildly OT:My spampot experiment Robert Moir MCSE 1 05-25-2005 08:46 PM
Re: Wildly OT:My spampot experiment JaR MCSE 1 05-25-2005 07:29 PM
Wildly uneven volume on some DVDs mexican_equivalent@yahoo.com DVD Video 12 04-20-2005 08:26 AM



Advertisments