DEV Community

Cover image for What is programming😕
Mahmoud EL-kariouny
Mahmoud EL-kariouny

Posted on • Edited on

What is programming😕

  • Usually you want to write a computer program to solve some sort of problem.

  • Programming is figuring out how to break down your problem into a series of commands that your computer 🖳 will know how to execute.

  • It is important to remember that the computer only does what you tell it to do.

  • You give the computer commands (add, print, draw, etc.), and it will do exactly what you say, at extremely high speed.

  • A computer can execute several million commands each second🤯.

  • But, it is not actually intelligent if you give the computer incorrect instructions, the computer will still follow them, even if it breaks the computer.

  • If you tell the computer to add (0 + 0) together until it equals 1, the computer does not know that is impossible.

  • It will add (0 + 0) together, millions of times a second, and will continue working on that problem forever.

  • Ultimately, programming is a matter of translation.

  • Your task as a programmer is to translate a question you have into a set of instructions the computer can understand, so that the computer can find the answer for you.

  • There are different strategies for organizing the information the computer needs to answer your question.

  • These strategies are called programming paradigms.

*There are also different programming languages you can use to translate your question into code.

Different languages use different programming paradigms.

Procedural Programming?

  • Procedural programming is one type of programming paradigm.

  • Procedural programming follows a "first do this, next do that" process.

  • This is also sometimes called imperative programming.

  • Procedural programming is a lot like writing a recipe you come up with a specific series of instructions to achieve a desired outcome.

  • The ingredients of the recipe are like the variables in your program, the instructions are the procedures of your program, and what comes out of the oven ♨️🎛️ is the final output of the program.

What is a Procedure?

  • A procedure is the basic building block of procedural programming.

  • Procedures are also sometimes referred to as routines, subroutines, or functions.

  • Procedures help organize your code into specific parts.

  • Each procedure can perform a specific task, and can be called upon at any point in the program to fulfill that task.

Procedural Programming Example

  • Let's look at an example of how a procedural program would be structured.

  • Each block in the Sales Report program pictured to the right represents a procedure.

Image description

  • This program can Get a Transaction, Process Reports, or Print Totals.

  • The Process Reports procedure works by calling other procedures in this case, Process States and Print State Totals.

  • And the Process States procedure in turn calls other procedures - including the Get a Transaction procedure also seen at the top.

  • Remember, procedures can be reused multiple times and can be used anywhere in a program.

Connect with Me 😊

🔗 Links

linkedin

twitter

Latest comments (2)

Collapse
 
mahmoudessam profile image
Mahmoud EL-kariouny • Edited

Hi, @fhggjg

First of all, do not be struggling when you learning programming because everything will get better I promise you.

here are some good resources for you.

Visualize code Learn Python, JavaScript, C, C++, and Java: pythontutor.com/

I promise you will find all what you need on this channel: youtube.com/channel/UCxnIL1wwdHlWe...

Collapse
 
benbenlol profile image
benbenlol

Hello! If you're struggling with your Python assignments, codinghomeworkhelp can provide the assistance you need. Their help with python homework covers a wide range of topics and concepts, catering to students at all levels. Their team of experienced programmers is committed to delivering reliable solutions that can enhance your understanding and improve your grades.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.