[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Bad programmers use recursion (Offtopic was Re:
guess i'm a youngster (only 3 decades experience) - but i still find recursion essential - it works best as michael says on tree structures, particularly with unknown depth. there's an elegance about it and a reliability that is difficult to match. often with these problems what you gain by not using recursive function calls you lose in state maintenance. on the other hand there's nothing like a pointer to rapidly digest text. ps if you're worried about function calls, what about some good old fashioned macros. in many cases you get the beauty of the function call with the speed of inline. this can be very significant, but it sadly it won't fix our o(n^2) problem. rick Michael Kay wrote: >>On that subject, for text programming, the use of recursion is almost >>always the sign of an inexperienced or poor programmer. >> >> > >Odd then that I find myself using recursion more and more as my programming >career moves into its fourth decade. It's partly, of course, the result of >exposure to functional programming languages: this often means that the >recursive solution is the first thing you think of rather than the last. >It's also partly because most code isn't performance-critical. > >But with the caveat "for text programming" I see your point: I find >recursive code very natural when dealing with recursive data structures >(trees) but less natural when dealing with linear data (sequences and >strings). > >Michael Kay >http://www.saxonica.com/ > > > >----------------------------------------------------------------- >The xml-dev list is sponsored by XML.org <http://www.xml.org>, an >initiative of OASIS <http://www.oasis-open.org> > >The list archives are at http://lists.xml.org/archives/xml-dev/ > >To subscribe or unsubscribe from this list use the subscription >manager: <http://www.oasis-open.org/mlmanage/index.php> > > >!DSPAM:4426a36c54131896214748! > > > begin:vcard fn:Rick Marshall n:Marshall;Rick email;internet:rjm@z... tel;cell:+61 411 287 530 x-mozilla-html:TRUE version:2.1 end:vcard
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|