Re: Obstacles for Tcl/Tk commercial application development ?
- From: EL <eckhardnospam@xxxxxx>
- Date: Fri, 25 Jan 2008 21:55:29 +0100
briang42@xxxxxxxxxxxxxx schrieb:
I disagree. The type-less nature of Tcl combined with event based
programs results is some bizarre bugs. Usually it can be traced to
poor program design, but not always. But simple typos are a big
problem as well and it's not easy to catch these. With C/C++, you
can't even get past the compile/link phase when you have a typo.
The static vs dynamic typing issue is discussed a lot... there are people who like it this or the other way.
I can say from experience in both, static and dynamic languages, that dynamic typing has /never/ been a problem in my programs. Whenever there was a problem (bug) in a Tcl program, it was not related to the type system and would have occurred in any static language as well - but eventually much worse.
And, "Simple typos" will come back to you as soon as you run your procedure the first time for testing.
Regarding other bug sources: Consider a procedure with an out parameter:
In Tcl:
proc fun {out} {
upvar $out lclOut
set lclOut ...
...
}
In C:
int fun (int *outPtr) {
*outPtr = ...
}
Called in Tcl:
fun out
Called in C:
int out;
fun(&out);
You do not know whether out is initialized with a meaningful value in both languages - static typing does not help here. out must be declared as int in C, but does not have to be initialized. It's better to initialize it (int out = 0), but so is in Tcl:
set out 0
fun out
You still don't know whether out has a good value after the call to fun, so you need to check afterwards. In Tcl you can do:
if {[info exists out]} {...} (if you haven't initialized it before). In C you must check the value somehow. Different typing paradigms, same problems.
- Eckhard
.
- Follow-Ups:
- Re: Obstacles for Tcl/Tk commercial application development ?
- From: Óscar Fuentes
- Re: Obstacles for Tcl/Tk commercial application development ?
- References:
- Obstacles for Tcl/Tk commercial application development ?
- From: Bugs
- Re: Obstacles for Tcl/Tk commercial application development ?
- From: Bugs
- Re: Obstacles for Tcl/Tk commercial application development ?
- From: briang42
- Re: Obstacles for Tcl/Tk commercial application development ?
- From: Derek Fountain
- Re: Obstacles for Tcl/Tk commercial application development ?
- From: briang42
- Obstacles for Tcl/Tk commercial application development ?
- Prev by Date: Re: Ftp question
- Next by Date: Re: Obstacles for Tcl/Tk commercial application development ?
- Previous by thread: Re: Obstacles for Tcl/Tk commercial application development ?
- Next by thread: Re: Obstacles for Tcl/Tk commercial application development ?
- Index(es):
Relevant Pages
|