[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ugh, but yay
- To: Brian <http://www.cs..edu/~b>
- Subject: Re: ugh, but yay
- From: http://dummy.us.eu.org/robert (Robert)
- Date: Wed, 10 Feb 2021 08:30:02 -0800
- Keywords: Brian
> From: Brian <http://www.cs..edu/~b>
> Date: Mon, 8 Feb 2021 07:35:59 -0800
>
> I did some programming for BJC, to make a glossary and index by scraping
> the pages. I (blush) wrote it in C, because I don't know how to do file
> I/O in any good language (double blush). And my code sucks. (Triple
> blush.) It barely works. (Just like the WAITS mail program, Mike and
> Marty and Matt and whoever else remembers WAITS.) Like, when I find a
> string to index, I convert it to lower case unless the second letter is
> upper case, like "ADT" (abstract data type), or the string is "Boolean."
> But sometimes it's something like "abstract data type (ADT)", so
> really I have to traverse the string looking at each word to catch
> acronyms. Makes me wish I'd written it in Logo! I probably
> could have.
I probably would've done this in Perl. I don't recommend learning Perl,
'tho, since it takes syntactic sugar to entirely quite bitter level.
Probably Python would've been easier than C. Admittedly, Python is not as
powerful for I/O stuff as Perl or C, but it's doable and would've been
less ugly than C (or Perl, for that matter).
I guess you could've also done it in Awk. I do a lot of awk one-liners
these days. Not sure about scraping web pages, 'tho.