Lan Barnes wrote:
On Fri, February 22, 2008 7:58 pm, Ralph Shumaker wrote:
James G. Sack (jim) wrote:
I'm no perl-wizard but I have spent a few years writing perl code, and
I
would recommend something other than perl -- unless you already have a
good reason to specifically use perl. Perl is famous for text handling,
but other languages are nearly as good. Perl is famous for one-liners,
but only after you get fairly proficient. There are certainly other
pluses, but in each case, I find it hard to send beginners off chasing
them.
I would suggest python (my favorite) or maybe tcl.
Hmmm, maybe lua? (Andy:?)
??? or maybe even pascal ???
==> Hey Gus: does delphi fit in this context.
I would also suggest skipping sed and awk (unless you want to see some
of the ideas that led to perl). Both are good things for sysadmins to
have in their toolbags, but I think for an ordinary mortal just doing
occasional scripting, I would jump from shell to (say) python.
Regards,
..jim
And "for an ordinary mortal just doing [more than] occasional
scripting"?
I've never programmed anything with a gui interface, and that certainly
has some appeal to me, just to be *able* to do it if nothing else.
Because of that, Tcl-Tk has had some appeal to me.
But other than BASIC, FoxBase, and a little Perl, I am fairly much
unfamiliar with what would be a good way to go.  I wouldn't mind getting
to a level where I could code for pay.  But I doubt that I could do that
with BASIC or FoxBase.
The previous quoting is quite ugly.  What happened?


Yeah, I started my programming life (after Pascal and asm in school) on
dBase II, too. My first scripting language ;-)

I never considered FoxBase to be a scripting language. But I guess all languages are just a script of commands. (Oh, I just now noticed the winkey. :-[ )

I would say this. Scripting, at least at first, is like anything else in
Linux. We start out just to poke around, have a little fun, see what the
other guys/gals are talking about. Who knows where it will lead.

Exactly. I started off with a pocket PC from Radio Shack in the early 80s. I learned BASIC on it, tho it did not have graphics commands.

When I decided to take a high school class called Computer Math, I was delighted to find that we were learning BASIC. I didn't do my homework, but the teacher knew that I knew the material. *BUT*, when we got to graphical commands, I perked up and my brain started running with the possibilities. When I started my program, I don't know if I had in mind to create a paint program, but that's certainly what it morphed into. It took months of free time (and even borrowed time), but about a month before school let out for the summer, I completed it. The teacher knew I wasn't playing games, and saw that I was always working on something extensive, so she never challenged me on it. (I still wasn't doing any of the assigned homework. :) ) But I finally finished my project about a month before school let out for the summer and decided to show it to my teacher. She was impressed to say the least and encouraged me to show it to the class. I wasn't keen on having all eyes on me so I told her I would have to think about that (meaning "no way!"). But in the very next class, she asked me if I wanted to show my project to the class. With all eyes on me, I knew that if I declined, I may be bombarded with questions, so, at that point, I had nothing to lose. I had heard of a new device called the mouse, but its description left something lacking, and besides, we didn't have any on our computers. So, during the class, I used the keyboard commands to paint a picture of a meadow with grass, trees, a stream, flowers, the sky, the sun, clouds, birds, and who can remember what else. I don't recall if my program had a way to save the image, but at this point the teacher was even MORE impressed, and the class too. Several class mates asked me how I did it. I told them "I used only the commands we learned in class, and spent a *LOT* of time on it."

My dad suggested that I send it to a magazine for publication. I lacked self confidence, and didn't think it would be accepted. But I wish I had. I might have gotten a scholarship to some programming school.

Over the years, I have made many small programs (mostly in BASIC on the PC), none comparing to the first one, until I modified and enhanced someone's FoxBase program. And I think even that one didn't quite rise to the time investment of my BASIC paint program. And his FoxBase code was readable to me because of my BASIC knowledge.

I wish I still had that BASIC program. Someone here at kplug suggested that just that by itself could *BE* my resumé for some programming jobs. With some searching, I might be able to find the FoxBase Work Order program that I enhanced. Hmmm, I'll have to make a search.

I've been glad to know a little perl so I could solve small text and
control problems easily w/o asking for help. Just as someone with Carl's
experience reaches for sed/awk/sh, I reach for perl. Once I got the idea
of regular expressions (get the Owl book, Luke), perl became a joy.

Can anyone here familiar in Perl tell me if it is possible to have my program working on something but be alerted when a key is pressed (or a mouse button pressed), something akin to "onkey gosub" or "onmouse gosub"?

I started with tcl/tk for just the reason you cite, to see what it takes
to write a GUI proggie. Even with that, it took a little more than I was
interested in doing, so I explored the WYSISYG tcl/tk window makers.
They're limited tools it turns out -- fine for slapping a few simple
widgets together, but they hit the wall quickly. Nevertheless, examining
the code they write made me more sophisticated, and I still use my fave
(SpecTcl) to whip out quickies.

So, briefly, what's the difference between "tcl/tk ... to write a GUI proggie" and "the WYSIWYG tcl/tk window makers"? (BTW, I know the term WYSIWYG.) And what is the difference between those and "SpecTcl"?

I also appreciate being able to hack both perl and tcl. Sometimes it's as
simple as setting some defaults in the code.

But today I can do anything in tcl that I can do in perl, and often
quicker and easier. Best of all, the code tends to be easier to read,
support, and reuse.

Finally, on making a buck: I started doing SW Comfiguration Management in
'85 with DOS PVCS just to keep some code I was working on straight. Within
4 hours of the package arriving from the vendor, I had installed it and
used it to find two elusive bugs that had been hiding from me for months.
I was hooked.

Now I make my living at SCM exclusively (turned out I was better at it
than I was at coding). So ya' never know where something's leading. But
the point was not that it would turn into a cash cow. The point was, it
was (and still is) fun. And BTW, being able to script is central to my
value as a senior SCM guy (turns out all the SCM tools have trigger
points, and triggers should ALWAYS be scripted -- NEVER compiled ... fell
free to ask why some day).

Well, "some day" usually means "some day other than today", so I will wait until tomorrow. ;)

And to answer the bit about the "cash cow", just to be clear, I don't see programming as my path to easy street. I enjoy coding (in what limited fashion I have been able to do so). And I think I will always enjoy it. I probably would be coding little things at home even now if I had BASIC or FoxBase on Linux. Both of those have the onkey I asked about above. (Not that I cannot program without that, but what I want to bang out kinda needs that.) But I think if I felt that I was proficient enuf to be able to code for pay, I would go for it. At the very least, I would try to do it on the side while continuing to locksmith. As the coding grows, I could farm out my locksmithing work.

If you'd like some pointers to tcl/tk URLs or the good texts, ask away.
I've given up trying to promote it, but am always happy to share. Its
syntax is absurdly simple, and I keep being amazed at its power and
expressiveness.[0]

My interest is growing.  :)

