# Why there are no blocking dialogs in KVIrc ?

Tecnical answer

Description

Why there are no blocking dialogs in KVIrc ?
The answer is simple: because they're more confusing and tricky than it seems.
Blocking the entire program control flow while showing a dialog is rather a bad idea since we have to deal with external entities (servers and other users) that are NOT blocked. This means that the blocking dialogs must block only the script control-flow but let the rest of the application running. Such blocking dialogs actually seem to simplify scripting because the programmer "feels" that the control is always left in the script snippet that he is writing. This is actually confusing: the control IS in the script snippet but while the dialog is open the whole world can change: you can return from the dialog call and discover that the server connection no longer exists and the application is about to quit.
This may happen even with non-blocking dialogs ,but in non-blocking mode you have a way to handle this event. Consider the following snippet of code:

        echo My name is $?

Where $? stands for a blocking input dialog that asks the user for some text.
When the input dialog returns the window that the echo was directed to no longer exists and you have no way to stop the echo! (Well...I could add extra code in the executable to handle all these situations but that would be really too expensive).
With object scripting this is actually dangerous: you might use a blocking dialog in an object signal handler and when returning discover that this object has been deleted! (The example refers to a simple object , but think about a complex hierarchy of objects where one random gets deleted...).
This is why the dialogs in KVIrc are non-blocking :)
That's REAL programming.

Index, Miscellaneous

KVIrc 4.0.2.4740 Documentation
Generated by root at Tue Feb 1 06:16:04 2011