answersLogoWhite

0


Best Answer

If you write out the functions before you write main, you will probably have to return to the functions after outlining main and correct them so that they interact with main as they should. In the long run, it is far better to write main first, so that you understand exactly what you want each function to do before you write the function, so that you don't have to go back and correct them.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is drawback of writing the definitions of all the functions before main function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the function of technical writing?

function of technical writing tang ina mo itanong mo sa teacher nyo!!


What are the similarities and differences between procedures and functions in pascal programming language?

Procedures and functions are exactly the same in Pascal, the only difference is that a function must return a value to its caller while a procedure does not. A procedure is essentially the same as a function returning void in C. We use procedures and functions to avoid writing duplicate or repeated sections of code and thus reduce maintenance costs. With well-named procedures and functions our code also becomes self-documenting, making the code much easier to read (and maintain).


Why is definition important in technical writing?

Vocabulary definitions are critical in technical writing, so that everyone involved understand exactly which technology aspect, feature or process is being described. Not only are the definitions important in a single language, they become critical in translating the technical material into international languages.


What is the advantage of c function?

You cannot write a C program without writing at least one function, the main function (the entry point of the application). While it is possible to write all code within this one function, a non-trivial program would be difficult to maintain. When we write code as a single function, we often find ourselves writing duplicate code. That is; code where one or more operations is performed in the same sequence but where the operands may differ in name or value. Such code blocks are best replaced with a single function call. The main reason for this is that code duplication is difficult to maintain. If we decide to alter the code, we're usually forced to replace the code in all the duplicates as well. By placing the code in a function, we only have to update the code in one place. We can also use functions to reduce a complex function to a series of simple function calls. With well-named functions, the complex function becomes self-documenting, easier to read and therefore easier to maintain. This is no different to breaking a complex task down into a series of much simpler tasks and delegating those tasks to the people best suited to that task. Given that readability is fundamental to ease of maintenance, most functions become very simple, often just a single statement or algorithm. We call these functions low-level functions. They may not do very much work by themselves, but they allow us to hide low-level implementation details that would otherwise be a distraction. This allows us to concentrate on the problem at a much higher level of abstraction, creating simple high-level functions that do nothing more than coordinate calls to the low-level functions. With a well-designed system, the main function's task is reduced to processing the command-line arguments, coordinating calls to high-level functions and handling any errors returned from those functions. Each of these tasks can also be delegated to a separate function thus simplifying the main function even further.


Difference between procedural programming and modular programming?

Procedural programming is a computer programming technique in which the program is divided into modules like function or subroutine or procedure or subprograms, where as ... "Modular Programming" is the act of designing and writing programs as interactions among functions that each perform a single well-defined function, and which have minimal side-effect interaction between them. Put differently, the content of each function is cohesive, and there is low coupling between functions as happens in procedural programming.

Related questions

What is the function of technical writing?

function of technical writing tang ina mo itanong mo sa teacher nyo!!


What are the functions of a typewriter?

Answerthe function of a type writer is to get result along as we type.it is not strenuous and it also does not affect our eyes.it only has one disadvantage thatis once a mistake is made while typing cannot be corrected


What are the similarities and differences between procedures and functions in pascal programming language?

Procedures and functions are exactly the same in Pascal, the only difference is that a function must return a value to its caller while a procedure does not. A procedure is essentially the same as a function returning void in C. We use procedures and functions to avoid writing duplicate or repeated sections of code and thus reduce maintenance costs. With well-named procedures and functions our code also becomes self-documenting, making the code much easier to read (and maintain).


Why is definition important in technical writing?

Vocabulary definitions are critical in technical writing, so that everyone involved understand exactly which technology aspect, feature or process is being described. Not only are the definitions important in a single language, they become critical in translating the technical material into international languages.


what is functions of business report?

A function of a business report would be to put in writing all the profits, income, and all the progress and falls of the business. This is usually made quartertly, monthly, annualy or depending on the policy of the company.


