f



Introducing Tcl/Tk to a programmer

I have a programmer friend who recently asked me recommend a language for
him to learn. He wants a utility language which he can use to write small
tools and applications, preferably with a GUI and to run on Windows.
"Sure," I said, "Perl! No - wait! Tcl!"

I've been using Tcl for 10 years or more but I've never had to describe why
it's so much better than Perl et al from a scripting point of view. (I can
describe embedability, extensability, etc.) I kind of "know" the beauty of
the language is it's dynamic nature, but how do you get that across to
someone who is used to coding C++ for a living?

I volunteered to go round to this guy's house and show him the light. I
envision myself sitting in front of tkcon making buttons and things pop up.
That'll take 5 minutes. Any suggestions where I take him next?

-- 
The email address used to post is a spam pit. Contact me at
http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
0
nospam191 (234)
1/19/2005 1:04:14 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

7 Replies
503 Views

Similar Articles

[PageSpeed] 38

Derek Fountain wrote:
> I have a programmer friend who recently asked me recommend a language for
> him to learn. He wants a utility language which he can use to write small
> tools and applications, preferably with a GUI and to run on Windows.
> "Sure," I said, "Perl! No - wait! Tcl!"
> 
> I've been using Tcl for 10 years or more but I've never had to describe why
> it's so much better than Perl et al from a scripting point of view. (I can
> describe embedability, extensability, etc.) I kind of "know" the beauty of
> the language is it's dynamic nature, but how do you get that across to
> someone who is used to coding C++ for a living?
> 
> I volunteered to go round to this guy's house and show him the light. I
> envision myself sitting in front of tkcon making buttons and things pop up.
> That'll take 5 minutes. Any suggestions where I take him next?
> 
Tcl Tutor

-- 
+--------------------------------+---------------------------------------+
| Gerald W. Lester               | "The man who fights for his ideals is |
| Gerald.Lester@cox.net          |  the man who is alive." -- Cervantes  |
+--------------------------------+---------------------------------------+
0
Gerald.Lester (2014)
1/19/2005 4:14:42 AM
Derek Fountain wrote:

> I've been using Tcl for 10 years or more but I've never had to describe
> why it's so much better than Perl et al from a scripting point of view.

"It's easier." Not only is the basic language more compact and manageable,
but it interacts more seamlessly with the GUI. (I once read a book on
Perl/Tk and thought, "This is harder than Tcl/Tk. Why bother?") This is
important, since ease of use is the biggest reason for using a scripting
language (so far as I can tell).

> He wants a utility language which he can use to write small
> tools and applications, preferably with a GUI and to run on Windows.
> [...] Any suggestions where I take him next?

What kinds of tools and applications does he want to write? Somewhere in the
wealth of existing Tcl/Tk code, there are probably some programs related to
his areas of interest, which he could examine to see how they work.

David McClamrock

0
mcclamrock (108)
1/19/2005 9:08:40 AM
* Derek Fountain <nospam@example.com>
| I volunteered to go round to this guy's house and show him the
| light. I envision myself sitting in front of tkcon making buttons
| and things pop up.  That'll take 5 minutes. Any suggestions where I
| take him next?

If he's fluent in C++, he might be interested in the OO-Extensions to
TCL, and probably interfacing C++ to TCL.  http://mini.net/tcl/970 has
an overview about TCL-OO, also there have been recent posts on this
group about which OO-System to favor.

R'
0
ralfixx (1283)
1/19/2005 9:46:42 AM
David McClamrock wrote:
> Derek Fountain wrote:
<snip>
> "It's easier." Not only is the basic language more compact and
manageable,
> but it interacts more seamlessly with the GUI. (I once read a book on
> Perl/Tk and thought, "This is harder than Tcl/Tk. Why bother?") This
is
> important, since ease of use is the biggest reason for using a
scripting
> language (so far as I can tell).
>
<snip>

I agree totally. When dealing with Tk, Tcl is the cleanest and easiest
to use.

Robert

0
sigzero (1319)
1/19/2005 1:15:58 PM
Derek Fountain wrote:
> I have a programmer friend who recently asked me recommend a language for
> him to learn. He wants a utility language which he can use to write small
> tools and applications, preferably with a GUI and to run on Windows.
> "Sure," I said, "Perl! No - wait! Tcl!"
> 
> I've been using Tcl for 10 years or more but I've never had to describe why
> it's so much better than Perl et al from a scripting point of view. (I can
> describe embedability, extensability, etc.) I kind of "know" the beauty of
> the language is it's dynamic nature, but how do you get that across to
> someone who is used to coding C++ for a living?
> 
> I volunteered to go round to this guy's house and show him the light. I
> envision myself sitting in front of tkcon making buttons and things pop up.
> That'll take 5 minutes. Any suggestions where I take him next?
> 

Working in a small company with an even smaller development staff makes 
choosing Tcl/Tk a no-brainer for application development.  The fact that 
  it's seamlessly cross-platform and is a great language for RAD (rapid 
application development) makes my job easier.

-- Kevin
0
kpenrose (15)
1/19/2005 3:44:43 PM
Kevin Penrose wrote:
> Derek Fountain wrote:
> 
>> I have a programmer friend who recently asked me recommend a language for
>> him to learn. He wants a utility language which he can use to write small
>> tools and applications, preferably with a GUI and to run on Windows.
>> "Sure," I said, "Perl! No - wait! Tcl!"
>>
>> I've been using Tcl for 10 years or more but I've never had to 
>> describe why
>> it's so much better than Perl et al from a scripting point of view. (I 
>> can
>> describe embedability, extensability, etc.) I kind of "know" the 
>> beauty of
>> the language is it's dynamic nature, but how do you get that across to
>> someone who is used to coding C++ for a living?
>>
>> I volunteered to go round to this guy's house and show him the light. I
>> envision myself sitting in front of tkcon making buttons and things 
>> pop up.
>> That'll take 5 minutes. Any suggestions where I take him next?
>>
> 

I love how I can create a socket based client / server architecture in 
just a few minutes.

Glenn
0
glennh6365 (34)
1/19/2005 10:19:38 PM
Derek Fountain wrote:

> someone who is used to coding C++ for a living?
> 
> I volunteered to go round to this guy's house and show him the light. I
> envision myself sitting in front of tkcon making buttons and things pop up.
> That'll take 5 minutes. Any suggestions where I take him next?

What does your C++ friend normally code for a living?  The most striking 
example will be something that hits close to home by doing something in 
10 lines of tcl/tk that takes 75 in C/C++/C#.


set t 1
foreach i {how long would it take you to do this in C++ ?} {
   set t [expr $t-0.04]
   button .b$i -text $i -command "destroy .b$i
      wm attributes . -alpha $t
      update
      event generate . <Motion> -warp 1 -x 8 -y 8"
   pack .b$i -side top -expand true -fill both
   after 500
   update
}


That's a good opener.  You might also want to take along examples of a 
<20 line socket client & server, a 3-line EOL char converter, and a TCOM 
example to open MS Word and insert a few lines of styled text.

-- 
MKS
0
1/26/2005 1:28:07 AM
Reply: