167k views
5 votes
Why is it important for a programmer to write a code efficiently

1 Answer

3 votes

Answer:

There are various answers that are all correct.

Step-by-step explanation:

An efficient code will take less time to compile and execute. It is less noticeable in small programs but in larger ones it becomes apparent. You would rather press start and have your program give you your values immediately rather than wait 20 seconds every time.

An efficient code will be easier for you to find mistakes in if there are errors when compiling, being smaller and easier to read.

It will be easier to make small changes to an efficient program that for example, used global variables instead of local ones (where applicable).

If the code will be used/viewed by other people in the future, an efficient code will help them to use the program with ease rather than trying to understand a potentially messier code.

These are just some reasons that came to me off the top of my head, there could be more potential answers

User DeltaG
by
5.9k points