On Sat, Nov 28, 2009 at 9:52 AM, Raul Miller <[email protected]> wrote: > On Fri, Nov 27, 2009 at 7:24 PM, June Kim <[email protected]> wrote: >> html/body/div/div/div/div/div/ul/li := langs =: langs >> ,^:(a:~:{...@[)~ lang ; ' \((\d+) members?\)' rx y > >> html/body/div/div/div/div/div/ul/li/a := lang =: >> '^\s*((?:.(?!User|Tasks|Omit|attention|operations|by))+)\s*$' rx y >> >> That code is dependent on the deep path structure of the document. > > From my point of view, that is not code, that is data (or, more > properly, configuration).
Oh, that distinction isn't meaningful usually in my humble opinion. For me, what is important is dependency and its cost. When something changes and some other things must change, then there is a dependency, and majority of software cost(of which major part is maintaining the code) comes from dependencies. Moreover, when it comes to a dynamic language the boundary between code and data (or configuration, whatever you call it) becomes much less obvious. Consider Lisp. Or, in python you can put all the code into a gigantic string and finally call "eval" for that string value. Is it code? data? configuration? The usual convention in ruby world(and many other dynamic languages), for example, is using its own language for configuration (they call it Embedded Domain Specific Language). What I am concerned about, should I emphasize here again, is the cost of managing the dependency. And I've done many web scrapping/spidering (usually in Python with Beautiful Soup, ElementTree, Mechanize et al) and from my experiences, the last thing I want to do is putting in the dependency in my code on the accidental features of the document. > > You can not expect to change the structure of the document > being analyzed without changing the description of that > structure. Sorry I don't exactly get what you mean here. When a structure(change in the order of an unordered list items) or a view changes(change in font size for example), many times I don't need to change my code, if I have considered dependecies and handled it when programming. > > -- > Raul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