Is writing 108 words and their definitions 3 times each for homework legal in forsyth county Georgia?

Yes.


Illustrative writing makes use of definitions details examples or comparisons to present a clear logical explanation?

True


What is the advantage of c function?

You cannot write a C program without writing at least one function, the main function (the entry point of the application). While it is possible to write all code within this one function, a non-trivial program would be difficult to maintain. When we write code as a single function, we often find ourselves writing duplicate code. That is; code where one or more operations is performed in the same sequence but where the operands may differ in name or value. Such code blocks are best replaced with a single function call. The main reason for this is that code duplication is difficult to maintain. If we decide to alter the code, we're usually forced to replace the code in all the duplicates as well. By placing the code in a function, we only have to update the code in one place. We can also use functions to reduce a complex function to a series of simple function calls. With well-named functions, the complex function becomes self-documenting, easier to read and therefore easier to maintain. This is no different to breaking a complex task down into a series of much simpler tasks and delegating those tasks to the people best suited to that task. Given that readability is fundamental to ease of maintenance, most functions become very simple, often just a single statement or algorithm. We call these functions low-level functions. They may not do very much work by themselves, but they allow us to hide low-level implementation details that would otherwise be a distraction. This allows us to concentrate on the problem at a much higher level of abstraction, creating simple high-level functions that do nothing more than coordinate calls to the low-level functions. With a well-designed system, the main function's task is reduced to processing the command-line arguments, coordinating calls to high-level functions and handling any errors returned from those functions. Each of these tasks can also be delegated to a separate function thus simplifying the main function even further.


What is c language functions?

The answer is, "user-defined functions can be written in C (or a language that can be made compatible with C, such as C++). Such functions are compiled into dynamically loadable objects (also called shared libraries) and are loaded by the server on demand. The dynamic loading feature is what distinguishes "C language" functions from "internal" functions - the actual coding conventions are essentially the same for both. (Hence, the standard internal function library is a rich source of coding examples for user-defined C functions.) Two different calling conventions are currently used for C functions. The newer "version 1" calling convention is indicated by writing a PG_FUNCTION_INFO_V1() macro call for the function, as illustrated below. Lack of such a macro indicates an old-style ("version 0") function. The language name specified in CREATE FUNCTION is C in either case. Old-style functions are now deprecated because of portability problems and lack of functionality, but they are still supported for compatibility reasons."


What is the advantags of C?

You cannot write a C program without writing at least one function, the main function (the entry point of the application). While it is possible to write all code within this one function, a non-trivial program would be difficult to maintain. When we write code as a single function, we often find ourselves writing duplicate code. That is; code where one or more operations is performed in the same sequence but where the operands may differ in name or value. Such code blocks are best replaced with a single function call. The main reason for this is that code duplication is difficult to maintain. If we decide to alter the code, we're usually forced to replace the code in all the duplicates as well. By placing the code in a function, we only have to update the code in one place. We can also use functions to reduce a complex function to a series of simple function calls. With well-named functions, the complex function becomes self-documenting, easier to read and therefore easier to maintain. This is no different to breaking a complex task down into a series of much simpler tasks and delegating those tasks to the people best suited to that task. Given that readability is fundamental to ease of maintenance, most functions become very simple, often just a single statement or algorithm. We call these functions low-level functions. They may not do very much work by themselves, but they allow us to hide low-level implementation details that would otherwise be a distraction. This allows us to concentrate on the problem at a much higher level of abstraction, creating simple high-level functions that do nothing more than coordinate calls to the low-level functions. With a well-designed system, the main function's task is reduced to processing the command-line arguments, coordinating calls to high-level functions and handling any errors returned from those functions. Each of these tasks can also be delegated to a separate function thus simplifying the main function even further.


What is one of the functions of a peer review?

To look for common writing problems.


What are the functions of CD-ROM?

The main functions of a CD-ROM drive involve reading data on a compact disk and writing data on the same. This drive also makes it possible to boot a computer from a cd with a bootable installation.