Visual Programming Lec#1
Visual Programming Lec#1
You just have to choose/create and join the blocks and your applications are ready
without writing any lines of code and also in all the visual programming languages, one
thing is common that it will have the graphic blocks like in the given image below.
VPL can be used in multiple domains like multimedia, educational purpose, video games,
automation. Let’s see them in brief:
BS(cs) 5th Visual Programming
Multimedia:- VPL helps users create multimedia without worrying about the real
code or other complex features. It narrows down to specific functions and with the
help of those functions, multimedia is created.
Educational Purpose:-Scratch VPL, etc are used to help students in their projects
and make them familiar with the coding.
VideoGames:-VPL helps to create the videogames without writing lines of codes Ex-
Scratch VPL is used to make videogames.
Easy to convert ideas into reality for example you don’t know how to code so you can
start with VPL(Visual Programming Language). and then switch to actual coding.
Visuals are easy to grasp i.e. to develop something in visual programming language
requires less efforts.
It includes a variety of built in objects that are required while creating something
using VPL.
It is a beginner-friendly also anyone will be able to derive the logic without worrying
about writing lines of code.
Adding a user-specific code is also available and simple as it allows to create of blocks
as per the convenience of the user.
These languages require more memory as they use graphics, as a result, their
execution is also slow and a large amount of memory is occupied by them.
They can only work in an operating system like windows, mac, or any other operating
system which supports graphics.
As the inbuilt functions are not sufficient so you have to add your custom code as a
result it is cumbersome.
Only limited functions are present in these languages.
Adding our custom code as a block requires coding knowledge or else you have to
work with limited functions which are provided with the language.
As a computer engineer, it is not a good idea to use VPL as most of the tech giants like
FAANG or other tech companies work on textual languages like JAVA, HTML, etc,
rather than VPL.
For the long run VPL might not be that much useful as in a regular language you can
explore more in it but in VPL at one point you will get bored by using the same it.
BS(cs) 5th Visual Programming
Customization and flexible applications There are not that much customizable as the
can be created using regular languages blocks or graphics that contain the codes are
limited and after that, we need to add our
custom code as a block.
These are quite fast and efficient This is not fast and efficient as every block has
some code with it so it takes time and also it
has graphics with it.
The interface is not good i.e. only text The interface is great as the user has to just
and syntax of language we have to get join the blocks and frame the logic without
familiar with it. writing the code
Requires lot of efforts as a beginner to Doesn’t require a lot of effort and also the
main targeted user of VPL is school level
BS(cs) 5th Visual Programming
start with the language students so that they can love the coding
These are quite fast as compared to VPL These are slow as compared to regular
as they don’t have graphics. languages as it has graphics.
These require less memory as compared This requires more memory as it has graphics
to VPL so to store them more memory is used.
Although both Regular and Visual Programming Language is in the trend in their
respective categories the only difference that lies between them is that regular languages
are written first and with the help of visual programming languages the parts of regular
language are taken in according to its functions and the blocks and with the help of block
programming is made simpler.
BS(cs) 5th Visual Programming
Introduction to Events
Events are basically a user action like key press, clicks, mouse movements, etc., or some
occurrence like system generated notifications. Applications need to respond to events
when they occur.
Clicking on a button, or entering some text in a text box, or clicking on a menu item, all are
examples of events. An event is an action that calls a function or may cause another event.
Event handlers are functions that tell how to respond to an event.
VB.Net is an event-driven language. There are mainly two types of events −
Mouse events
Keyboard events
KeyUp − occurs when a key is released while the control has focus
The event handlers of the KeyDown and KeyUp events get an argument of
type KeyEventArgs. This object has the following properties −
Alt − it indicates whether the ALT key is pressed
Control − it indicates whether the CTRL key is pressed
Handled − it indicates whether the event is handled
KeyCode − stores the keyboard code for the event
KeyData − stores the keyboard data for the event
KeyValue − stores the keyboard value for the event
Modifiers − it indicates which modifier keys (Ctrl, Shift, and/or Alt) are pressed
Shift − it indicates if the Shift key is pressed
The event handlers of the KeyDown and KeyUp events get an argument of
type KeyEventArgs. This object has the following properties −
Handled − indicates if the KeyPress event is handled
KeyChar − stores the character corresponding to the key pressed
Definition:
Event-driven programming is a programming paradigm in which program execution is
determined by new user events (mouse clicks, keypresses), sensor outputs, or message
passing from other programs. Programmers use Event-driven programming in graphical
user interfaces and other applications that focus on performing user actions in response to
user input (user clicks).
Event Handlers
An event handler is a function that handles or responds to a specific event. Event-driven
programming uses this feature in software development. So let's take a closer look at the
event handler.
A trivial event handler has code that checks for events. The main loop is common to
applications. We can consider calling event listener OnKeyEnter () as an example. This code
contains an argument with a character string corresponding to what the user entered
before pressing the ENTER key.
When programming games in which a set of objects carries out control flow.
When creating server applications, it is undesirable to spawn service processes if, for
one reason or another.
When building user interfaces, including graphical ones.
BS(cs) 5th Visual Programming
Programming languages
Different programming languages support Event-driven programming to varying degrees.
The following languages have complete event support:
The rest of the languages, for the most part, support events as exception handling.
Service-Oriented
Time-Driven
In motivated event programming, time influenced is a paradigm. From the code that runs
on a period trigger, time motivated can be considered a specific code that works in a
particular time, which could be once one hour, once a week, or once a month.
Trigger Functions
Trigger functions in event-driven coding are functions that decide on what code to
perform whenever there is a specific event occurs. Programmers use these functions to
BS(cs) 5th Visual Programming
select which event handler to use for the function when you can find specific event
occurred.
Events
Events include mouse, computer keyboard, and user interface, which events have to be
triggered in this program. This means the user has to interact with an object in this
program, for example, click a button by a mouse, use the computer keyboard to choose a
button, etc.