begin quoting Andrew Lentvorski as of Tue, Jan 08, 2008 at 01:54:56PM -0800: > SJS wrote: [snip] > >Same with perl or TCL... I'd need a reference book at hand, and that > >wasn't going to happen unless I dumped the cat. And it's just wrong > >to dump a purring cat, so I fell back on that old standby we call C. > > Funny. I wouldn't be able to pull that C out without grabbing at K&R.
My hardest problem with C syntax seems to be in getting the typedefs right. > However, my Python, even after not having written it for probably about > 1 1/2 years is *still* just fine. I think you are far more clever than > I in choice of algorithm. I just used a simple recursive descent and > used a hash table to remember what states I already visited. You have amazing powers of recollection; after a year and a half, I think I'd need to crib quite a bit in *any* language I know. > What is interesting to me is the difference in lines of code. Not > because Python is so much better, but simply because I could use vectors, > hash tables, strings, and sequences directly and Stewart had to reimplement > a data structure (deque). Yes. A language with a better set of tools on hand would have made the writing of the code go a lot faster. I *thought* about reaching for Java, but, well, where's the fun in that? I do that all the time. I should've tried this with Smalltalk (as GST doesn't require the code browser) and I could have looked at some of my sample code for reminders about which classes to use. A queue is just a stream, after all, so the same approach would have worked fine. > And this matches my philosophy very well. I *HATE* reimplementing data > structures that already exist. As an exercise in entertainment, I don't mind so much. :) > After about 80 minutes of coding I have: A bit faster than me too. Using those high-level languages helps a lot, doesn't it? [chop] -- I have no intention of starting a row So peanuts I shall refrain to throw. Stewart Stremler -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
