Programming Newbie: Ruby or Java?

Ryan L. 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” :slight_smile:

On 11/30/05, Isaac G. [email protected] 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” :slight_smile:

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

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.

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
Ruby Code & Style - 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

James B. [email protected] writes:

bother with VB.net.
The difference is syntactic-sugar only, anyway, no?

Christian N. 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.

:slight_smile:

James

http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - 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

you’re not learning the languages so that you can use them later on. you
learn them so that you understand how to program.

“”“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. :confused:
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.

Ryan L. 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. :confused:
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.

Chris I. 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

Quoting Chris I. [email protected]:

“”“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. :confused:
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 K.

Chris I. 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. :confused:
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 B.

http://www.ruby-doc.org - Ruby Help & Documentation
Ruby Code & Style - 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

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

  5. Steve Rose Giuoco Piano 8

  6. Bert Baird Queen’s Gambit 16

  7. Tom Korn Ruy Lopez 31

  8. Larry Hart King’s Indian 23

  9. Steve Rose Queen’s Gambit 40

  10. Bert Baird Ruy Lopez 16

  11. Tom Korn Giuoco Piano 31

  12. 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

} } } } }

“”“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. :confused:
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

% Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos

% 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).

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)
]).


I would have to agree with Ed. Nix on the desktop application. Those
are so 1990 :slight_smile: 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.

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

On Dec 3, 2005, at 20:47, William J. 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, (Curry–Howard correspondence - Wikipedia) 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?

On 05/12/05, Dab [email protected] 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.

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/distributingrubyapplications/rails.html

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.