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

Re: [ProgSoc] Programming! Code!



Myles Byrne wrote:

> I thought it was cool because in another language the code would 
> probably be something like:
> 
> urls = new Array();
> listings = page.getElementsByClassName('.listing');
> for (listing in listings) {
>    links = listing.getElementsByTagName('a');
>    for (link in links) {
>      url = link.getAttribute('href')
>      if (url) {
>        urls.append(url);
>      }
>    }
> }
> 
> ... and that wouldn't be a big deal. My cunning plan was to use the code 
> sample as a seugway into a discussion about why we should be moving to 
> more towards this higher-level, more concise form of programming and 
> away from languages Java.

To make this segway, you need to make a comparison between language
features, which you haven't.

In fact, you are comparing two APIs, not two languages.

I prefer the API that allows this example to be written in one line.
I prefer the language with less tricky syntax.

-- 
Ryan Heise
http://www.ryanheise.com/

-
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to progsoc-request@xxxxxxxxxxxxxxxxxxx
If you are having trouble, ask owner-progsoc@xxxxxxxxxxxxxxxxxx for help.