Forum: Ruby Programming Newbie: Ruby or Java?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
05ee6faa1c1df3e84bf654f8e8838d74?d=identicon&s=25 dabhar1959 (Guest)
on 2005-11-28 22:14
(Received via mailing list)
Thanks for looking!

I'm brand new to programming and had just decided to learn Java as a
first language, then stumbled accross Ruby, which seems far simpler to
learn, but doesn't seem to have as many resources/books etc.

I want to eventually write a Windows program for an Apartment
Management company that will keep track of their buildings
tenants....all their info, lockers, parking stalls, rental monies
owing, that sort of thing.

Will Ruby lead me to being able to do that eventually? I don't want,
nor can afford, to use any programs like Visual Basic that cost wad's
of money. And, I especially like the Open Source/Free program concepts
and community atmospheres.

What do you think?

Thanks so much for your help!
Dab
036a1b88dafaab8ffd73a8b0a74b5b38?d=identicon&s=25 ef (Guest)
on 2005-11-28 22:18
(Received via mailing list)
On Tue, Nov 29, 2005 at 06:12:29AM +0900, Dab wrote:
> I want to eventually write a Windows program for an Apartment
> Management company that will keep track of their buildings
> tenants....all their info, lockers, parking stalls, rental monies
> owing, that sort of thing.

You don't want to write a desktop application.  You want to write a
web application.  Trust me.  It will be easier, and much more flexible
in the long run.

Learn Ruby and Rails and you'll be good to go.

regards,
Ed
49620d9f027b1f200d07be0f079f2093?d=identicon&s=25 walsha2000 (Guest)
on 2005-11-28 22:26
(Received via mailing list)
If you want to get lots of jobs - Java.
If you want to go through life smiling - Ruby.
Yes, keeping track of apartment tenants should be easy with Ruby.
Visual Basic is free - if you download the Express edition of VS2005,
and at this point probably a bit easier than Java, but not as slick as
Ruby.
467c7c87ad5b36859a7644b9198b490a?d=identicon&s=25 leslie (Guest)
on 2005-11-28 22:26
(Received via mailing list)
Dab wrote:

>
>Will Ruby lead me to being able to do that eventually? I don't want,
>nor can afford, to use any programs like Visual Basic that cost wad's
>of money. And, I especially like the Open Source/Free program concepts
>and community atmospheres.
>
>What do you think?
>
>
>
I think that if you learn Ruby as a first language, learning other
languages after that would feel like having your hands
chopped off.

OTOH I'm not sure Ruby is the way to go if you want to produce
a GUI type application very quickly since AFAIK there's nothing
in Ruby that allows the ease of dragging some controls on a form
and setting their properties - like you could do with VB or Delphi.
VB is a terrible language, Delphi at least has some design to it,
I'm sure there's RAD type development environments for Java
although I haven't used them.

So Java is probably what you need - unless someone on the list
knows of a RAD type environment for building fast GUI apps in Ruby.
0276239ca57aee241d4b41379587fa20?d=identicon&s=25 lyle.johnson (Guest)
on 2005-11-28 22:30
(Received via mailing list)
On 11/28/05, Dab <dabhar1959@hotmail.com> wrote:

> I'm brand new to programming and had just decided to learn Java as a
> first language, then stumbled accross Ruby, which seems far simpler to
> learn, but doesn't seem to have as many resources/books etc.

Ruby is going to be far simpler for you to learn than Java. Of course,
you knew I was going to say that, didn't you? ;)

I'm hesitant to give advice about how to learn programming since I've
never taught anyone how to do that. Having said that, a lot of people
recommend "The Poignant Guide to Ruby" (online at
http://www.poignantguide.net/ruby/) as a fun to read Ruby
introduction. (I can vouch for the fun-to-read part; I just don't know
how good it is for teaching someone how to program.)

If you can wait for another month or so, Chris Pine's "Learn to
Program" is supposed to hit the bookshelves in January 2006 (see
http://www.pragmaticprogrammer.com/titles/fr_ltp/index.html). Although
the book's description doesn't explicitly say so, I think it's safe to
assume that Chris is using Ruby as the programming language in his
book.

I also definitely recommend the book "Programming Ruby" (2nd ed.) by
Dave Thomas and friends, although it's not a book for new programmers.

> I want to eventually write a Windows program for an Apartment
> Management company that will keep track of their buildings
> tenants....all their info, lockers, parking stalls, rental monies
> owing, that sort of thing.
>
> Will Ruby lead me to being able to do that eventually? I don't want,
> nor can afford, to use any programs like Visual Basic that cost wad's
> of money. And, I especially like the Open Source/Free program concepts
> and community atmospheres.

You can certainly write such an application with Ruby. At some point
down the road you will need to make some decisions about how users
interact with the program, e.g. whether it's a standalone application
that they run on their PC (such as Microsoft Office) or a Web-based
application that they access through a browser.

But that's not something that you need to decide about at this point.
In either case, Ruby's got you covered (and all with free tools and
software). ;)

Hope this helps,

Lyle
680f75e1d37a4691bf9ae902baf7beee?d=identicon&s=25 christian.leskowsky (Guest)
on 2005-11-28 22:46
(Received via mailing list)
I'm not sure why you guys think Ruby is easier than Java from a "Learn
It"
perspective.  Maybe somebody can elaborate on this.  I don't really see
it.

In any case, something that I can tell you Dab, is that Java is a very
mature language.  Documentation abounds, and the tools are plentiful.
The
ruby community is just beginning to flower.  That's usually a big
consideration for a lot of people.

If you go with Ruby, there are alot of smart, friendly people on this
list
that'll help you out.

Good Luck!

-

Chris
5da4c52f43677f395aff5bde775593c2?d=identicon&s=25 Daniel Schierbeck (dasch)
on 2005-11-28 22:50
(Received via mailing list)
Dab wrote:
>
> Will Ruby lead me to being able to do that eventually? I don't want,
> nor can afford, to use any programs like Visual Basic that cost wad's
> of money. And, I especially like the Open Source/Free program concepts
> and community atmospheres.
>
> What do you think?
>
> Thanks so much for your help!
> Dab
>

Ruby on Rails is definately the way to go. And if you have *any*
questions, you know you can ask them here. Round the clock community
help, mate! Yeah, baby, yeah!


Cheers,
Daniel
0c00d644de3b8bb2f655908c79af25a5?d=identicon&s=25 matt (Guest)
on 2005-11-28 23:02
(Received via mailing list)
On Tue, 29 Nov 2005, Daniel Schierbeck wrote:

> Ruby on Rails is definately the way to go. And if you have *any* questions,
> you know you can ask them here. Round the clock community help, mate! Yeah,
> baby, yeah!

Considering how many highly skilled Ruby programmers are scattered
around
the globe, help is readily available in all timezones.

Also, there's a great IRC channel as well.

>From the description of the problem, Ruby on Rails is probably the easiest
way to go.  If you only want to run on one machine, you can just use a
web
server internal to that system.

-- Matt
Nothing great was ever accomplished without _passion_
0276239ca57aee241d4b41379587fa20?d=identicon&s=25 lyle.johnson (Guest)
on 2005-11-28 23:18
(Received via mailing list)
On 11/28/05, Christian Leskowsky <christian.leskowsky@gmail.com> wrote:

> I'm not sure why you guys think Ruby is easier than Java from a "Learn It"
> perspective.  Maybe somebody can elaborate on this.  I don't really see it.

Well, to be sure, it's a subjective thing. I suppose that when I think
about the overhead that Java imposes for even a simple "Hello, World!"
program (in terms of syntax and system configuration), Ruby wins. But
as I noted, I've never actually been in the position of having to
teach someone else how to program, so it's conjecture on my part.
6e9924028d0737db623332703e3d8888?d=identicon&s=25 tio.a (Guest)
on 2005-11-28 23:22
(Received via mailing list)
>"Will Ruby lead me to being able to do that eventually?"

yes. more quickly, actually, and with more easily maintainable code.

 >"I don't want,nor can afford, to use any programs like Visual Basic"

