Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
becoming a better programmer
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 151 - 175 of 433 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Erik Naggum  
View profile  
 More options Sep 17 2002, 10:08 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 17 Sep 2002 14:08:20 +0000
Local: Tues, Sep 17 2002 10:08 am
Subject: Re: becoming a better programmer
* Paolo Amoroso
| Suppose the <H1>, <H2>,... <H6> HTML tags had been used for what they were
| intended. It would have been trivial for search engines to generate useful
| outlines of indexed documents.

  If the CSS had been available from the start, things could have developed
  that way.  It is, however, far better design not to use explicit levels but
  rather nesting constructs.  The fact that these headings do not nest but
  sort of "float" in the overall body may have been a good idea to some people
  at some time, but it is generally only a recipe for abuse, which is also the
  development we have seen.

--
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff 'japhy' Pinyan  
View profile  
 More options Sep 17 2002, 10:42 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Jeff 'japhy' Pinyan <pin...@rpi.edu>
Date: Tue, 17 Sep 2002 10:42:37 -0400
Local: Tues, Sep 17 2002 10:42 am
Subject: Re: becoming a better programmer
[posted & mailed]

On 16 Sep 2002, Software Scavenger wrote:

>On the subject of a few lines of Perl, I'm curious to know what my
>Common Lisp "do-combinations" macro would look like if you implemented
>the same functionality in Perl.  Using it in Common Lisp I can write
>something like:

>(do-combinations (a b) '(1 2 3)
>   (print (list a b)))

>and the output will be:
>(1 2)
>(1 3)
>(2 3)

This is how I would write it (and it looks mildly Lisp-ish); it might not
be the most efficient way, but I like it:

  sub combinations (&$@) {
    my ($code, $size) = (shift, shift);
    do_cmb($code, $size, [@_], []);
  }

  sub do_cmb {
    my ($c, $s, $set, $idx) = @_;
    if (@$idx == $s) { return $c->(@$set[@$idx]) }
    else {
      for my $i ((@$idx ? $idx->[-1] + 1 : 0) .. $#$set) {
        push @$idx, $i; &do_cmb; pop @$idx;
      }
    }
  }

If you want a detailed explanation, I can offer one.  The function is used
like so:

  combinations { print "(@_)\n" } 2, (1..5);

and the output would be:

  (1 2)
  (1 3)
  (1 4)
  (1 5)
  (2 3)
  (2 4)
  (2 5)
  (3 4)
  (3 5)
  (4 5)

--
Jeff "japhy" Pinyan      RPI Acacia Brother #734      2002 Acacia Senior Dean
"And I vos head of Gestapo for ten     | Michael Palin (as Heinrich Bimmler)
 years.  Ah!  Five years!  Nein!  No!  | in: The North Minehead Bye-Election
 Oh.  Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Sep 17 2002, 11:20 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Erik Naggum <e...@naggum.no>
Date: 17 Sep 2002 15:20:35 +0000
Local: Tues, Sep 17 2002 11:20 am
Subject: Re: becoming a better programmer
* Pascal Costanza <costa...@web.de>
| ...but you could also argue that HTML is a language that instructs a computer
| to generate a certain kind of output on screen.

  I believe the interesting difference is between languages that instruct a
  very general-purpose engine to do specific things for which it was explicitly
  designed or intended in the concrete sense on the one hand, and on the other
  languages that are mere input languages to specialized applications that
  affect how it does its one task, but cannot change that task in any useful
  way.  That is, HTML is a data language, while JavaScript is a programming
  language.

| The reason for this is that there is no sharp boundary between programming
| languages and "non-programming" languages

  Of course there is.  It is not clear a priori, however, in which category
  every language would fall.  There is a difference between fuzzy categories
  and things that do not fall neatly into only one of them.

| Someone who implements a parser generator doesn't see any real difference
| between HTML and "real" programming languages

  That is obviously because he deals with the syntax of the languages, not
  their semantics.  Just as one who implements a file transfer protocol does
  not see any real difference between HTML files and images.

--
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dale King  
View profile  
 More options Sep 17 2002, 1:30 pm
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: "Dale King" <Ki...@TCE.com>
Date: Tue, 17 Sep 2002 12:30:44 -0500
Local: Tues, Sep 17 2002 1:30 pm
Subject: Re: becoming a better programmer
"Kenny Tilton" <ktil...@nyc.rr.com> wrote in message

news:3D865569.6020105@nyc.rr.com...

> grelbr wrote:

