Questions tagged [procedural-programming]

Procedural programming is a term used to denote the way in which a computer programmer writes a program. This method of developing software, which also is called an application, revolves around keeping code as concise as possible. It also focuses on a very specific end result to be achieved. When it is mandatory that a program complete certain steps to achieve specific results, the code is said to have been written according to procedural programming.

Procedural programming is not always the preferred method of coding applications. Software that is highly complex can require literally thousands of lines of code, making it somewhat more difficult for a team of people to work with it. Some programmers hold the opinion that extremely large applications can become difficult to maintain even by one developer.

Some people wrongly believe that it is impossible to write very large or complex software in a procedural programming language. Certain programs might be more easily written using Object Oriented Programming (OOP), but this does not mean that they cannot be developed procedurally. The Linux kernel, which is the core of an open-source operating system, is written using procedural programming. Other major applications such as the Apache server, the Drupal content management system and Samba, are all written in this manner. These applications are large and are considered to be complex by the overwhelming majority of programmers.

Among the procedural programming languages in existence are C, Fortran and Python. Many important applications and utilities have been coded in such languages. For example, Anaconda, the installer for Fedora Linux, is written in Python, as are various software managements tools.

Imperative programming is another term used to signify this type of development.

252 questions
2
votes
1 answer

Procedural vs. Functional Javascript

I have a fairly time-critical piece of code in a react app that gets run on all user keystrokes in a form. It has no performance issues in general, but I was looking into optimising it a bit and was a little surprised at the performance differences…
2
votes
1 answer

From a good code design point of view how should algorithms and data objects interact?

I created some data objects for my data in Python. Now, I need to write some algorithms that process this data. I am debating between writing the algorithms as: (1) Methods of the Data objects. (2) Functions in a separate module. (3) Algorithm…
2
votes
1 answer

How OOP languages differs from procedural languages in terms of memory utilization

I want to understand how OOP programming languages differs from procedural languages in terms of memory utilization. To be more specific, let's assume we are talking about Java and C as examples: Is it true that objects are automatically stored in…
2
votes
1 answer

C Program - Validate numbers read from a text file

I am reading 15 numbers from a text file, with each number in a new line: 1 2 3 4 5 10 12 13 14 15 21 22 23 24 26 As you can see from the code I need the numbers to be validated so they are less than 26, otherwise terminate the program. At the…
marley89
  • 411
  • 4
  • 8
2
votes
0 answers

Procedural programming v/s importing objects in Three.js

I am creating a city in Three.js. There are two ways of doing this: a) Via Procedural programming b) By creating the city in a 3D editor (Three.js editor/ 3DS Max etc.) and importing it as a "scene" in Three.js. It is easier to design & create the…
A.K
  • 91
  • 4
2
votes
1 answer

Procedurally-driven "font"?

After coming across this; I am looking for a way to procedurally generate handwriting. I have been searching the internet for about an hour; and have either not been able to deduce the proper search query, or this sort of thing is not that common.…
motoku
  • 1,571
  • 1
  • 21
  • 49
2
votes
2 answers

How to fix the procedure

Help me, please! There's the procedure operation[f_]. It works correctly and plot for functions:Cos,Sin. But, Unfortunately, it doesn't work for E^x and Log[E,x] and outputs errors, maybe because inputting not correct name of function or something…
Julia
  • 674
  • 1
  • 6
  • 18
2
votes
1 answer

How to reference a result set in plpgsql

In a plpgsql procedure I am looking how to reference and use a result set that I get from the first query. Following code tries to demonstrate what I want to achieve: do $body$ DECLARE ref_result_set ???; BEGIN ref_result_set := select…
2
votes
1 answer

The suitability of a procedural programming language for graphical applications

Is anyone able to explain or evaluate the suitability of a procedural programming language for graphical applications, against object orientated programming for instance. What are the advantages and disadvantages of both?
2
votes
1 answer

Procedural PHP vs Object Oriented PHP

I am fairly new to PHP (you just have to see some of my previous/recent posts!). I have done a lot of my learning by studying other people's frameworks and attempting to rewrite them for my own purpose. Out of the examples of code I have seen, it…
Wildcard27
  • 1,437
  • 18
  • 48
2
votes
1 answer

PHP: proper function call from $_REQUEST

I've been reading a project (not based on any PHP framework) and I met the following (procedural) code on nearly every PHP file that responds to user requests (either $_GET or $_POST). if ($_REQUEST['a']){ $func="a_".$_REQUEST['a']; if…
antiauthor
  • 80
  • 6
2
votes
2 answers

algorithm for block generation from nodes and relationships

I have list of nodes and lines between them, it looks like this: What I need is to generate blocks, in this case it would be like this: block1:1,2,14,11 block2:2,13,12,14 block3:2,3,4,5,6,12,13 block4:6,7,12 etc... Doeas anybody have any idea how…
user1602687
  • 1,477
  • 3
  • 14
  • 13
2
votes
3 answers

How would I 'spawn' or instantiate multiple creatures procedurally?

When I decided to teach myself to program, I started with Java. And although I'm familiar with writing simple procedural software (mostly in PHP), I've recently come to realize that for more complex operations I rely on objects. My first Java game…
ICoffeeConsumer
  • 882
  • 1
  • 8
  • 22
2
votes
0 answers

What is the best way to learn and master Python, from a procedural programmer perspective?

I am Mathematician and I currently work mainly on Operations Research field, building algorithms for solving Mathematical Programming or Optimization problems. I learnt Fortran, Pascal and C (oh, and Visual Basic) when I was a student, not very…
2
votes
1 answer

What GUI libraries are not object-oriented?

I have been using C a lot lately, and want to explore programming more than just console applications. However, most GUI libraries are object-oriented, and it is very difficult to program with them in programming languages which are not…