Tags:
create new tag
, view all tags
Just a page to start to record some of my ill-formed and premature observations about Perl (and TWiki). I talked my way through the section #Text_vs_Typed_Data and it should be rewritten or deleted, but I'll "sleep on it" a little while before doing so.

This may start to sound a little critical, it is not intended to be. Well, it is in one sense -- it is intended to make insightful observations about Perl and its use in TWiki, some of which may be "critical" as opposed to complimentary. (I'm probably not qualified to make insightful observations, so I'll just make observations and hope they evolve to insightful in the wiki way.)

See AboutThesePages.

Contents

Text vs. Typed Data

Note: In writing this, I sort of talked my way through to a better understanding -- this section now needs to be revised.

Orthogonality was a concept I learned in school -- in contrast, what I'm going to try to discuss here I did not learn in school, and I'm not sure that I've come across a discussion of it in any reading I've done. And, I'm not sure the heading is helpful -- it is at least a little misleading.

This is going to be a rambling first attempt:

The languages I grew up with (Algol, Fortran, PL/1, APL, Pascal, etc., mostly (I've thought of an exception to what I was going to say -- SNOBOL) had a way of treating variables, data, and so on as "special" -- they were predefined somehow, and recognized because they were predefined.

Perl (or really TWiki, so far in my observations, for which TWiki is the only program I'm familiar with), takes a different approach. I guess I could say it in a few ways, but the way that makes it most surprising to me is the way TWiki just takes a bunch of plain text, with no preconceived notion that some part of it might be variables, or links, or whatever; processes it; displays parts of it differently than others (decides that a certain portion of the text represents a link, displays it in a different color; and most interestingly, makes portions of it work like a link.

I'm not sure exactly how to explain what I mean, or why the behavior surprises me. I guess if I were to write the program in something like Algol, Fortran, ..., I could take the same approach, and maybe it is the only logical approach. Maybe the thing is that TWiki starts out needing to have the text of a page parsed (which TWiki/Perl do), and many other programs I've dealt with had the data preparsed (and for example, stored in a well formatted file, database, or something similar). I guess I shouldn't have been surprised -- I think I hit the nail on the head -- some other programs I've dealt with (but not all) had the data preparsed, but TWiki does not. And, apparently Perl (and I have no reason to believe differently), is a particularly useful language for doing this parsing.

Now that I've talked my way through this, I should revise this section -- not sure if it's worth including at all.

Orthogonality(?)

I had a computer science course a long time ago that introduced me to the concept of orthogonality in a computer instruction set. Don't know that I remember it right, or if what I was taught is still the currently accepted definition.

As I recall, orthogonality is (was?) the concept of a set of instructions that could cover the entire field of endeavor (to use some high falutin' language that might not mean exactly what I intend) with a minimum of duplication. (Like an orthogonal set of axes in some "space" -- if the axes are not orthogonal, there can be locations in the space that can't be specified (reached) by coordinates based on those axes, and there may be locations that have two or more sets of coordinates (i.e., their coordinates are not unique, again because of the lack of orthogonal axes).

I don't know that orthogonality in a computer instruction set is always a good thing -- there is probably nothing wrong with the Perl TIMTOWTDI philosophy, but it is at times disappointing when there is no way to accomplish a result (like the inability for TWikiDrawPlugin to work in an "include" -- see PluginProblemWithIncludes). (Aside, that's more a criticism of the "instruction set" provided by TWiki than of Perl itself.)

PS: Since writing the above re the TWikiDrawPlugIn, I saw some notes (maybe from PeterThoeny) that indicate the behavior described above is unintentional and will be (may already be) fixed. I forget exactly where -- see PluginProblemWithIncludes, TWikiDrawPlugin, TWikiDrawPluginDev, or TWikiDrawPlugin. (There are also one or more pages on the Wikilearn web that deal with the TWikiDrawPlugin, like EditingATWikiDrawSketch and the pages that contain TWikiDraw sketches (like EmailServerSketches and EmailOverviewSketch, at this time).

Another (possible) example of the lack of orthogonality (or something) -- gettextResources is not recognized as a valid page name, even in the double square bracket syntax. (I think that's the problem with that page, or a single word heading does not create a valid anchor (in the non-documented feature of TWiki). Need to dig a little deeper.

Aside: It's my gut feeling that the only restriction on a WikiWord (or name of a wiki page) be that it is a valid file name (since the content is stored in a file named <wiki topic name>.txt. However, since TWiki (the "server") can run under more than one operating system (at least Linux and Windows), and there (are | may be) differences in allowable file names, this is probably not as easy to do as it is to say.

What are WikiWords

WikiWords are defined in the topic TWiki.WikiWords. In essence (as I understand it), they consist of two uppercase letters separated by one more lowercase letters and no spaces. By contrast, filenames under most OS's are much more flexible. For instance, foo.bar, foo_bar, and foo-bar are all legal filenames in both Linux and Windows, but are not legal WikiWords. However, I think it is the case that all legal WikiWords will be legal filenames (or filename fragments). [tpb]


Contributors

  • RandyKramer - 27 Apr 2002
  • [tpb] TomBarron - 23 Aug 2002
  • <If you edit this page, add your name here, move this to the next line>

Page Ratings

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2002-09-03 - RandyKramer
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look