> > As somebody else asked, what exactly was wrong with _Code Complete_?
> > grelbr

> Nothing new inside. But come to think of it, maybe there was something
> in there for a newbie, which was the question. I just meant it was all
> old news to this old hacker.

I would agree that there is nothing "new". It has all been discussed before.
The problem is that little of it is followed or known to your average
programmer. Much of what is in there will probably be new to the reader.
I've been programming over twenty years and I just last week was looking
over Code Complete again and learned new things (in particular the quote
from Dijkstra's "The Humble Programmer", which said that most of programming
is an attempt to compensate for the strictly limited size of our skulls).

There are also many myths of programming that many take as rules. Code
Complete dispels many of those myths.

On the subject of learning to be a better programmer, I am currently reading
an interesting book, "Software Craftsmanship: The New Imperative" by Pete
McBreen. It argues against the software engineering methodology and suggests
that programming is really a craft much like being a blacksmith. He
advocates a craftsman style system for programmers including apprenticeship
as a means of learning it.
--
  Dale King


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jürgen Exner  
View profile  
 More options Sep 17 2002, 1:46 pm
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: "Jürgen Exner" <jurge...@hotmail.com>
Date: Tue, 17 Sep 2002 10:45:36 -0700
Local: Tues, Sep 17 2002 1:45 pm
Subject: Re: becoming a better programmer

Tom Beer wrote:
> Donald Fisk wrote in message <3D868533.65A4F...@enterprise.net>...

>> As for the mess of ifs and conds, could you explain this?   All
>> programming languages have conditional statements or expressions.

> Perhaps you mean "all procedural programming languages". There are
> variants of Prolog that do not have conditional statements or
> expressions.

I think Donald meant "All programming languages have conditions or other
means of control flow control"
As you mentioned neither statements nor expressions are really necessary
(functional languages don't have statements, assemblers don't necessarily
have expressions)

jue


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henrik Motakef  
View profile  
 More options Sep 17 2002, 2:20 pm
Newsgroups: comp.lang.lisp
From: Henrik Motakef <henrik.mota...@web.de>
Date: 17 Sep 2002 20:31:01 +0200
Local: Tues, Sep 17 2002 2:31 pm
Subject: Re: becoming a better programmer

Erik Naggum <e...@naggum.no> writes:
> * Paolo Amoroso
> | Suppose the <H1>, <H2>,... <H6> HTML tags had been used for what they were
> | intended. It would have been trivial for search engines to generate useful
> | outlines of indexed documents.

>   If the CSS had been available from the start, things could have developed
>   that way.  It is, however, far better design not to use explicit levels but
>   rather nesting constructs.  The fact that these headings do not nest but
>   sort of "float" in the overall body may have been a good idea to some people
>   at some time, but it is generally only a recipe for abuse, which is also the
>   development we have seen.

For the record, XHTML 2 will finally have nested sections, and
generally seems to make it from a lousy to a tolerable *ML
application. Maybe there's hope, but I still think getting rid of HTML
altogether is more promising than fixing it.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Sep 17 2002, 2:42 pm
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Tim Bradshaw <t...@cley.com>
Date: 17 Sep 2002 19:40:52 +0100
Local: Tues, Sep 17 2002 2:40 pm
Subject: Re: becoming a better programmer

* Dale King wrote:
> On the subject of learning to be a better programmer, I am currently reading
> an interesting book, "Software Craftsmanship: The New Imperative" by Pete
> McBreen. It argues against the software engineering methodology and suggests
> that programming is really a craft much like being a blacksmith. He
> advocates a craftsman style system for programmers including apprenticeship
> as a means of learning it.

Poo.  I could have written a book arguing this when I realised it 13
years ago and got famous.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Sep 17 2002, 3:02 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 17 Sep 2002 19:02:35 +0000
Local: Tues, Sep 17 2002 3:02 pm
Subject: Re: becoming a better programmer
* Henrik Motakef
| For the record, XHTML 2 will finally have nested sections, and generally
| seems to make it from a lousy to a tolerable *ML application. Maybe there's
| hope, but I still think getting rid of HTML altogether is more promising
| than fixing it.

  I quite agree, but the cost of the transition will be considerable.  The only
  good things about the Web are that web pages are rewritten and applications
  scrapped at an alarming rate even in our current recession and that there is
  apparently no resistance to any kind of design in the community as long as
  they can get their desired visual results.  Such a pragmatic focus may be a
  good foundation for making the necessary changes relatively quickly.