that's good, because if you did, you'd be depedent on windows being
wherever you wanted to sell/install your product. probably true, but why
take the chance ? i'll avoid editorializing about the limitations of
windows, but you should do your own comparisons about the operating
system that VB applications run on, and the operating systems(nb. thats
plural) that ruby and java run on.


 >"And, I especially like the Open Source/Free program concepts
and community atmospheres. What do you think?"

we like it too.

i think you should learn both: java and ruby. they both have strengths
that you'll probably enjoy mastering. as a confessed brand new
programmer who seems to have an open mind, you should learn at two
languages anyway.

good luck, looking forward to hearing how it turns out.
680f75e1d37a4691bf9ae902baf7beee?d=identicon&s=25 christian.leskowsky (Guest)
on 2005-11-29 00:15
(Received via mailing list)
I see where you're coming from.  I think there may even be a thread over
on
java.net talking about boiler plate code in Java (eg. the new for/in
syntax
in 1.5 was added to get rid of the repetitive iterator blocks).

I wish people wouldn't use lines of code as a metric for the goodness of
Ruby though.  I think Ruby is neat too, but not because I'm typing less.
;p

Take care,

-
Chris
05ee6faa1c1df3e84bf654f8e8838d74?d=identicon&s=25 dabhar1959 (Guest)
on 2005-11-29 00:35
(Received via mailing list)
Wow, thanks for the great feed-back thus far!!

Learn both Ruby and Java? Hmmm--never thought of that! Good idea!

Ruby and Rails---that seems interesting, but if I'm thinking about
marketing my software (my first project idea) eventually, to
independent Apartment complexes/Property Management companies, would
that limit me at all? I'm thinking about creating a Point-of-Sale
program next, to use in Optical Stores.

I like that Ruby is an emerging, blossoming language, despite the
limited resources, compared to Java. A contrarians dream! Maybe I'll be
able to contribute to it's growth, which sounds exciting.

As long as Ruby can enable me to create GUI programs, I'm not too
concerned about having an instantaneous RAD environment (Like NetBean's
for example). My chief objective, after many years of wishin 'n
dreamin, is to learn how to program---to be a programmer---so I can
create, use and maybe market, my own programs.

Based on your responses.....y'all sound like a community I'd love to
join! Again, thank you so much for the tremendous feedback and gracious
welcome!
99220ae31e41fd2aa604cc5f28f0a85b?d=identicon&s=25 rubywanker (Guest)
on 2005-11-29 00:59
(Received via mailing list)
On 11/28/05, Dab <dabhar1959@hotmail.com> wrote:

> Based on your responses.....y'all sound like a community I'd love to
> join! Again, thank you so much for the tremendous feedback and gracious
> welcome!

Just watch out for that Jim Weirich fellow.  He's a troublemaker who
will come to a bad end.  Just mark my words....
5da4c52f43677f395aff5bde775593c2?d=identicon&s=25 Daniel Schierbeck (dasch)
on 2005-11-29 01:28
(Received via mailing list)
Dab wrote:
> I like that Ruby is an emerging, blossoming language, despite the
> join! Again, thank you so much for the tremendous feedback and gracious
> welcome!

You're quite welcome.

By the way, the community spirit here is driving me crazy! I better
start a flamewar to get things balanced... "Python r0xx!!1" :)


Cheers mate, and may your days of programming be as fun as ours have
been
Daniel
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 gregory.t.brown (Guest)
on 2005-11-29 01:48
(Received via mailing list)
On 11/28/05, Dab <dabhar1959@hotmail.com> wrote:
> Thanks for looking!
>
> I'm brand new to programming and had just decided to learn Java as a
> first language, then stumbled accross Ruby, which seems far simpler to
> learn, but doesn't seem to have as many resources/books etc.

I learned Java first.   And I never. Ever. Ever. want to write it again.
Though it does offer a fair balance for some very different
methodologies.

In a sense, Java will enlighten you on just WHY ruby is so much nicer
to work with (in most cases).

> I want to eventually write a Windows program for an Apartment
> Management company that will keep track of their buildings
> tenants....all their info, lockers, parking stalls, rental monies
> owing, that sort of thing.
>
> Will Ruby lead me to being able to do that eventually? I don't want,
> nor can afford, to use any programs like Visual Basic that cost wad's
> of money. And, I especially like the Open Source/Free program concepts
> and community atmospheres.

Yes... that sounds like an ideal RoR project, as others have mentioned.

Also, the Free Software community is alive and well in Ruby, though...
speaking too loudly about the GPL might get a few fingers chopped off.
 ( I seem to be one of the few FSF supporters around here who believes
Stallman is right.   But maybe that's just because of all those email
fights I had with him when he made me feel bad ;) )

> What do you think?

Learn both.   Go as far as you have to in Java and as far as you can in
Ruby. :)
A warm welcome to you, being a ruby nuby is less scary that most other
languages, so you'll probably enjoy your stay. :)
A70b7da5a3a712e800100e61ef8d8917?d=identicon&s=25 akonsu (Guest)
on 2005-11-29 02:00
(Received via mailing list)
Hello,

one thing that might be difficult to learn with no programming
experience is Ruby's meta programming. in this respect Java is easier.
one of the languages that they use in academia to teach programming is
lisp. you might want to take a look at that too. but just to learn
because doing something real in lisp is painful. Ruby is much more
suitable. i think. but in general of course programming is not about
language syntax and semantics...

konstantin
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 james_b (Guest)
on 2005-11-29 02:16
(Received via mailing list)
Dab wrote:
> Thanks for looking!
>  ...
> Will Ruby lead me to being able to do that eventually? I don't want,
> nor can afford, to use any programs like Visual Basic that cost wad's
> of money.

The VB.net/C# SDK is free.  So is SharpDevelop.

Worth a look.

James


--

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 james_b (Guest)
on 2005-11-29 02:24
(Received via mailing list)
ako... wrote:
> Hello,
>
> one thing that might be difficult to learn with no programming
> experience is Ruby's meta programming. in this respect Java is easier.

On the contrary, if you start with a dynamic language such as Ruby,
metaprogramming is much easier to pick up.  Java encourages the idea
that message == method, whereas Ruby teaches you that the message a
client sends to an object need not map to any actual object method, and
how the object handles the message request is none of the client's
business.

Metaprogaming *is* programming.  You just learn it as you would anything
else in Ruby, and it should be a natural part of any program (albeit
where appropriate). It only gets harder if you start off with
misconceptions fostered by other languages.

> one of the languages that they use in academia to teach programming is
> lisp. you might want to take a look at that too. but just to learn
> because doing something real in lisp is painful.

Is this true for people who learn Lisp as their first language?

James
--

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
110a70d754732299d62611743553e05d?d=identicon&s=25 brianm (Guest)
on 2005-11-29 02:44
(Received via mailing list)
This may be anathema on this list, but I suggest neither for a first
language.

Python or Scheme would probably probably best as a first language.

Python:
	Bondage and discipline is not a bad thing when you are first learning.
	Force good whitespace habits
  	Potentially confusing things tend to be drummed out of the language
		Even if very powerful

Scheme
	Encourages good program design
	PLT rocks
	Very little magic while still being full power

It is kind of like learning to ride on a normal bicycle before
getting a 24 speed with a suspension and disk brakes.

-Brian
912c61d9da47754de7039f4271334a9f?d=identicon&s=25 mental (Guest)
on 2005-11-29 03:41
(Received via mailing list)
Quoting James Britt <james_b@neurogami.com>:

> > one of the languages that they use in academia to teach
> > programming is lisp. you might want to take a look at that too.
> > but just to learn because doing something real in lisp is
> > painful.
>
> Is this true for people who learn Lisp as their first language?

They adapt to the pain -- it's mainly just syntactic.  The thing
about Lisp is that the syntax isn't very humane, but you can
certainly get used to it (macros are a powerful incentive to come
to grips with it once you discover their utility).

But that Lisp is actually "hard" is a myth, due mainly to the way in
which the language is usually taught.  Syntax aside, the language is
plenty familiar.  There's nothing magical about it.  It's just that
most Lisp courses are taught on something of a "throw the kid in
the deep end of the lake and he'll learn to swim real quick"
principle.

People get jittery about things like first-class functions because
they're presented as so strange and mystical, but really they
aren't.  What are Ruby blocks, after all?  They're just syntactic
sugar for lambdas.

