none
why vb is called event driven programming?

Answers

  • Hi,

    That is because all ( or the majorty of the ) code happens as the result of something else happening....which is an event.

    Even when the FORM_LOADS , that is an event that "happens" or takes place.

    Whenever you click on something, that is an event.

    If you do NOTHING when a Vb.Net program runs, it just sits waiting for you, waiting for something to happen,
     it waits for an event then code will act on it if there is code to deal with that event.


    There are of course background Windows processes running waiting for you to move your mouse, left-click or right-click
     or whatever. So you could also say that a fair bit of WINDOWS is written that suddenly responds to events too. :-)

    Under the hood or under the "surface" a lot of this is handled with interrupts.
    Do a search on computer interrupts.

    Every time you type a letter on the keyboard, that is also handled via an interrupt.


    Regards,

    John
    Tuesday, February 09, 2010 2:20 PM
  • I would not describe VB as "event driven programming" at all. 
    One could write an entire VB application that was not event driven, at all.

    Windows is an event driven operating system, and many applications run in a window.
    Just because an application runs in a window does not make it event driven either.

    There are tons of examples of bad coding practices that ignore the event driven operating system.
    The classic example of what I mean are programs that rely on calling Application.DoEvents to unlock race conditions.

    I would describe "event driven programming" as more of a programming style, than a specific language.

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 09, 2010 2:40 PM