--
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Knowledge classification systems" by Don Geddis
Don Geddis  
View profile  
 More options Sep 17 2002, 4:18 pm
Newsgroups: comp.lang.lisp
From: Don Geddis <d...@geddis.org>
Date: 17 Sep 2002 13:19:05 -0700
Local: Tues, Sep 17 2002 4:19 pm
Subject: Re: Knowledge classification systems

Erik Naggum <e...@naggum.no> writes:
>   Many are surprised to find that DDC and UDC are multidimensional.

Does this mean that a given Dewey classification encodes multiple attributes?

That's interesting, but not quite as good as independent features.  Please
correct me if I'm wrong, but I assume that the Dewey system (and the others
you've mentioned) are designed for physical objects like books, where each item
belongs in exactly one place.

With online systems, it would seem much better to label each data item with
a whole set of applicable features, and then basically navigate through the
hierarchy by doing searches and building virtual indexes.  In such a scheme,
a given object might appear at numerous "leafs" in the classification tree,
rather than only one.

Do Dewey systems already allow for this somehow?  Or do you think the idea that
an item might not have a unique classification is misguided?

        -- Don
___________________________________________________________________________ ____
Don Geddis                    http://don.geddis.org              d...@geddis.org
I don't think God put me on this planet to judge others.  I think he put me on
this planet to gather specimens and take them back to my home planet.
        -- Deep Thoughts, by Jack Handey


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Sep 17 2002, 5:56 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 17 Sep 2002 21:56:30 +0000
Local: Tues, Sep 17 2002 5:56 pm
Subject: Re: Knowledge classification systems
* Don Geddis
| Does this mean that a given Dewey classification encodes multiple attributes?

  Yes.  Geography and audience are particularly well-utilized examples.  E.g.,
  a book about Indiana high-school women's basketball would be classified
  under sports, basketball, pre-college, in Indiana, for women.  A book about
  cats for children would be classified under cats, intended for children.

| Please correct me if I'm wrong, but I assume that the Dewey system (and the
| others you've mentioned) are designed for physical objects like books, where
| each item belongs in exactly one place.

  Yes, the books would be in one place, but you would obviously have multiple
  index cards for them if they were cross-classified.  It is useful to find
  related items grouped in the bookshelves, but this is a consequence of the
  nature of bookshelves, not of the classification.

| With online systems, it would seem much better to label each data item with
| a whole set of applicable features, and then basically navigate through the
| hierarchy by doing searches and building virtual indexes.  In such a scheme,
| a given object might appear at numerous "leafs" in the classification tree,
| rather than only one.

  This is already the case.  I have several books that are cross-classified.