Oh, and I'm kind of a middle level dabbler, but we have a high level
tcl/tk developer on the list in Darren New. The whole tcl community has
always been generous to me with their time and advice (ridicule free,
which is refreshing), and Darren is no exception.

I know. It seems like most (of this crowd anyway) sees a problem more like a challenge, or an opportunity to see the "aHA!" moment in someone else.




[0] Although I wasn't there for it, I have learned that there was a
historic perl vs tcl war back in the dark ages, mostly, sad to say,
pursued by rabid perl advocates who apparently served a jealous god who
brooked no other gods before him. Anyway, the language still suffers in
the Mindspace from the rap of being old, slow, unsupported, and limited.
Indeed, Larry Wall made a recent statement repeating those false
villifications.

I'm oblivious to such a history, and probably don't much care about that. Where it's at today is where it's at. Where it was yesterday matters little.

In fact, tcl has just gone through a new major release (OOP was moved to
the core). In tests it is marginally faster than perl (although the
difference shouldn't motivate any mass migration ... it's very minor). And
it's the most extensible scripting language I've ever seen, being
specifically designed to make writing new commands in C/C++  easy.

That's good. Even tho I don't know C, there is no shortage of C programs in Linux source that I could poke around in to get a feel for it.

And sometimes, I want that extra speed push, and from my lurkings, there seems to be no better way to speed increases than putting into C a subroutine that is used a lot (I forgot the special name for such a subroutine, core routine maybe?).

Altho there are a few that say that there is no greater speed increase than going assembly. (But (also from my lurkings), assembly has the problem of making it specific to that family of hardware.)



--
Ralph

--------------------
Mark Twain once observed that people who spell words the same way all the time are like people who wear the same clothes every day.
--quoted from http://prorev.com/quotes5.htm

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to