guiltfeeder: What is textual programming and event programming?
I tried searching for Textual Programming in google but nothing definite comes out.
So what’s the different between the two?
Thanks in advance. ^^
Lastly, no nonsense answers, please. Yahoo answers has enough of that.
Answers and Views:
Answer by JoelKatz
I don’t believe there is any term “textual programming”. Perhaps you mean sequential programming?
Event programming means that you write code that is called when something happens. So if the user clicks on a control, a piece of code is run. If data is received from the network, a piece of code is run. You write these pieces of code and hook them up to the events. The computer figures out which pieces to run based on what events occur.
Procedural or sequential programming means you write code that runs in a defined sequence. First one step, then the next step, and so on. For example, connect to a remote web server, ask for a particular web page, wait for a reply, make sure the reply is valid, display on the screen, and so on. The computer runs the code in the defined sequence.
Constraint programming means you write a set of rules for what can and can’t be done, and the computer figures out how to satisfy the constraints. For example: My pants must be on. My pants are on the floor. If my pants are on the floor, I can pick them up. If I’m holding my pants, I can put them on my left leg. If my pants are on my left leg, but not my right, I can put them on my right leg. (Note that you can supply these rules in any order.) The computer figures out which rules it can apply in which situations and works its way to the requested goal state.
Event based programming is very good for applications that must interact with a human being (such as a browser). Procedural programming is excellent for high-performance data processing (such as a database or web server). Constraint programming is excellent for solving real-world control problems (such as an airline scheduling system or power grid control system).
Answer by mchl494Textual programming is normally referred to as syntax programming. It is a low-level format for drawing the design of your program from the bottom-up. On paper, the programmer writes the syntax for the code before writing the actual code.
Event programming refers to programming by actions performed by the users and the computers. It is more of a top-down method of programming that focuses more on the flow of the program, because it assumes that Event A will lead to Event B and then Event C will happen, etc.
Both approaches to software engineering are useful, but there is no clear answer as to which one is best. Most software engineers advocate a combination of these two approaches to produce a good computer program.
Leave a Reply