| Do Dewey systems already allow for this somehow?  Or do you think the idea
| that an item might not have a unique classification is misguided?

  I think you have assumed that a classified item has only one classification.
  This is false.  It must have one, and the better it is, the more useful that
  one is, but if a book covers some more than subject, there is nothing to
  stop it from getting several classifications.  (Unless, of course, it is a
  "general collection", where the classifiers basically give up on it with the
  assumption that people would not look for it under any specific area.

--
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "becoming a better programmer" by Ryan Breidenbach
Ryan Breidenbach  
View profile  
 More options Sep 17 2002, 7:11 pm
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: ryan_breidenb...@hotmail.com (Ryan Breidenbach)
Date: 17 Sep 2002 16:11:09 -0700
Local: Tues, Sep 17 2002 7:11 pm
Subject: Re: becoming a better programmer

Tim Bradshaw <t...@cley.com> wrote in message <news:ey3lm60v4qz.fsf@cley.com>...
> * Dale King wrote:

> > On the subject of learning to be a better programmer, I am currently reading
> > an interesting book, "Software Craftsmanship: The New Imperative" by Pete
> > McBreen. It argues against the software engineering methodology and suggests
> > that programming is really a craft much like being a blacksmith. He
> > advocates a craftsman style system for programmers including apprenticeship
> > as a means of learning it.

> Poo.  I could have written a book arguing this when I realised it 13
> years ago and got famous.

> --tim

So why didn't you?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Bradshaw  
View profile  
 More options Sep 17 2002, 7:17 pm
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Tim Bradshaw <t...@cley.com>
Date: 18 Sep 2002 00:16:42 +0100
Local: Tues, Sep 17 2002 7:16 pm
Subject: Re: becoming a better programmer

* Ryan Breidenbach wrote:
> So why didn't you?

Well, why didn't the thousands of other people who knew this?  It's
still annoying.

--tim


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michiel Konstapel  
View profile  
 More options Sep 17 2002, 9:02 pm
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: "Michiel Konstapel" <a...@me.nl>
Date: Wed, 18 Sep 2002 01:02:53 GMT
Local: Tues, Sep 17 2002 9:02 pm
Subject: Re: becoming a better programmer

> >> This appears to be something of a religious issue among programmers,

> >Oh, so that settles it once and for all, then.  Call in the Spanish
> >Inquisition!

> I didn't expect the Spanish Inquisition.

Nobody expects the Spanish Inquisition!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
synthespian  
View profile  
 More options Sep 17 2002, 11:33 pm
Newsgroups: comp.lang.lisp
From: synthespian <synthesp...@debian-rs.org>
Date: Wed, 18 Sep 2002 00:24:47 -0300
Local: Tues, Sep 17 2002 11:24 pm
Subject: Re: becoming a better programmer

On Tue, 17 Sep 2002 10:03:18 -0300, Paolo Amoroso wrote:
> On Mon, 16 Sep 2002 05:28:33 -0300, synthespian
> <synthesp...@debian-rs.org> wrote:

>>        All these things matter a lot to me, being from the medical community,
>> and quite aware of the importance that being able to integrate the data
>> that continues to grow at exponential rate in the field (genome, for
>> instance, the barrier that tradional statistics methods are up against
>> in a large medical database, etc...)

> I suggest that you have a look at all the books by Edward Tufte you can
> afford. Lots of food for thought.

> Paolo

Thanks, will do.

        Henry

_________________________________________________________________
Micro$oft-Free Human         100% Debian GNU/Linux
     KMFMS              "Bring the genome to the people!
www.debian.org - www.debian-br.cipsga.org.br - www.debian-rs.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
synthespian  
View profile  
 More options Sep 17 2002, 11:58 pm
Newsgroups: comp.lang.lisp
From: synthespian <synthesp...@debian-rs.org>
Date: Wed, 18 Sep 2002 00:49:31 -0300
Local: Tues, Sep 17 2002 11:49 pm
Subject: Re: becoming a better programmer

        There's one thing that I definitely think is a basic flaw with
ontologies, at least the way they're set up (I may have a very limited
understanding on the topic, however): the ontology is defined by the
"definer".
        For example, the person who defines the ontology has motives
for indexing something in the ontology. Why does he/she do it? What are the
"economics" or "psychology" behind it? This is relevant, as anyone who
works with narketing will tell you.
         Another thing is the very meaning
of a word.How then, does he/she understand the meaning of the word?
Words change meaning over time, a fact any linguist will tell you...And,
if that wasn't enough, they mean different things to different people. I'm
not talking about you defining that <zp> means <zip code>, but the very
concept of zip code (ok, my example isn't so good. But let me give you a
*real* example: a sociologist here in Brazil set out to discover what
percentage of the population understood the correct meaning of the
concepts of "right" and "left" in politics...A total disaster...An amazing
amount had no clue, and actually exchanged meaning. Now imagine a
candidate for the the congress asking for votes...you get the picture...)
        So, at some point, words cease to mean what they initially meant. This,
from the point of view of a database of ontologies introduces quite a lot of noise.
So maybe you end up eventually with inference rules that are really
bogus.When you have the emergence of new meanings as in language you need
software that a software that is intelligent enough to sort out the new
meanings, perhaps even in a temporal way which, AFAIK is totally out
of the design of the ontologies as they are being proposed for the
Semantic Web. You end up with a huge amount of entropy.

        Henry

--

_________________________________________________________________
Micro$oft-Free Human         100% Debian GNU/Linux
     KMFMS              "Bring the genome to the people!
www.debian.org - www.debian-br.cipsga.org.br - www.debian-rs.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Steiner  
View profile  
 More options Sep 18 2002, 3:43 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: rstei...@visi.com (Richard Steiner)
Date: Wed, 18 Sep 2002 02:41:42 -0500
Local: Wed, Sep 18 2002 3:41 am
Subject: Re: becoming a better programmer
Here in comp.lang.java.programmer,
"Michiel Konstapel" <a...@me.nl> spake unto us, saying:

>> >> This appears to be something of a religious issue among programmers,

>> >Oh, so that settles it once and for all, then.  Call in the Spanish
>> >Inquisition!

>> I didn't expect the Spanish Inquisition.

>Nobody expects the Spanish Inquisition!