Ruby is a sly little victory for functional programming, actually.
I mean, what if you told someone that a language had no for loops,
and that instead you had to get by by passing functions to iterator
primitives?

"How can I do anything useful without for loops?!" they would say.
That's a common objection to Scheme, actually (never mind that
Scheme actually does have 'do', which is the same thing).  At that
point many Scheme advocates start talking about recursion, and
people's heads explode.

But then Ruby showed people it was okay.

We don't normally use recursion, but then again neither does
well-written Scheme code for the most part.  In functional
languages when you need recursion you usually want to reserve it
for implementing little combinators (of which 'map', 'loop' and
'each' are simple examples) and then build on top of those.

-mental
Fed88e8dc2798851fdee8bf9c80b8e91?d=identicon&s=25 ssrat (Guest)
on 2005-11-29 03:45
(Received via mailing list)
Christian Leskowsky wrote:
> I'm not sure why you guys think Ruby is easier than Java from a "Learn It"
> perspective.  Maybe somebody can elaborate on this.  I don't really see it.

I've been trying to learn Java, having used Ruby since 1.4.  Someone
says it feels like having your hands chopped off.  This is brutal, but
there is an element of truth in it.

To elaborate, *everything* in Ruby is an object.  This makes everything
simple and elegant - and there are no exceptions.

In Java, there are many things which are *not* objects - one of which
is Integer.  I could see where this would trip up most Smalltalk or
Ruby programmers right up front - or anyone who expects things to all
act in the same way.

The other big problem with Java is its license.  Ever wonder why no
open source distribution such as Debian or Fedora has Java?  Its the
license....
Ef48af8b07b976160c860ddec9aea55f?d=identicon&s=25 cameron.matheson (Guest)
on 2005-11-29 03:49
(Received via mailing list)
Hi,

On 11/28/05, Leslie Viljoen <leslie@camary.co.za> wrote:
> OTOH I'm not sure Ruby is the way to go if you want to produce
> a GUI type application very quickly since AFAIK there's nothing
> in Ruby that allows the ease of dragging some controls on a form
> and setting their properties - like you could do with VB or Delphi.
> VB is a terrible language, Delphi at least has some design to it,
> I'm sure there's RAD type development environments for Java
> although I haven't used them.

You can do this w/ ruby and libglade... but that only applies to the
*nix'es as far as i know.

Cam
Cfd2734f1de31db479ec2a8a4ecbd649?d=identicon&s=25 rictic (Guest)
on 2005-11-29 07:19
(Received via mailing list)
On 11/28/05, Christian Leskowsky <christian.leskowsky@gmail.com> wrote:
> Chris
>

Lines of code can be a predictor of the number of things that the
language requires the programmer to deal with.  The obvious gripe with
Java here is that it requires all programs to be classes, thus making
even a simple hello world program five lines long with all sorts of
crazy black box code.  I think it could be a detriment to a new
programmer to have to put in so much voodoo code.  It makes the system
seem strange and unapproachable.  The questions I always had when I
was learning Java as a newbie programmer like "Why do I have to put
static in front of my functions?" bothered me, especially when I
couldn't understand word one of the answers to them.

Ruby is nice in the context of just learning to program because you
can generally approach one concept at a time.  I also find ruby to be
generally more readable, and that is very useful when all of the
concepts are still so new and foreign.

I think that a new programmer would feel as though they understood
more of their code when writing in ruby.  If that leads one to play
around and try stuff out more, then that's a huge win, because
experimenting and seeing what happens is (for me at least) the single
best way to really, truly learn something.
8979474815030ad4a5d59718d1905715?d=identicon&s=25 igouy (Guest)
on 2005-11-29 07:43
(Received via mailing list)
mental@rydia.net wrote:
> about Lisp is that the syntax isn't very humane, but you can
> People get jittery about things like first-class functions because
> That's a common objection to Scheme, actually (never mind that
> Scheme actually does have 'do', which is the same thing).  At that
> point many Scheme advocates start talking about recursion, and
> people's heads explode.
>
> But then Ruby showed people it was okay.

Smalltalk?
A7c9c275318af9e1e3812fab9660cd7c?d=identicon&s=25 jeff.darklight (Guest)
on 2005-11-29 08:19
(Received via mailing list)
If lines of code were the winning factor, people would almost always use
perl for all of its infamous one-liner line-noise solutions to things...

j.

On 11/28/05, Peter Burns <rictic@gmail.com> wrote:
> less.  ;p
> even a simple hello world program five lines long with all sorts of
> concepts are still so new and foreign.
>
> I think that a new programmer would feel as though they understood
> more of their code when writing in ruby.  If that leads one to play
> around and try stuff out more, then that's a huge win, because
> experimenting and seeing what happens is (for me at least) the single
> best way to really, truly learn something.
>
>


--
"Remember. Understand. Believe. Yield! -> http://ruby-lang.org"

Jeff Wood
280b41a88665fd8c699e83a9a25ef949?d=identicon&s=25 steve (Guest)
on 2005-11-29 08:23
(Received via mailing list)
On Nov 28, 2005, at 10:40 PM, Jeff Wood wrote:

> If lines of code were the winning factor, people would almost
> always use
> perl for all of its infamous one-liner line-noise solutions to
> things...

May not be a "winning factor", but certainly a factor.

++Pascal

--Steve
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 joevandyk (Guest)
on 2005-11-29 08:23
(Received via mailing list)
On 11/28/05, Jeff Wood <jeff.darklight@gmail.com> wrote:
> If lines of code were the winning factor, people would almost always use
> perl for all of its infamous one-liner line-noise solutions to things...

Can't you use Ruby in place of Perl for all those one-liner line-noise
solutions?
Cfd2734f1de31db479ec2a8a4ecbd649?d=identicon&s=25 rictic (Guest)
on 2005-11-29 08:47
(Received via mailing list)
On 11/29/05, Jeff Wood <jeff.darklight@gmail.com> wrote:
> If lines of code were the winning factor, people would almost always use
> perl for all of its infamous one-liner line-noise solutions to things...
>
> j.
>

Very true.  Succinctness and readability are both key.  Luckily ruby
excels at both.
680f75e1d37a4691bf9ae902baf7beee?d=identicon&s=25 christian.leskowsky (Guest)
on 2005-11-29 12:59
(Received via mailing list)
Hehe...  The thing that probably makes Ruby a little more readable for
me is
that I can see more of a program on a single screen  :).

I don't know if the perfect learner language even exists or what it
would
look like if it did.  Every language seems to have its own skeletons and
quirks.  I wonder if life would've been easier for me if I started with
something like Ruby (it would've been Perl given the timing).

Then again, so much of learning is dependant on the learner.

Take care,

-

Chris




On 11/29/05, Peter Burns <rictic@gmail.com> wrote:
> was learning Java as a newbie programmer like "Why do I have to put
> around and try stuff out more, then that's a huge win, because
> experimenting and seeing what happens is (for me at least) the single
> best way to really, truly learn something.
>
>


--
-

'There was an owl lived in an oak.
The more he heard, the less he spoke.
The less he spoke, the more he heard.'

Christian Leskowsky
christian.leskowsky@gmail.com
912c61d9da47754de7039f4271334a9f?d=identicon&s=25 mental (Guest)
on 2005-11-29 15:49
(Received via mailing list)
Quoting Isaac Gouy <igouy@yahoo.com>:

> > But then Ruby showed people it was okay.
>
> Smalltalk?

That's where blocks came from, yes.  But Smalltalk never caught on,
at least not to the degree that Ruby has.

There isn't much unique to Ruby at all -- it's just very well
put-together, and has successfully popularized a lot of concepts
that have previously not been a significant part of "mainstream"
programming.

-mental
8979474815030ad4a5d59718d1905715?d=identicon&s=25 igouy (Guest)
on 2005-11-29 17:14
(Received via mailing list)
mental@rydia.net wrote:
> Quoting Isaac Gouy <igouy@yahoo.com>:
>
> > > But then Ruby showed people it was okay.
> >
> > Smalltalk?
>
> That's where blocks came from, yes.  But Smalltalk never caught on,
> at least not to the degree that Ruby has.

Do you have any evidence for
1) How much Smalltalk caught on
2) How much Ruby has caught on?
6d9bf78ca49a017e9e3e6b0357b6c59e?d=identicon&s=25 peter (Guest)
on 2005-11-29 17:30
(Received via mailing list)
mental@rydia.net wrote:

