MLUG: Re: [MLUG] PHP
Re: [MLUG] PHP
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Wed, 23 Apr 2003, Michael Procter wrote:

> On Tue, Apr 22, 2003 at 07:22:01PM -0500, Mark Rages wrote:
> > On Tue, Apr 22, 2003 at 02:25:03PM -0500, Pepper, Mike wrote:
> > > I am looking for a good beginners book on PHP. I really don't have much
> > > programming experience, the more basic the better
> > > 
> > > Thanks
> > > 
> > > Mike Pepper
> > > University of Missouri Columbia
> > > UM Procurement Services
> > > EMAIL:PROTECTED
> > > (573) 882-5052
> > 
> > This seems like a good place to incite a language war.
> > 
> > I use both PHP and Python where I work.  As my familiarity with both
> > languages grows, I find myself hating PHP and liking Python more.
> 
> I guess everyone agrees with you.  Have you tried Ruby?

I have a bit.  This is coming from a background in perl (with previous
experience in C and Lisp).  Ruby, frankly, is 99% of what I would want
Perl6 to be, if we ever do see Perl6.  The weaknesses with Ruby right now
are related to the relative lack of (English language) documentation and
less complete library coverage than more mature scripting languages.  My
hunch is that Ruby appeals more to Perl people who wanted something
cleaner but not quite as, um, pythonic as Python.  True Python users are
less likely to see major advantages, although I think there were some over
earlier versions of Python.  (Python's problem has recently been that 
the language has been changing faster than the books can keep up; Perl's 
problem is that Perl6 is still not there, but people don't want to commit 
as thoroughly to Perl5 at the moment.)

I kind of like some Ruby's idioms.  Here's a prime number generator:

ruby -e '(2..1000).each{|i|(2..Math.sqrt(i).floor).find{|j| i%j == 0} or p i}'

OK, so that means...

 (2..1000).each {|i|          # for each item i in the array (2..1000)
   (2..Math.sqrt(i).floor)    # make a new array (2..floor(sqrt(i)))
       .find{|j| i%j == 0}    # and in that array find a j such
                              # that j divides i evenly (is composite)
   or p i}'                   # or else print i since it's prime.

I'm guessing you either like that or you hate it.

jking


_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members