answersLogoWhite

0


Best Answer

advange:

1.speed

disadvantage

1.debugging is tough

2.no reusability

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

The main reason modular (or structured) programming is important is that it avoids the increased possibility of data corruption. Of course modular elements still have that risk but that is usually down to the user (passing by Ref instead of by Val etc.). However by using non-modular programming you can easily corrupt data without even knowing it.

Non-Modular code is normally referred to as spaghetti code. Spaghetti code is typically code that uses lots of "GOTO" which although supported by VB should be avoided.

One bad point of GOTO statements other than the fact they jump around unpredictably is their reliance on line numbers. If u add a line in the wrong place it can literally destroy your code.

This is because the GOTO command is basically a one way link so somewhere else in the code. At the end of that code will be a GOTO to get back, this is considered very messy as it leaves a virtual "trail" that can not only make it hard for other programmers to understand but also jeopardise the reliability of data via unknown lines of code changing/interacting with the stored data.

It also means the programmer needs to make sure the GOTO's are in the right place which adds a greater chance of user related mistakes.

"Structured Programming" is a idea that Modularity is closely associated with. It is the idea that structuring the program makes it easier for us to understand and therefore easier for teams of developers to work simultaneously on the same program. One advantage of structured programming is reduced complexity. Modularity allows the programmer to tackle problems in a logical fashion. Also, using logical structures ensures that the flow is clear. It is also a time saver, without modularity, code that is used multiple times needs to be written every time it is used whereas all you have to do is call a function with that code in to get the same result in a structured program.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

AdvantageAllows quick completion; usually faster than Object-Oriented programming.

DisadvantageTypically Procedural programming is not very flexible.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

Structured programming is easier to read and therefore easier to discern the logic.

For instance, the following code is unstructured:

10 x = 1

20 print x

30 x = x + 1

40 if x < 10 goto 20

The same code using structured programming:

for x=1 to 10 step 1

print x

next x

Note that structured programming does not rely on line numbers, it relies on structure. Programmers often use indentation to make the structure more obvious to the reader. In the above example, the "print x" statement is indented to make it stand out from the loop control statements.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Advantages of Structured Programming

One advantage of structured programming is reduced complexity. Modularity allows the programmer to tackle problems in logical fashion. Also, using logical structures ensures that the flow of control is clear.

Another advantage is an increase in productivity. Modularity allows multiple programmers to work on project at the same time. Modules can be re-used many times, which saves time and reduces complexity, but also increases reliability. It is also easier to update or fix the program by replacing individual modules rather than larger amounts of code.

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

The advantage is that structured code is much easier to read than unstructured code, and code that is easy to read is also easy to maintain. There are no disadvantages to structured code, other than that the compiler needs to be slightly more complicated than it would otherwise need to be with unstructured code. Structured programming is a tool and, like all tools (when used appropriately), it helps improve our productivity.

Writing unstructured code means we must think in terms of the machine, performing one operation after the other. To reduce code duplication we use conditional jumps, which makes code difficult to read as we have to continually scroll back and forth to follow those jumps. If those jumps intertwine with each other we quickly end up reading "spaghetti code" and it becomes more difficult to know what we're supposed to be keeping track of.

Structured code allows us to divide our code up into more localised code blocks. Code blocks can be conditionally executed upon a simple predicate (if true, the block executes, otherwise we ignore the block completely). Blocks can also be repeated using structured loops where the loop control conditions are stated up front (where they belong) rather than dispersed throughout the body of the loop. Variables can also be localised to a code block, so we don't have to keep track of each and every variable, only those that are actually being used by the block, thus reducing the number of globals we need to keep track of while we digest the code.

Procedural code takes structured programming to the next level where we introduce the concept of the function call and return mechanism. This allows us to give our code segments meaningful names such that the name alone tells us what the code actually does. When a called function has completed its task, control is returned to the caller, thus we can read code much more easily -- we don't have to continually scroll back and forth to find out what the function does. This allows us to create highly complex functions as a series of much simpler function calls that better explain the purpose of the code, allowing us to express ideas more clearly. When we know what a piece of code does we need not concern ourselves with how it works, thus our code becomes self-documenting and there is much less need for verbose user-comments that only serve to distract the reader.

Although function calls are expensive, by keeping our functions as simple as possible (and no simpler), the compiler can inline expand the code to eliminate the function call entirely. Again, there are no disadvantages to procedural programming; it is a tool. Object-oriented programming extends the principal even further, by localising data and the methods that operate upon that data as a self-contained entity: an object. As with procedural programming, it is not necessary to know how an object works in order to use it, provided the object has an intuitive interface. Implementation details that are of no concern to the user are simply made inaccessible, in the same way that a vending machine's user-interface provides everything the user needs to know to use the machine, while the actual machinery is safely locked away.

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

its faster than oop

disadvantage:its not flexible

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

lack of encapsulation

same code repetition

lack of information hiding

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

You have to plan the structure of your program, as you cannot just goto anywhere, as you could in an unstructured language (like BASIC or Assembly).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the advantages and disadvantages of Unstructured programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the disadvantages of boo programming language?

advantages of boo


What are the disadvantages and advantages of Planning Programming Budgeting System?

What are the disadvantages of ppbs


What are the advantages and disadvantages of algorithm?

Advantages of algorithms are that they are easy to debug, there is a clear set of instructions that can be followed, and they are independent of programming language. Disadvantages of algorithms are that they are time consuming and complicated to create.


Advantages and disadvantages of using flow charts instead of text-based programming?

There are quite a few different advantages and disadvantages of using flow charts instead of text-based programming. One pro is that this is a visual aid that helps explain your ideas.


Is c plus plus an unstructured programming language?

No, BASIC is, for example.


What are the advantages and disadvantages in using the radio?

Television advantages: wide service coverage, better quality TV, service recovery during breakdown, wide programming selections. Television disadvantages: Additional cost for special programming packages, short valuable add-on. Radio advantages: ...ask someone else...


What are advantages and disadvantages of oop 'object oriented programming?

The advantages are Data Encapsulation Data Hiding Easy to maintain the code Reuseability of classes And disadvantages are wastage of time in case of small projects or codes


What are the advantages and disadvantages of event driven programming?

Advantages: Ease of development, Flexibility, Simplicity and suitable for graphical interfaces. Disadvantages: Complex, Hard to control, Time consuming to get event loops and event handlers running.


advantages and disadvantages of equity?

Advantages and Disadvantages of equity


What are advantages and disadvantages of artificial seasoning of timber?

advantages and disadvantages


What are the disadvantages of advanced programming languages?

Taking the time to learn about advanced programming languages could cut into the timing of personal activities that should take more priority - like school and work. Advanced programming languages are also difficult to understand for novice programmers. Other obscure disadvantages lie in advanced programming - but the overall advantages outweigh them by a longshot.


What are Advantages and disadvantages of recession?

advantages and disadvantages of recession