>But Smalltalk never caught on,
>at least not to the degree that Ruby has.
>
>There isn't much unique to Ruby at all -- it's just very well
>put-together, and has successfully popularized a lot of concepts
>that have previously not been a significant part of "mainstream"
>programming.
>
>-mental
>
What are you talking about. In what way has smalltalk never caught on?

Now Modula3, Oberon and ABC could be said to have never caught on
(despite ABC being one of the predecessors of Python). But smalltalk?
Extraordinary claims require extraordinary evidence. Sir what proof do
you have?
912c61d9da47754de7039f4271334a9f?d=identicon&s=25 mental (Guest)
on 2005-11-29 18:59
(Received via mailing list)
Quoting Peter Hickman <peter@semantico.com>:

> mental@rydia.net wrote:
>
> > But Smalltalk never caught on, at least not to the degree that
> > Ruby has.

> What are you talking about. In what way has smalltalk never
> caught on?

I should never have phrased it that way.  Read it as "I think
Smalltalk never caught on to the degree that Ruby has."

Which is still a pretty sloppy and radical claim (mea culpa), but
not so inadvertantly inflammatory.

It also needs to be read in the context of the original post,
concerned with the evangelization of certain functional programming
techniques.  I didn't intend to invoke popularity contests like TPCI
or the infamous and unscientific "google test".

My thesis is that Ruby (for whatever reasons) has "caught on better"
in the sense that it's attracted a much wider spectrum of
programmers than Smalltalk.

My impression of Smalltalk programmers is that they tend come from
more "functional-literate" backgrounds, so blocks are not such a
new thing for most of them.  By contrast, I get the sense that new
Ruby programmers are represented by a much broader bell curve when
it comes to FP.

I'm guessing you've got a significant Smalltalk background (I don't,
though I'm basically literate in it) -- based on your own
experience, do you think this is accurate?

It'd be interesting to have a real, scientific, survey, but I'm not
sure how one would go about conducting one in this case.

-mental
8979474815030ad4a5d59718d1905715?d=identicon&s=25 igouy (Guest)
on 2005-11-29 19:56
(Received via mailing list)
mental@rydia.net wrote:
> I should never have phrased it that way.  Read it as "I think
> My thesis is that Ruby (for whatever reasons) has "caught on better"
> in the sense that it's attracted a much wider spectrum of
> programmers than Smalltalk.
>
> My impression of Smalltalk programmers is that they tend come from
> more "functional-literate" backgrounds, so blocks are not such a
> new thing for most of them.  By contrast, I get the sense that new
> Ruby programmers are represented by a much broader bell curve when
> it comes to FP.

iirc the main alternatives to Smalltalk were C++ and 4GLs

The folk learning Smalltalk range from experienced procedural
programmers to non-programmers:

IBM implemented Smalltalk across a wide range of hardware, and trained
their consulting staff.

The Open University used Smalltalk to teach programming to 5,000-8,000
students a year (for about a decade, they switch to Java in 2006).
912c61d9da47754de7039f4271334a9f?d=identicon&s=25 mental (Guest)
on 2005-11-29 20:16
(Received via mailing list)
Quoting Isaac Gouy <igouy@yahoo.com>:

> Java in 2006).
Wow, ok.

I'd have to say that's a bit more "catching on" than Ruby's done to
date, in any sense of the term.

I see I've rather flagrantly displayed my youth and ignorance of
history, then.  Oops.

-mental
A52b0e1c5d982f2512a03c5dbfd033d6?d=identicon&s=25 rasputnik (Guest)
on 2005-11-29 21:41
(Received via mailing list)
On 28/11/05, Dab <dabhar1959@hotmail.com> wrote:
> Thanks for looking!
>
> I'm brand new to programming and had just decided to learn Java as a
> first language, then stumbled accross Ruby, which seems far simpler to
> learn, but doesn't seem to have as many resources/books etc.

You make that sound like a bad thing :

http://www.garbett.org/upload/books.jpg


_why has been busy again. Have a look at:

http://tryruby.hobix.com/

then the poignant guide and chris pines 'learn to program' (both a
google
away).

I wouldn't recommend the pickaxe to programming noobs since IMO its
not for total beginners to OOP and programming.
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 james_b (Guest)
on 2005-11-29 22:50
(Received via mailing list)
Dick Davies wrote:
>
> http://www.garbett.org/upload/books.jpg


http://ruby-doc.org/bookstore/



In general,

http://ruby-doc.org/

James


--

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
4b174722d1b1a4bbd9672e1ab50c30a9?d=identicon&s=25 leavengood (Guest)
on 2005-11-29 22:50
(Received via mailing list)
On 11/29/05, mental@rydia.net <mental@rydia.net> wrote:
>
> Wow, ok.
>
> I'd have to say that's a bit more "catching on" than Ruby's done to
> date, in any sense of the term.

Not really. Universities regularly teach things that students will
never use in the real world. Before switching to Java my university
taught the basic CS course using Scheme. I also learned Lisp for my AI
class. Yet I certainly don't see a ton of people using those
languages, and I certainly don't see many jobs asking for experience
in those languages. I'm not saying this to belittle those languages,
but the reality is that the real world and universities don't always
match up.

Ryan
8979474815030ad4a5d59718d1905715?d=identicon&s=25 igouy (Guest)
on 2005-11-30 02:08
(Received via mailing list)
Ryan Leavengood wrote:
> On 11/29/05, mental@rydia.net <mental@rydia.net> wrote:
> >
> > Wow, ok.
> >
> > I'd have to say that's a bit more "catching on" than Ruby's done to
> > date, in any sense of the term.
>
> Not really.

Do you have any evidence for
1) How much Smalltalk caught on
2) How much Ruby has caught on?
4b174722d1b1a4bbd9672e1ab50c30a9?d=identicon&s=25 leavengood (Guest)
on 2005-11-30 06:10
(Received via mailing list)
On 11/29/05, Isaac Gouy <igouy@yahoo.com> wrote:
>
> Do you have any evidence for
> 1) How much Smalltalk caught on
> 2) How much Ruby has caught on?

Well if you ask the average grunt programmer born and raised on C++ or
Java about Smalltalk or Ruby he or she will probably just say "What?"
But I think there is a greater chance that person has heard of Ruby,
especially because of all the noise about Rails lately.

While certainly not scientific, a Google search for "smalltalk"
returns about 4.8 million results, whereas a search for "ruby" returns
41.8 million. Now you might scoff and say "well ruby is also a
precious gem." OK, then let's try "ruby language": 7.1 million
results. Using "smalltalk language" returns 2.1 million. As another
comparison, "java language" returns 70 million results, "c++ language"
returns 26.1 million and "python language" returns 22.2 million.

Overall a Google search seems to be a pretty good indicator of
language popularity, so Ruby is 3.5 times more popular than Smalltalk.

Ryan
8979474815030ad4a5d59718d1905715?d=identicon&s=25 igouy (Guest)
on 2005-11-30 09:20
(Received via mailing list)
Ryan Leavengood wrote:
>
>
> Ryan

You might have more luck searching for VisualWorks, VisualAge,
Resilient,...

If we took your evidence at face value then we might say Ruby has 3.5
times more mentions than Smalltalk, a decade after the peak of
Smalltalk popularity - being mentioned is good, but it isn't the same
as being used and only the barest first step towards "catching on" :-)
4b174722d1b1a4bbd9672e1ab50c30a9?d=identicon&s=25 leavengood (Guest)
on 2005-11-30 17:10
(Received via mailing list)
On 11/30/05, Isaac Gouy <igouy@yahoo.com> wrote:
>
> You might have more luck searching for VisualWorks, VisualAge,
> Resilient,...
>
> If we took your evidence at face value then we might say Ruby has 3.5
> times more mentions than Smalltalk, a decade after the peak of
> Smalltalk popularity - being mentioned is good, but it isn't the same
> as being used and only the barest first step towards "catching on" :-)

You are right of course. I don't think any real determination can be
made on how prevalent Ruby and Smalltalk are at the moment. But as you
say the peak of Smalltalk popularity was a decade ago (and Ruby was
non-existent), so one might be able to guess that at this point Ruby
is slightly more popular than Smalltalk. Either way I don't think it
matters much anyhow: in the end I say program in whatever language you
wish, and if it helps you solve the problems you are working on, then
that is the language for you.

Ryan
3eda6fcd3204ef285fa52176c28c4d3e?d=identicon&s=25 none (Guest)
on 2005-11-30 20:45
(Received via mailing list)
> VB is a terrible language, Delphi at least has some design to it,
> I'm sure there's RAD type development environments for Java
> although I haven't used them.

VB.Net is a great language... just look at how many people are using it,
and
liking it.
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 james_b (Guest)
on 2005-11-30 21:10
(Received via mailing list)
Aemca wrote:
>>VB is a terrible language, Delphi at least has some design to it,
>>I'm sure there's RAD type development environments for Java
>>although I haven't used them.
>
>
> VB.Net is a great language... just look at how many people are using it, and
> liking it.

Every so often I poke around with SharpDevelop, a free, open-source IDE
for VB.net and C#.  Plays well with both Mono and the MS .Net SDK.  It
makes creating C# GUI apps so simple I wonder why people would bother
with VB.net.

James

--

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
7264fb16beeea92b89bb42023738259d?d=identicon&s=25 chneukirchen (Guest)
on 2005-12-01 15:04
(Received via mailing list)
James Britt <james_b@neurogami.com> writes:

> bother with VB.net.
The difference is syntactic-sugar only, anyway, no?
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 james_b (Guest)
on 2005-12-01 19:12
(Received via mailing list)
Christian Neukirchen wrote:
>>>it, and liking it.
>>
>>Every so often I poke around with SharpDevelop, a free, open-source
>>IDE for VB.net and C#.  Plays well with both Mono and the MS .Net SDK.
>>It makes creating C# GUI apps so simple I wonder why people would
>>bother with VB.net.
>
>
> The difference is syntactic-sugar only, anyway, no?

Um, I'm not really sure, as I haven't spent that much time with either,
but  believe that C# either things not readily available in VB.net.  But
maybe it "just" syntax.

I found this after some Googling:

http://www.codinghorror.com/blog/archives/000128.html

"However, I was disappointed that Dan didn't cover the way his
prediction in the original eBook has come true-- as nonsensical as it
may seem, C# developers are paid more than VB.Net developers to write
the very same .NET framework code."


So, maybe one should learn C# over VB.net because people will think
better of you and pay you better.

:)


James
--

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
Fbe95e85884a838cc789d3575380dccb?d=identicon&s=25 chris.irish (Guest)
on 2005-12-02 23:56
(Received via mailing list)
Ryan Leavengood wrote:

>Not really. Universities regularly teach things that students will
>
>
"""the reality is that the real world and universities don't always
match up."""

I'm a current CS student at ASU (arizona, US) and this statement is SO
true. :/
Besides learning Java, C, & C++... I've had to learn Lisp/Scheme and
Prolog.  I mean who uses Prolog??  It's basically dead.
School teaches theory mostly.
Experience teaches you the rest I guess.
7cf9493614c47ce48f8a56407a050085?d=identicon&s=25 mrkode (Guest)
on 2005-12-03 00:08
(Received via mailing list)
you're not learning the languages so that you can use them later on. you
learn them so that you understand how to program.
Dd54c22454b4e3c21cadf3bdb5192e28?d=identicon&s=25 kero (Guest)
on 2005-12-03 00:20
(Received via mailing list)
> """the reality is that the real world and universities don't always
> match up."""
>
> I'm a current CS student at ASU (arizona, US) and this statement is SO true. :/
> Besides learning Java, C, & C++... I've had to learn Lisp/Scheme and Prolog.  I mean who 
uses Prolog??  It's basically dead.
> School teaches theory mostly.
> Experience teaches you the rest I guess.

If schools/universities don't teach theory, who does?

Learn from prolog (or any other language for that matter) what it
offers,
then apply it everywhere you like.

Kero.
E2bbe31fb94e92f5f404c5cb550c371f?d=identicon&s=25 david (Guest)
on 2005-12-03 00:24
(Received via mailing list)
Quoting Chris Irish <chris.irish@libertydistribution.com>:

> """the reality is that the real world and universities don't always
> match up."""
>
> I'm a current CS student at ASU (arizona, US) and this statement is
> SO true. :/
> Besides learning Java, C, & C++... I've had to learn Lisp/Scheme and
> Prolog.  I mean who uses Prolog??  It's basically dead.
> School teaches theory mostly.
> Experience teaches you the rest I guess.
>

I went to a private college also in Phoenix, AZ - UAT.  There the
carriculum
focused almost exclusively on marketable skills with a few theory
electives and
advanced classes here and there (OS design, compiler design, assembly).
I
graduated having only been exposed to Assembly/C/C++/Java and the MS
languages.
  On my own I had studied Python and Javascript so I knew there was
something
"not C" out there but from the education at this school you never would
have
know it.  On my own I've taken the time to learn some Lisp (Scheme
really) and
Smalltalk and it has been really useful even though I don't program in
either
for "real" work.  I think ASU making Scheme part of the carriculum is
fantastic
even if you can't see the benefits right at the moment.  Take it from me
that
closures and blocks make a lot more sense with a little Lisp/Smalltalk
mixed in
rather than coming straight from a "practical" language background.

my $.02

David Koontz
280b41a88665fd8c699e83a9a25ef949?d=identicon&s=25 steve (Guest)
on 2005-12-03 01:21
(Received via mailing list)
Chris Irish wrote:
> Prolog.  I mean who uses Prolog??  It's basically dead.

It's still useful, and definitely still used.

Regardless, as another poster expressed, it's a good exercise to learn
it.  It's the type of thing that, IME, gives you an edge over all of the
others.  But, if I see it on your resume, I'm going to ask you about it.

--Steve
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 james_b (Guest)
on 2005-12-03 01:49
(Received via mailing list)
Chris Irish wrote:
> """the reality is that the real world and universities don't always
> match up."""
>
> I'm a current CS student at ASU (arizona, US) and this statement is SO
> true. :/
> Besides learning Java, C, & C++... I've had to learn Lisp/Scheme and
> Prolog.  I mean who uses Prolog??  It's basically dead.
> School teaches theory mostly.
> Experience teaches you the rest I guess.


Perhaps you should be pursuing vocational training instead of a college
degree.   Lots cheaper, more practical.

I would *really* like to believe that having experience with Lisp and
Prolog will make you a better programmer, even if you are not using a
functional or logic language.


Spending some time with a variety of programming languages is important
for the same reason one should learn a foreign (natural) language and
read fictional literature:  It helps you understand and imagine how
things might otherwise be, which is essential for understanding what is.


James Britt

--

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
D371adbc511817d3b11a293adaa08651?d=identicon&s=25 mekly (Guest)
on 2005-12-03 02:06
(Received via mailing list)
> """the reality is that the real world and universities don't always
> match up."""
>
> I'm a current CS student at ASU (arizona, US) and this statement is SO true. :/
> Besides learning Java, C, & C++... I've had to learn Lisp/Scheme and Prolog.
> I mean who uses Prolog??  It's basically dead.
> School teaches theory mostly.
> Experience teaches you the rest I guess.

Many problems in "the real world" (planning, scheduling, etc.) are not
so easy to handle in the "living" languages like Java or C++.
So, universities are trying to prepare you for "the real world."
In many cases a "dead" language like Prolog might be of great
help. Of course, it's difficult to give here a non-trivial, industry-
specific example (need background). So, below is a five star puzzle
solved in GNU Prolog/CLP(FD). I'd love to see how to solve it in any of
those practical languages.

Best Regards,
Leon
---------------------------------------------------------------

% Chess Tournament Logic Problem

% http://www.geocities.com/Heartland/Plains/4484/lp9705.htm

% Copyright © 1997 William T. Pelletier

% Stars: 5

% During the final round of Georgia's All-State Chess Tournament,

% the eventual top 4 finishers in the tournament played their final

% game against 4 different opponents. The tournament boards were

% numbered from 1 to 50 to facilitate location and identification

% of games. Each of the top 4 finishers played a different opening

% in this last game. Use the clues below to determine the first and last

% names of the first through fourth place winners of the tournament,

% the chess opening each used in his last game, and the number of the

% chess board on which he played his final game.

% 1. Mr. Hart played the King's Indian Defence.

% 2. Steve placed ahead of the one who used the Ruy Lopez opening.

% 3. The top 4 players were Larry, Mr. Korn, the contestant who opened

%    with Queen's Gambit, and a player who played on an even-numbered
board.

% 4. Mr. Rose finished exactly 2 places ahead of the player on board 31.

% 5. The number of the 3rd place winner's board is at least 10 higher or

%    at least 10 lower than that of Mr. Baird.

% 6. The number of the board of the contestant who placed immediately

%    after Bert is exactly 15 higher than the number of the board played

%    by the one who placed immediately before Tom.

% 7. The lowest board number of the top 4 finishers was exactly half the

%    number of the board played by the one who placed immediately after

%    the one who played the Giuoco Piano opening.

% 8. The highest board number was exactly 8 higher than the board number

%    of the man who finished exactly two places after Bert.

% Answer:

% PLACE   1ST NAME  SURNAME  OPENING          BOARD

% First   Steve     Rose     Queen's Gambit   #40

% Second  Bert      Baird    Ruy Lopez        #16

% Third   Tom       Korn     Giuoco Piano     #31

% Fourth  Larry     Hart     King's Indian    #32

%
-----------------------------------------------------------------------



% GNU Prolog CLP(FD) solution by Leon J. Mekly - 2/20/05



chess :-



   % Chess Board numbers - first through fourth place

   Bs = [B1,B2,B3,B4],

   fd_domain(Bs,1,50),

   fd_all_different(Bs),



   % List of players p(Place,Fname,Lname,Opening,BoardNumber)

   PBs = [ p(1,_,_,_,B1),

           p(2,_,_,_,B2),

           p(3,_,_,_,B3),

           p(4,_,_,_,B4) ],



   % First Name Places (FNPs)

   FNPs = [Pbert,Plarry,Psteve,Ptom],

   fd_domain(FNPs,1,4),

   fd_all_different(FNPs),



   % Last Name Places (LNPs)

   LNPs = [Pbaird,Phart,Pkorn,Prose],

   fd_domain(LNPs,1,4),

   fd_all_different(LNPs),



   % Opening Places (OPs)

   OPs = [Pgambit,Pindian,Plopez,Ppiano],

   fd_domain(OPs,1,4),

   fd_all_different(OPs),



   Names = [

     p(Pbert,bert,_,_,_),

     p(Plarry,larry,_,_,_),

     p(Psteve,steve,_,_,_),

     p(Ptom,tom,_,_,_),



     p(Pbaird,_,baird,_,_),

% 1. Mr. Hart played the King's Indian Defence.

     p(Phart,_,hart,indian,_),

     p(Pkorn,_,korn,_,_),

     p(Prose,_,rose,_,_),



     p(Pgambit,_,_,gambit,_),

     p(Pindian,_,hart,indian,_),

     p(Plopez,_,_,lopez,_),

     p(Ppiano,_,_,piano,_) ],



     Phart #= Pindian,



% 2. Steve placed ahead of the one who used the Ruy Lopez opening.



     Psteve #< Plopez, Psteve #< 4,

     Psteve #= 1 #<=> Plopez #= 2 #\/  Plopez #= 3 #\/  Plopez #= 4,

     Psteve #= 2 #<=> Plopez #= 3 #\/  Plopez #= 4,

     Psteve #= 3 #<=> Plopez #= 4,



% 3. The top 4 players were Larry, Mr. Korn, the contestant who opened

%    with Queen's Gambit, and a player who played on an even-numbered
board.



     fd_domain(Bx,1,50),

     fd_all_different([Plarry,Pkorn,Pgambit,Bx]),

     Plarry+Pkorn+Pgambit #= 9 #<=> Bx #= B1 #/\ B1 rem 2 #= 0,

     Plarry+Pkorn+Pgambit #= 8 #<=> Bx #= B2 #/\ B2 rem 2 #= 0,

     Plarry+Pkorn+Pgambit #= 7 #<=> Bx #= B3 #/\ B3 rem 2 #= 0,

     Plarry+Pkorn+Pgambit #= 6 #<=> Bx #= B4 #/\ B4 rem 2 #= 0,



% 4. Mr. Rose finished exactly 2 places ahead of the player on board 31.



     Prose #< 3,

     Prose #= 1 #<=> B3 #= 31,

     Prose #= 2 #<=> B4 #= 31,



% 5. The number of the 3rd place winner's board is at least 10 higher or

%    at least 10 lower than that of Mr. Baird.



     Pbaird #\= 3,

     Pbaird #= 1 #<=> B3 #>= B1 + 10 #\/  B3 #=< B1 - 10,

     Pbaird #= 2 #<=> B3 #>= B2 + 10 #\/  B3 #=< B2 - 10,

     Pbaird #= 4 #<=> B3 #>= B4 + 10 #\/  B3 #=< B4 - 10,



% 6. The number of the board of the contestant who placed immediately

%    after Bert is exactly 15 higher than the number of the board played

%    by the one who placed immediately before Tom.



     Pbert #< 4, Ptom  #> 1,

     Pbert #= 1 #<=> B2#=B1+15 #\/  B2#=B3+15,

     Pbert #= 2 #<=> B3#=B2+15,

     Pbert #= 3 #<=> B4#=B1+15 #\/  B4#=B3+15,



% 7. The lowest board number of the top 4 finishers was exactly half the

%    number of the board played by the one who placed immediately after

%    the one who played the Giuoco Piano opening.



     Ppiano #< 4,

     Ppiano #= 3 #<=> B4#=B1+B1 #/\ B1#<B2 #/\ B1#<B3

                 #\/  B4#=B2+B2 #/\ B2#<B1 #/\ B2#<B3

	         #\/  B4#=B3+B3 #/\ B3#<B1 #/\ B3#<B2,



     Ppiano #= 2 #<=> B3#=B1+B1 #/\ B1#<B2 #/\ B1#<B4

                 #\/  B3#=B2+B2 #/\ B2#<B1 #/\ B2#<B4

	         #\/  B3#=B4+B4 #/\ B4#<B1 #/\ B4#<B2,



     Ppiano #= 1 #<=> B2#=B1+B1 #/\ B1#<B3 #/\ B1#<B4

                 #\/  B2#=B3+B3 #/\ B3#<B1 #/\ B3#<B4

	         #\/  B2#=B4+B4 #/\ B4#<B1 #/\ B4#<B3,



% 8. The highest board number was exactly 8 higher than the board number

%    of the man who finished exactly two places after Bert.



     Pbert #< 3,

     Pbert #= 1 #<=> B1 #= B3 + 8 #/\ B1#>B2 #/\ B1#>B4

                #\/  B2 #= B3 + 8 #/\ B2#>B1 #/\ B2#>B4

		#\/  B4 #= B3 + 8 #/\ B4#>B1 #/\ B4#>B2,



     Pbert #= 2 #<=> B1 #= B4 + 8 #/\ B1#>B2 #/\ B1#>B3

                #\/  B2 #= B4 + 8 #/\ B2#>B1 #/\ B2#>B3

		#\/  B3 #= B4 + 8 #/\ B3#>B1 #/\ B3#>B2,



     listVars([FNPs,LNPs,OPs,Bs],[],VarList),

     fd_labelingff(VarList),



     match(Names,PBs),

     (member(P,PBs),write(P),nl,fail ; true).



listVars([],L,L).

listVars([L|Ls],T,Flat) :-

     append(L,T,NT),

     listVars(Ls,NT,Flat).



match([],_).

match([P|Ps],Bs) :-

     member(P,Bs),

     match(Ps,Bs).