Of course not.  It's chief weapon is surprise.  :-)

--
 -Rich Steiner >>>---> http://www.visi.com/~rsteiner >>>---> Eden Prairie, MN
    OS/2 + BeOS + Linux + Win95 + DOS + PC/GEOS = PC Hobbyist Heaven! :-)
     Applications analyst/designer/developer (13 yrs) seeking employment.
        See web site in my signature for current resume and background.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Steiner  
View profile  
 More options Sep 18 2002, 4:04 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: rstei...@visi.com (Richard Steiner)
Date: Wed, 18 Sep 2002 03:02:59 -0500
Local: Wed, Sep 18 2002 4:02 am
Subject: becoming a better programmer
Here in comp.lang.java.programmer,
"Michiel Konstapel" <a...@me.nl> spake unto us, saying:

>> >> This appears to be something of a religious issue among programmers,

>> >Oh, so that settles it once and for all, then.  Call in the Spanish
>> >Inquisition!

>> I didn't expect the Spanish Inquisition.

>Nobody expects the Spanish Inquisition!

Of course not.  Its chief weapon is surprise.  :-)

--
 -Rich Steiner >>>---> http://www.visi.com/~rsteiner >>>---> Eden Prairie, MN
    OS/2 + BeOS + Linux + Win95 + DOS + PC/GEOS = PC Hobbyist Heaven! :-)
     Applications analyst/designer/developer (13 yrs) seeking employment.
        See web site in my signature for current resume and background.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Software Scavenger  
View profile  
 More options Sep 18 2002, 6:15 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: cubicle...@mailandnews.com (Software Scavenger)
Date: 18 Sep 2002 03:15:07 -0700
Local: Wed, Sep 18 2002 6:15 am
Subject: Re: becoming a better programmer
Jeff 'japhy' Pinyan <pin...@rpi.edu> wrote in message <news:Pine.A41.3.96.1020917103445.21704D-100000@vcmr-104.server.rpi.edu>...

> This is how I would write it (and it looks mildly Lisp-ish); it might not
> be the most efficient way, but I like it:

Yes, it's an elegant algorithm.  I'm basically comparing how people
accomplish the same functionality in different languages, using
whatever algorithm seems appropriate for the language.  The versions
for languages such as Scheme, OCaml, etc. are in comp.lang.lisp in
discussions about macros etc.

My CL version is a macro which builds nested loops, so there is no
need for it to call any functions at run time, recursive or not.  I'm
curious to know if Perl has macros, or if it makes sense for a Perl
program to rewrite Perl code in some situations.

I also wonder if that "print" block of code in your Perl code is a
closure.  If outside of the call to combinations, you were to define a
number of local variables, and in the block, you were to add code
which used those, would it work, even though it would be executed by
combinations rather than in line?

i.e.
  combinations { print "(@_)\n" } 2, (1..5);
               ^  block of code ^
  (add other code inside the same block, and use variables defined
outside)

I also wonder why the 2 has a comma after it, when the other arguments
to combinations don't.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alain Picard  
View profile  
 More options Sep 18 2002, 6:35 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Alain Picard <apicard+die-spammer-...@optushome.com.au>
Date: 18 Sep 2002 20:32:40 +1000
Local: Wed, Sep 18 2002 6:32 am
Subject: Re: becoming a better programmer

rstei...@visi.com (Richard Steiner) writes:
> Of course not.  Its chief weapon is surprise.  :-)

And fear!  Fear, and surprise.  :-)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruce Hoult  
View profile  
 More options Sep 18 2002, 6:58 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Bruce Hoult <br...@hoult.org>
Date: Wed, 18 Sep 2002 22:58:40 +1200
Local: Wed, Sep 18 2002 6:58 am
Subject: Re: becoming a better programmer
In article <a6789134.0209180215.3e75d...@posting.google.com>,
 cubicle...@mailandnews.com (Software Scavenger) wrote:

> My CL version is a macro which builds nested loops, so there is no
> need for it to call any functions at run time, recursive or not.  I'm
> curious to know if Perl has macros, or if it makes sense for a Perl
> program to rewrite Perl code in some situations.

Perl doesn't have macros, but it does make sense sometimes for a Perl
program to create Perl code and pass it to eval().

> I also wonder if that "print" block of code in your Perl code is a
> closure.

Yes, Perl functions are closures (if they refer to free variables).  If
you put the appropriate magic character as the declaration of a sub
argument then you can pass a function body in using just { } around it,
as you saw there.