All replies

  • Hi,

    That is because all ( or the majorty of the ) code happens as the result of something else happening....which is an event.

    Even when the FORM_LOADS , that is an event that "happens" or takes place.

    Whenever you click on something, that is an event.

    If you do NOTHING when a Vb.Net program runs, it just sits waiting for you, waiting for something to happen,
     it waits for an event then code will act on it if there is code to deal with that event.


    There are of course background Windows processes running waiting for you to move your mouse, left-click or right-click
     or whatever. So you could also say that a fair bit of WINDOWS is written that suddenly responds to events too. :-)

    Under the hood or under the "surface" a lot of this is handled with interrupts.
    Do a search on computer interrupts.

    Every time you type a letter on the keyboard, that is also handled via an interrupt.


    Regards,

    John
    Tuesday, February 09, 2010 2:20 PM
  • I would not describe VB as "event driven programming" at all. 
    One could write an entire VB application that was not event driven, at all.

    Windows is an event driven operating system, and many applications run in a window.
    Just because an application runs in a window does not make it event driven either.

    There are tons of examples of bad coding practices that ignore the event driven operating system.
    The classic example of what I mean are programs that rely on calling Application.DoEvents to unlock race conditions.

    I would describe "event driven programming" as more of a programming style, than a specific language.

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 09, 2010 2:40 PM
  • 1) I would not describe VB as "event driven programming" at all.
     
    2) One could write an entire VB application that was not event driven, at all.



    Hi Rudy,

    1) Many people do though.

    2) Please give a short simple example.  I look forward to it.


    Regards,

    John
    Tuesday, February 09, 2010 2:49 PM
  • A simple example of an application that is not event driven is one that reads files. or even a database table.  The application modifies the contents and writes the data back.  No events required to do that.  How many applications or classes have you written that do not have or subscribe to events?

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 09, 2010 3:00 PM
  • A simple Console Application is technically not event driven.


    Bill Gates look out!
    • Edited by Shmuel Englard Tuesday, February 09, 2010 7:19 PM spelling
    Tuesday, February 09, 2010 5:00 PM
  • That is in oposite to non event driven program languages like for instance Cobol and Fortran.

    Those are driven by transactions which are going in a serial way (can become from more directions).

     The event is like Rudy write in fact a kind of windows feature, but it are languages like Visual Basic which take full advantage from it.

    Which does not mean that with Visual Basic cannot created transaction driven programs, but that is not the first purpose for what it is created.


    Success
    Cor
    Tuesday, February 09, 2010 5:31 PM
  • Hi rajan,
    Because The events in your program is running by an action from the user but the dos is a statement or non driven program that's running by a lines only so that the programs in windows generally named
    as driven programs.

    don't forget to mark this post as answer if this post help you
    Mohamed Elghamry
     
    Tuesday, February 09, 2010 7:06 PM
  • A simple Console Application is technically not event driven.


    So why is VB called event driven by some?

    Because they are speaking most inaccurately. 
    Not taking into account all of the possibilities, and ignoring the all too obvious.  Easy mistake to make.

    Rudy  =8^D

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 09, 2010 7:10 PM
  • A simple Console Application is technically not event driven.


    So why is VB called event driven by some?

    Because they are speaking most inaccurately. 
    Not taking into account all of the possibilities, and ignoring the all too obvious.  Easy mistake to make.

    Rudy  =8^D

    Mark the best replies as answers. "Fooling computers since 1971."



    Hi Rudy,

    What about user or keyboard input in a CONSOLE application then?

    There is still a BIOS event that reponds to the keyboard keys being typed on or pressed, or am I being pedantic ?

    Then whatever drives the CONSOLE window to run responds to any user input in a CONSOLE application.

    Even when you say;

    "A simple example of an application that is not event driven is one that reads files . or even a database table.  The application modifies the contents and writes the data back .  No events required to do that.  How many applications or classes have you written that do not have or subscribe to events?"


    You could also call reading and writing files events that happen via the BIOS or / and the installed operating system,
     or am I being pedantic again ?


    Regards,

    John

    Tuesday, February 16, 2010 1:18 AM
  • Hate to say it John, but while you are right if one wants to be pedantic, for the most part Event Driven Programing means that the program is responding to an event. So while a console application that reads from the keyboard might be considered event driven, if all a programs does when lanched is read in a file and then write something back the prorgam has not responded to any event.
    Bill Gates look out!
    Tuesday, February 16, 2010 2:45 AM
  • Hate to say it John, but while you are right if one wants to be pedantic, for the most part Event Driven Programing means that the program  is responding to an event. So while a console application that reads from the keyboard might be considered event driven, if all the programs does when lanched is read in a file and then write something back the program has not responded to any event .
    Bill Gates look out!

    Hi Bill Gates II ,

    Except for maybe launching the program and closing it perhaps ( with a mouse-click event or keyboard event )?

    You could even call hitting the power switch for the computer an event!! So in that sense even the early computers
     built with valves and hard wired switches responded to the event of being turned on!!


    Regards,

    John

    Tuesday, February 16, 2010 3:17 AM
  • Typo on my part, I meant "if all a program does...", meaning that you have a program that does not interact with the user in any way.


    Bill Gates look out!
    Tuesday, February 16, 2010 3:24 AM
  • Typo on my part, I meant "if all a program does...", meaning that you have a program that does not interact with the user in any way.


    Bill Gates look out!


    Hi Bill Gates II,

    All programs are launched by the user either;

    a) Starting His / Her computer or

    b) with a mouse click or

    c) from a command line in a shell like environment.

    This is the minimum amount of interaction required for any program to run.
    Whether a program informs you that it is running, is another matter!!

    A program does not choose to run all by itself. See.>> http://www.elook.org/dictionary/interaction.html

    Sorry but I feel like being very pedantic today. :-)


    Regards,

    John

    Tuesday, February 16, 2010 3:40 AM
  • d) another program.


    Bill Gates look out!
    Tuesday, February 16, 2010 3:43 AM
  • d) another program.


    Bill Gates look out!

    Hi Bill Gates II ,

    That is still a consequence of an initial user action.

    So a program that could possibly run by being called by another program;

    a) Does not HAVE TO run!!

    b) Is still acting on an action of the calling program being run by some initial action from the user.

    I still see this as a user interaction as it is a response to something happening initiated by the user ,
     that can be traced back to the user.

    Even if a computer wakes up on a signal from a modem or via a LAN signal it is still the result of an initial user request .

    Even if that request is an automatically timed request every day at say 2am. This is still at the request of some initial user or programmer .


    Therefore all events are initiated by a user or programmer , whether those events happen later in an automatic fashion or not is irrelevant.

    Computers do nothing by themselves and I hope they never do !! Otherwise one day we may have a Terminator scenario.

    Mankind can still turn every computer in the world off, if we really wanted to!!


    Regards,

    John

    Tuesday, February 16, 2010 4:05 AM
  • I guess it depends on how one defines an event really.

    (and I agree about the computers doing things them selves thing)
    Bill Gates look out!
    Tuesday, February 16, 2010 4:15 AM
  • I guess it depends on how one defines an event really.

    (and I agree about the computers doing things them selves thing)
    Bill Gates look out!


    Hi Bill Gates II,

    Exactly!! You got my meaning(s).  :-D  My main point is that all computer events are triggered by one initial user event.

    Turning the computer on in the first place!!  As the Doctor in Doctor Who would say it is all; "Cause and effect".

    Then if you believe the BIG BANG theory, all events stemmed from that one event!! The "user" for BIG BANG event = GOD if
     you believe in GOD.

    :-D


    Regards,

    John

    Tuesday, February 16, 2010 4:30 AM
  • You're having WAAAAAAAAAAAY too much fun with this!
    Bill Gates look out!
    Tuesday, February 16, 2010 4:36 AM
  • You're having WAAAAAAAAAAAY too much fun with this!
    Bill Gates look out!

    Hi Bill Gates II ,

    I bet you are having a good old laugh too!! LOL!!   :-D   ;-)   :-}   ;-]

    (-:   [-;


    Regards,

    John

    Tuesday, February 16, 2010 4:41 AM
  • VB is called Event-Driven because it has the capability of responding to events, not because you have to create VB programs using an event-driven model.  The description is quite correct because it distinguishes VB from previous versions of BASIC (and a number of other programming languages) which do not have the ability to respond to events.
    Tuesday, February 16, 2010 5:48 AM
  • @Acamar:

    Going by your definition, then most every computer language that has ever been created up till now is event driven.  Let's take your example VB and BASIC.  Every version of BASIC that I have seen, at least gave you the ability to wait for and read keyboard input from the user.

    Every CPU, which does not always mean computer chip, that I am familiar with has a means to generate "Interrupts", either through hardware or software.

    "Event Driven Programming".  So why not call VB "Object Oriented Programming"? 
    VB is just as capable of producing OOP as it is EDP.

    Rudy  =8^D

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 16, 2010 1:42 PM
  • @Acamar:

    Going by your definition, then most every computer language that has been created up till now is event driven.  Let's take your example VB and BASIC.  Every version of BASIC that I have seen, at least gave you the ability to wait for and read keyboard input from the user .

    Every CPU, which does not always mean computer chip, that I am familiar with has a means to generate "Interrupts", either through hardware or software.

    Rudy  =8^D

    Mark the best replies as answers. "Fooling computers since 1971."

    Hi Acamar and Rudy,

    Let us not argue or discuss this for too long please .

    It is just that, in my opinion , any keyboard keypress or mouse movement or turning a computer on / off
     could be regarded as an event as it is something that happens when each of uses a computer. Enough said?


    Regards,

    John

    Tuesday, February 16, 2010 1:52 PM
  • No one is arguing.  I think the term EDP is grossly mis-used.  I think it refers more to a style or structure to the code than what the code actually does.  The "hows and whys", not the "whats and whens", of how the the code works.  As I pointed out above---and you left it out, too---following the same argument to its conclusion, then VB could be called Object Oriented Programming.

    In fact VB could be called lots of stuff, all of which refer to a developer's style and not how the language works.

    -Event Driven Programming
    -Object Oriented Programming
    -Procedure Driven Programming

    You could even apply the terms "elegant" or "spaghetti" to some VB programs.  Again, none of those descriptions apply to how the language works.  They all refer to a different programming style or programming architecture .

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 16, 2010 2:09 PM
  • Going by your definition, then most every computer language that has ever been created up till now is event driven.  Let's take your example VB and BASIC.  Every version of BASIC that I have seen, at least gave you the ability to wait for and read keyboard input from the user.
    Waiting for an event is not the same as being driven by the event.  Waiting is easy.  Being driven by the event requires a completely different model.
    Tuesday, February 16, 2010 7:54 PM
  • Waiting for an event is not the same as being driven by the event.  Waiting is easy. 
    Being driven by the event requires a completely different model.



    We Agree!  My point, exactly.

    Mark the best replies as answers. "Fooling computers since 1971."
    Tuesday, February 16, 2010 8:06 PM