2ee1a7960cc761a6e92efb5000c0f2c9?d=identicon&s=25 w_a_x_man (Guest)
on 2005-12-03 21:50
(Received via mailing list)
mekly wrote:
> so easy to handle in the "living" languages like Java or C++.
>
> % names of the first through fourth place winners of the tournament,
> %    after Bert is exactly 15 higher than the number of the board played
> % Third   Tom       Korn     Giuoco Piano     #31
> % Fourth  Larry     Hart     King's Indian    #32
> % -----------------------------------------------------------------------

I think that your answer is wrong.  There are 3 solutions:

1. Steve  Baird  Giuoco Piano    12
2. Bert   Rose   Queen's Gambit  24
3. Tom    Korn   Ruy Lopez       39
4. Larry  Hart   King's Indian   31

1. Steve  Rose   Giuoco Piano     8
2. Bert   Baird  Queen's Gambit  16
3. Tom    Korn   Ruy Lopez       31
4. Larry  Hart   King's Indian   23

1. Steve  Rose   Queen's Gambit  40
2. Bert   Baird  Ruy Lopez       16
3. Tom    Korn   Giuoco Piano    31
4. Larry  Hart   King's Indian   32

Evidently Prolog isn't well suited for logic problems.  I wonder
what it is good for.

Here's a Ruby program.


NAME, SURNAME, OPENING, BOARD = *(0..3)
Names = %w(Steve Larry Tom Bert)
Surnames = %w(Baird Hart Korn Rose)
Openings = %w(Ruy\ Lopez  King's\ Indian  Giuoco\ Piano
  Queen's\ Gambit)


class Array
  def permute(prefixed=[])
    if (length < 2)
      yield(prefixed + self)
    else
      each_with_index { |e, i|
        (self[0,i]+self[(i+1)..-1]).permute(prefixed+[e]) {|a|
          yield a }
      }
    end
  end

  def find_row( column, string )
    self[column].index(string)
  end
  def get( column_a, string, column_b )
    self[ column_b][ self.find_row( column_a, string) ]
  end
end

module Combine
   def Combine.pick(pick, items, &block)
     combine([], 0, pick, items, &block)
   end

   private

   def Combine.combine(set, index, pick, items, &block)
     if pick == 0 or index == items.length
       yield set
     else
       set.push(items[index])
       combine(set, index + 1, pick - 1, items, &block)
       set.pop
       combine(set, index + 1, pick, items, &block) if
         pick < items.length - index
     end
   end
end


Names.permute{|names|
  Surnames.permute{|surnames|
    Openings.permute{|openings|

      boards = [ names, surnames, openings, [] ]


# 1. Mr. Hart played the King's Indian Defence.

      next unless "King's Indian"==boards.get(SURNAME,'Hart',OPENING)

# 2. Steve placed ahead of the one who used the Ruy Lopez opening.

      next unless boards.find_row(NAME,'Steve') <
        boards.find_row(OPENING, 'Ruy Lopez' )


# 3. The top 4 players were Larry, Mr. Korn, the contestant who
#    opened with Queen's Gambit, and a player who played on an
#    even-numbered board.

      remaining = Array(0..3) - [ boards.find_row(NAME,'Larry'),
        boards.find_row(SURNAME, 'Korn'),
        boards.find_row(OPENING, "Queen's Gambit" ) ]
      next if remaining.size != 1
      ## ... to be continued ...


#       Combine.pick( 4, Array(1..50) ){ |board_nums|
      ## I reduced the range for speed's sake.
      Combine.pick( 4, Array(8..40) ){ |board_nums|

        ##  Skip board-number combination if it obviously
        ##  isn't up to snuff.
        next if !board_nums.index(31)
        max, min = board_nums.last, board_nums.first
        next if max - min < 15  or max/min < 2
        next if not board_nums.index( min * 2 )
        diffs = []
        (board_nums.size-1).times{|i|
          (i.succ ... board_nums.size).each{|j|
            diffs << board_nums[j] - board_nums[i]
          }
        }
        next if !diffs.index(15) or !diffs.index(8)


        board_nums.permute{ |board_nums_perm|

          boards[-1] = board_nums_perm


          ## ... continued from above.
          next if boards[BOARD][ remaining.first ] % 2 > 0

# 4. Mr. Rose finished exactly 2 places ahead of the player
#    on board 31.

          next unless boards[BOARD].index(31)
          next unless -2 == boards.find_row(SURNAME,'Rose') -
            boards.find_row(BOARD,31)

# 5. The number of the 3rd place winner's board is at least 10 higher
#    or at least 10 lower than that of Mr. Baird.

          next unless 10 <= (boards[BOARD][2] -
            boards.get(SURNAME,'Baird',BOARD)).abs

# 6. The number of the board of the contestant who placed
#    immediately after Bert is exactly 15 higher than the number of
#    the board played by the one who placed immediately before Tom.

          num1 = boards[BOARD][ boards.find_row(NAME,'Bert') + 1]
          num2 = boards[BOARD][ boards.find_row(NAME,'Tom') - 1]
          next if !num1 or !num2 or 15 != num1 - num2


# 7. The lowest board number of the top 4 finishers was exactly
#    half the number of the board played by the one who placed
#    immediately after the one who played the Giuoco Piano opening.

          num = boards[BOARD][ boards.find_row(OPENING,
            "Giuoco Piano") + 1 ]
          next unless num and boards[BOARD].min == num / 2


# 8. The highest board number was exactly 8 higher than the board
#    number of the man who finished exactly two places after Bert.

          num = boards[BOARD][boards.find_row(NAME,"Bert") + 2]
          next unless num and boards[BOARD].max == 8 + num

        # ----  Print the answer.  ----

          boards.first.size.times {|i|
            puts "%d. %-7s%-7s%-15s%3d" %
              boards.inject([i+1]){|a,x| a << x[i] }
          }
          puts

} } } } }
D371adbc511817d3b11a293adaa08651?d=identicon&s=25 mekly (Guest)
on 2005-12-04 01:50
(Received via mailing list)
Excellent! Great job!

You deserve more stars for doing it in Ruby,
and it's quite educational. Thank you!
Actually, I wanted to see how ugly it'd be done
in a "public static void" language.
(IMHO, Java and C++ are on the dark side of CS).

BTW, that answer was provided by the author of the logic
problem on his web site, so you might ask him for a reward.
My Prolog solution provided the same answers,
and therefore, it's not "wrong."

It's a constraint satisfaction problem with very little
logic involved (it's for humans with no computers). Your conclusion:
"Evidently Prolog isn't well suited for logic problems" is far from
being evident. Also, you can ask the experts at comp.lang.prolog,
if you "wonder what it is good for."

Any way, below is a more demanding problem. It's been used as
an official benchmark in the field. You have an opportunity
to push the recognition of the Ruby language to the top.
(I think the optimal span was proved to be 930 time units --
need to google that).

Best Regards,
Leon
------------------------------------------------------------
% MT10 Scheduling Problem

% J. F. Muth and G. L. Thompson. Industrial Scheduling.

% Prentice Hall, Englewood Cliffs, NJ, USA, 1963.

%

% MT10 was considered as an especially hard problem for several years.

% It took more than 25 years that the optimality of a found makespan

% was proven.

% J. Carlier and E. Pinson. An algorithm for solving the job-shop
problem.

% Management Science, 35(2):164-176, 1989.

% Ten jobs (a-j), with ten tasks (1-10) each run on ten machines
(m1-m10)
% for N time units after completion of a specified list of tasks.
% E.g., t(b5,69,[b4],m4) -- job B task 5 needs 69 time units on machine
% m4 after task b4. Only one task can use a machine...

mt10([
  t(a1,29,[],m1),    t(a2,78 ,[a1],m2), t(a3, 9,[a2],m3),  t(a4,36
  ,[a3],m4), t(a5,49,[a4],m5),  t(a6,11 ,[a5],m6), t(a7,62,[a6],m7),
  t(a8,56 ,[a7],m8), t(a9,44,[a8],m9),  t(a10,21,[a9],m10),
  t(b1,43,[],m1),    t(b2,90 ,[b1],m3), t(b3,75,[b2],m5),  t(b4,11
  ,[b3],m10), t(b5,69,[b4],m4),  t(b6,28 ,[b5],m2), t(b7,46,[b6],m7),
  t(b8,46 ,[b7],m6), t(b9,72,[b8],m8),  t(b10,30,[b9],m9),
t(c1,91,[],m2),
     t(c2,85 ,[c1],m1), t(c3,39,[c2],m4),  t(c4,74 ,[c3],m3),
  t(c5,90,[c4],m9),  t(c6,10 ,[c5],m6), t(c7,12,[c6],m8),  t(c8,89
  ,[c7],m7), t(c9,45,[c8],m10), t(c10,33,[c9],m5), t(d1,81,[],m2),
t(d2,95
  ,[d1],m3), t(d3,71,[d2],m1),  t(d4,99 ,[d3],m5), t(d5, 9,[d4],m7),
  t(d6,52 ,[d5],m9), t(d7,85,[d6],m8),  t(d8,98 ,[d7],m4),
  t(d9,22,[d8],m10), t(d10,43,[d9],m6), t(e1,14,[],m3),    t(e2, 6
  ,[e1],m1), t(e3,22,[e2],m2),  t(e4,61 ,[e3],m6), t(e5,26,[e4],m4),
  t(e6,69 ,[e5],m5), t(e7,21,[e6],m9),  t(e8,49 ,[e7],m8),
  t(e9,72,[e8],m10), t(e10,53,[e9],m7), t(f1,84,[],m3),    t(f2, 2
  ,[f1],m2), t(f3,52,[f2],m6),  t(f4,95 ,[f3],m4), t(f5,48,[f4],m9),
  t(f6,72 ,[f5],m10), t(f7,47,[f6],m1),  t(f8,65 ,[f7],m7), t(f9,
  6,[f8],m5),  t(f10,25,[f9],m8), t(g1,46,[],m2),    t(g2,37 ,[g1],m1),
  t(g3,61,[g2],m4),  t(g4,13 ,[g3],m3), t(g5,32,[g4],m7),  t(g6,21
  ,[g5],m6), t(g7,32,[g6],m10), t(g8,89 ,[g7],m9), t(g9,30,[g8],m8),
  t(g10,55,[g9],m5), t(h1,31,[],m3),    t(h2,86 ,[h1],m1),
  t(h3,46,[h2],m2),  t(h4,74 ,[h3],m6), t(h5,32,[h4],m5),  t(h6,88
  ,[h5],m7), t(h7,19,[h6],m9),  t(h8,48 ,[h7],m10), t(h9,36,[h8],m8),
  t(h10,79,[h9],m4), t(i1,76,[],m1),    t(i2,69 ,[i1],m2),
  t(i3,76,[i2],m4),  t(i4,51 ,[i3],m6), t(i5,85,[i4],m3),  t(i6,11
  ,[i5],m10), t(i7,40,[i6],m7),  t(i8,89 ,[i7],m8), t(i9,26,[i8],m5),
  t(i10,74,[i9],m9), t(j1,85,[],m2),    t(j2,13 ,[j1],m1),
  t(j3,61,[j2],m3),  t(j4, 7 ,[j3],m7), t(j5,64,[j4],m9),  t(j6,76
  ,[j5],m10), t(j7,47,[j6],m6),  t(j8,52 ,[j7],m4), t(j9,90,[j8],m5),
  t(j10,45,[j9],m8)
  ]).

------------------------------------------------------------------------
31af45939fec7e3c4ed8a798c0bd9b1a?d=identicon&s=25 M.B.Smillie (Guest)
on 2005-12-04 04:36
(Received via mailing list)
On Dec 3, 2005, at 20:47, William James wrote:
> I think that your answer is wrong.  There are 3 solutions:
>
> 1. Steve  Rose   Queen's Gambit  40
> 2. Bert   Baird  Ruy Lopez       16
> 3. Tom    Korn   Giuoco Piano    31
> 4. Larry  Hart   King's Indian   32
>
> Evidently Prolog isn't well suited for logic problems.  I wonder
> what it is good for.

I'd not celebrate too fast or too much.  The given answer is
identical to one of yours.  I'm not sure how that makes it wrong,
exactly, but if you mean that not all answers are generated, this is
a fairly simple thing to address: it's a matter of two keystrokes
(';', 'enter') to generate further consistent answers for non-
deterministic systems in the prolog interpreter.

If you want a short insight into the use of learning about prolog,
let's use another example: sudoku.  Take a look at ruby quiz 43 here:
http://www.rubyquiz.com/quiz43.html

Now here's a simple prolog solver, strictly for a quick comparison:
http://user.it.uu.se/~justin/sudoku.pl

To me, the interesting part of the comparison isn't some arbitrary
discussion about lines of code or readability, or what language can
solve what problem[1], but rather that every single Ruby solution
(and I looked at them all) implements a very particular feature of
prolog to get at the answer: the non-deterministic 'reducing
possibilities for each cell' concept is built right into prolog.  In
fact, this concept is absolutely central to the language.

If you can't take a lesson out of that, well, I'd start getting
worried about that "outsourcing" thing if I were you.

matthew smillie.

[1] If you want to believe a strong version of the Curry-Howard
isomorphism, (http://en.wikipedia.org/wiki/Curry-Howard) then it's
thoroughly unsurprising that what can be done correctly in one
language can also be done correctly in another.  It's even less
surprising if you remember that any Turing machine can implement any
other Turing machine.  Of course, if you didn't pay attention in your
introductory course in CS because you were too worried about
"practical" languages, this *might* be surprising, and you might get
drawn into a lot of "my language can beat up your language" sort of
arguments.

--- nit-picking ---

I've left this down here because I don't think it's that important of
a point, but given the triumphalist nature of the "prolog isn't well
suited for logic problems" comment, I don't think it should go
unmentioned:

matt% time ruby chess.rb
287.266u 3.160s 5:28.55 88.3%   0+0k 0+1io 0pf+0w

Almost five minutes? To solve 8 constraints on 4 lists of 5 elements?
I mean, ok, it's a quick and dirty brute force hack, but how is this
honestly supposed to convince anyone to use Ruby for anything, let
alone discard prolog for constraint programming?
44a0f3bc047feb474e2d96e457ac1009?d=identicon&s=25 schulty (Guest)
on 2005-12-04 13:31
(Received via mailing list)
I would have to agree with Ed.  Nix on the desktop application.  Those
are so 1990 :-)  I have been writing Java code for 9 years, and ever
since I have taken a stab at Ruby, and more recently Rails, have never
looked back.  Java is great but pales in comparison to Ruby, IMHO.

Future proof your skills and go with Ruby.  And back to the web
application suggestion...  No question there.  A web application
written in Rails will be faster to production, easier to maintain,
serve more platforms, and will teach you more marketable skills in the
writing of it.
05ee6faa1c1df3e84bf654f8e8838d74?d=identicon&s=25 dabhar1959 (Guest)
on 2005-12-05 02:21
(Received via mailing list)
Thanks everyone for your overwhelming input!

I've started studying......Ruby, of course!

So the concensus seems to be that I should forget the Desktop App.
route.......and go with RoRails.....which sounds great, as long as that
will enable me to package my first program idea and market it (to
Independent Apartment Buildings and Property Management
companies)...will it?

Thanks again!!!!
Dab
A52b0e1c5d982f2512a03c5dbfd033d6?d=identicon&s=25 rasputnik (Guest)
on 2005-12-05 14:07
(Received via mailing list)
On 05/12/05, Dab <dabhar1959@hotmail.com> wrote:

> So the concensus seems to be that I should forget the Desktop App.
> route.......and go with RoRails.....which sounds great, as long as that
> will enable me to package my first program idea and market it (to
> Independent Apartment Buildings and Property Management
> companies)...will it?

Course. You can just run a webserver on your laptop.
71f1b6b2c3fd9af2e8c52618fb91caa6?d=identicon&s=25 Jules <julesjacobs@gmail.com> (Guest)
on 2005-12-05 18:03
I don't know what:

> Independent Apartment Buildings and Property Management companies

are, but if you want to show someone your application:

http://www.erikveen.dds.nl/distributingrubyapplica...

You can wrap your application in one .exe (you don't even need a
separate database!). The email it to someone and that person can launch
it locally.
This topic is locked and can not be replied to.