> If outside of the call to combinations, you were to define a
> number of local variables, and in the block, you were to add code
> which used those, would it work, even though it would be executed by
> combinations rather than in line?

Yes.  In fact, since you can walk the entire tree of namespaces and
fudge about with the "globs" (like CL symbols, except that they have
more than just a value and a function slot), you can actually do just
about *anything* you like, although perhaps not quite with the syntax
you'd like.

-- Bruce


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Immanuel Litzroth  
View profile  
 More options Sep 18 2002, 7:40 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Immanuel Litzroth <immanu...@enfocus.be>
Date: 18 Sep 2002 13:40:46 +0200
Local: Wed, Sep 18 2002 7:40 am
Subject: Re: becoming a better programmer

>>>>> "Alain" == Alain Picard <apicard+die-spammer-...@optushome.com.au> writes:

    Alain> rstei...@visi.com (Richard Steiner) writes:
    >> Of course not.  Its chief weapon is surprise.  :-)

    Alain> And fear!  Fear, and surprise.  :-)

Their two main weapons are fear and suprise and ruthless efficiency.
:-)
Immanuel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils Goesche  
View profile  
 More options Sep 18 2002, 7:43 am
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 18 Sep 2002 13:43:06 +0200
Local: Wed, Sep 18 2002 7:43 am
Subject: Re: becoming a better programmer

synthespian <synthesp...@debian-rs.org> writes:
> But let me give you a *real* example: a sociologist here in Brazil
> set out to discover what percentage of the population understood the
> correct meaning of the concepts of "right" and "left" in
> politics...A total disaster...An amazing amount had no clue, and
> actually exchanged meaning. Now imagine a candidate for the the
> congress asking for votes...you get the picture...)

What I find even more amazing is that this ``sociologist'' apparently
thinks that it is so entirely clear what right and left means, that
there is much of a difference between them and he knows what it is and
everybody else should, too.  For another viewpoint see, for instance,
``The Road to Serfdom'' by F. A. Hayek.

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens Axel Søgaard  
View profile  
 More options Sep 18 2002, 8:52 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: "Jens Axel Søgaard" <use...@soegaard.net>
Date: Wed, 18 Sep 2002 14:51:09 +0200
Local: Wed, Sep 18 2002 8:51 am
Subject: Re: becoming a better programmer

Immanuel Litzroth wrote:
>>>>>> "Alain" == Alain Picard <apicard+die-spammer-
>>>>>> d...@optushome.com.au> writes:

>     Alain> rstei...@visi.com (Richard Steiner) writes:
>     >> Of course not.  Its chief weapon is surprise.  :-)

>     Alain> And fear!  Fear, and surprise.  :-)

> Their two main weapons are fear and suprise and ruthless
> efficiency. :-)

Their three weapons are fear, surprise, and ruthless efficiency
and an almost fanatical devotion to the Pope.

--
Jens Axel Søgaard


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Espen Vestre  
View profile  
 More options Sep 18 2002, 9:04 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: Espen Vestre <espen@*do-not-spam-me*.vestre.net>
Date: Wed, 18 Sep 2002 13:04:34 GMT
Local: Wed, Sep 18 2002 9:04 am
Subject: Re: becoming a better programmer
"Jens Axel Søgaard" <use...@soegaard.net> writes:

> Their three weapons are fear, surprise, and ruthless efficiency
> and an almost fanatical devotion to the Pope.

and nice red uniforms!
--
  (espen)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Harlan Messinger  
View profile  
 More options Sep 18 2002, 9:37 am
Newsgroups: comp.lang.c++, comp.lang.lisp, comp.lang.java.programmer, comp.lang.perl.misc
From: "Harlan Messinger" <h.messin...@comcast.net>
Date: Wed, 18 Sep 2002 09:34:07 -0400
Local: Wed, Sep 18 2002 9:34 am
Subject: Re: becoming a better programmer

"Tim Bradshaw" <t...@cley.com> wrote in message

news:ey38z20urz9.fsf@cley.com...

> * Ryan Breidenbach wrote:

> > So why didn't you?

> Well, why didn't the thousands of other people who knew this?  It's
> still annoying.

So, in other words, if good practices in a given field are already known to
many of the experienced practitioners in the field, nobody should bother
writing a book describing them for the benefit of those newcomers who don't
already know them? Books should only be written about revolutionary new
ideas that no one ever thought of before?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 151 - 175 of 433 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »