Click here to Skip to main content
15,884,629 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Is it better to Pin
Mircea Neacsu3-Oct-22 3:50
Mircea Neacsu3-Oct-22 3:50 
GeneralRe: Is it better to Pin
Peter_in_27803-Oct-22 11:17
professionalPeter_in_27803-Oct-22 11:17 
GeneralRe: Is it better to Pin
Marc Clifton3-Oct-22 3:55
mvaMarc Clifton3-Oct-22 3:55 
GeneralRe: Is it better to Pin
CPallini3-Oct-22 5:12
mveCPallini3-Oct-22 5:12 
GeneralRe: Is it better to Pin
Daniel Pfeffer3-Oct-22 5:49
professionalDaniel Pfeffer3-Oct-22 5:49 
GeneralRe: Is it better to Pin
Edward Aymami3-Oct-22 6:40
Edward Aymami3-Oct-22 6:40 
GeneralRe: Is it better to Pin
PIEBALDconsult3-Oct-22 6:58
mvePIEBALDconsult3-Oct-22 6:58 
GeneralRe: Is it better to Pin
trønderen3-Oct-22 9:56
trønderen3-Oct-22 9:56 
Sometimes, it can be better to ask for forgiveness.

When entering a new job many years ago, I was given the task to write a GUI for a distributed debugger - extremely fancy for its time, but strictly command line oriented. The company had no experience whatsoever with GUIs (some eccentrics were using emacs for editing source code, but that was the limit of GUIs for them). So I was hired to create a Windows-like UI of mice and men(ues), updating the display immediately when something happened etc. etc. The major problem was that I was given nothing but the existing command line interface to interact with the debugger core, no API. The CLI was a conventional command-output one: You ask for the value of some entity, and it is printed on the console.

To keep updated e.g. the state display of all treads in all machines in the network, to make it appear as if display updates were event driven, I had to poll all displayed values continuously. I started out with polling/updating visible values only, but customers complained: When they pulled a large table to the front, they had to wait for the update. The table might well contain five thousand threads from a dozen nodes, sorted on the thread state value - that update was nothing like 'immediate'. So I had to change that to continuously polling all values of all data structures on the screen, whether visible or not.

The attitude towards performance was 'Throw in some more iron'. But there was a second problem: Before I was hired, the management had decided that this GUI was to be implemented in Tcl/Tk. They had read that Tcl/Tk is a great tool for making GUIs (but it had never been tried out before in other projects). This decision was carved in stone and could not be argued.

This was before Tck/Tk had any sort of (byte) compiler; if you iterated a tight loop a thousand times, the loop body was parsed from source code a thousand times. Running busy loop polling on several dozen tables, each of hundreds or thousands of entries, having to parse the output from a CLI interface, is not the thing you would do in a language every source line anew every time it was executed. It also follows that even the most obvious syntax errors were detected until you attempted to execute that line, and the system crashed.

I begged for permission to at least partially change the implementation to something else. It was denied.

As Tcl programmers know, you can write functions in C, compile them and link them to your TCL process with a plugin-like mechanism. I was so frustrated with Tcl/Tk that I essentially spent my summer vacation one year to translate the great majority of Tcl functions into C, using Tcl only as a glue language between them, and for interacting with the Tk widget set. By the end of the summer, more than 30% of the code was still Tcl, but the speedup was a factor of 3-5x (and would later increase a lot more). The system was dramatically more stable (in the Tcl to C translation, I had detected a lot of small and large errors that by pure luck or accident had never been executed).

So after my vacation was over, I went to the boss: Sir, I know that I was not permitted to do this in my working hours, so I did it during my vacation. Now we have two identically looking GUIs, identical functionality, but one is 3-5 times as fast and far more stable than the other. Which one of these do you want me to continue working on?

I was forgiven for breaking the strict order to stick with Tcl/Tk throughout.

That debugger GUI was my first Tcl/Tk project, and for 20 years, I have succeeded in keeping it the only one. I have been hating Tcl (and to some degree, Tk) ever since. If you want a language that pushes all the negative aspects of interpreted languages to their extremes, go to Tcl!
GeneralRe: Is it better to Pin
trønderen3-Oct-22 8:57
trønderen3-Oct-22 8:57 
PraiseRe: Is it better to Pin
Eddy Vluggen3-Oct-22 10:10
professionalEddy Vluggen3-Oct-22 10:10 
GeneralRe: Is it better to Pin
jmaida3-Oct-22 13:43
jmaida3-Oct-22 13:43 
GeneralRe: Is it better to Pin
megaadam3-Oct-22 22:57
professionalmegaadam3-Oct-22 22:57 
GeneralCCC 2022-10-03 Pin
Peter_in_27802-Oct-22 22:01
professionalPeter_in_27802-Oct-22 22:01 
GeneralRe: CCC 2022-10-03 Pin
OriginalGriff2-Oct-22 22:14
mveOriginalGriff2-Oct-22 22:14 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
Peter_in_27802-Oct-22 22:21
professionalPeter_in_27802-Oct-22 22:21 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
OriginalGriff2-Oct-22 22:29
mveOriginalGriff2-Oct-22 22:29 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
Chris C-B3-Oct-22 0:14
Chris C-B3-Oct-22 0:14 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
OriginalGriff3-Oct-22 0:34
mveOriginalGriff3-Oct-22 0:34 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
Kornfeld Eliyahu Peter3-Oct-22 0:44
professionalKornfeld Eliyahu Peter3-Oct-22 0:44 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
Richard MacCutchan3-Oct-22 0:44
mveRichard MacCutchan3-Oct-22 0:44 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
OriginalGriff3-Oct-22 0:51
mveOriginalGriff3-Oct-22 0:51 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
Richard MacCutchan3-Oct-22 1:24
mveRichard MacCutchan3-Oct-22 1:24 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
FreedMalloc3-Oct-22 10:18
FreedMalloc3-Oct-22 10:18 
GeneralRe: CCC 2022-10-03 - WINNER! Pin
OriginalGriff3-Oct-22 18:23
mveOriginalGriff3-Oct-22 18:23 
Generalworldle 255 Pin
jmaida2-Oct-22 19:09
jmaida2-Oct-22 19:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.