Questions tagged [procedural]

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.

187 questions
1
vote
2 answers

"Lazyloading" information from a database on a PHP page in procedural

I know proper lazy loading usually requires using objects and a proxy pattern. I'm not there yet as a site needs some redesign. However, is there any way I can still spool out DB data to a page and speed up loading time a bit?
James P.
  • 19,313
  • 27
  • 97
  • 155
1
vote
1 answer

What would be a way to dynamically create and assign variables based on the amount of content that would be in a page

This is a theory question mainly. I am a relatively novice programmer with some skills in PHP/Javascript/C#/Python with ample knowledge of HTML/CSS. I am creating a website that reads information from a database and posts in on a page. However, the…
THENATHE
  • 11
  • 2
1
vote
0 answers

Instancing cubes and coloring them in Unity (c#)

I'm trying to automatically generate cubes in Unity with c#. I have finally succeed in creating a large number of cubes (300x300), positioning them and naming them, but I have a problem when it comes to colouring them (last part of the code). I want…
P.cordo
  • 31
  • 5
1
vote
0 answers

How do I print a row of random numbers that the user specifies?

I'm writing a program that produces a unique sequence of random integers. It will ask the user for how many rows of random numbers they want to display, and the program will print a table of random numbers. The professor suggested using the srand()…
Marco
  • 11
  • 2
1
vote
1 answer

UV mapping a procedural cylinder in Unity

I have a method that creates a cylinder based on variables that contain the height, radius and number of sides. The mesh generates fine with any number of sides, however I am really struggling with understanding how this should be UV mapped. Each…
Alx
  • 651
  • 1
  • 9
  • 26
1
vote
1 answer

Procedural mesh not rendering lighting [SceneKit - Xcode]

I am quite new to swift and Xcode however, I have been programming in other languages for several years. I am trying to procedurally create a 3D mesh in SceneKit (iOS). My code works as expected however, when running the application the generated…
Brandon Kynoch
  • 150
  • 1
  • 1
  • 7
1
vote
2 answers

Perl design question

What is the difference between writing sub functions and putting it all in one file vs. writing packages? Is object oriented better than procedural when it comes to Perl? Basically looking for examples of scenarios where OO is better than…
Chris
  • 2,923
  • 6
  • 26
  • 25
1
vote
0 answers

Spawn prefabs in front of camera while it is moving

In Unity, I'm trying to make a ground, which is the form of a matrix, procedurally generate as my player and camera move through the scene. Imagine a matrix adding a new line everytime the player gets close enough to the end of it. I've got this…
1
vote
1 answer

Assign mirror operation to vertices array

I understand the math in flipping vertex coordinates in a .obj vertices array to get the mirrored coordinate across a plane/axis. But, how do you populate the vertices array for an actual mirror operation (as opposed to just a flip)
ina
  • 19,167
  • 39
  • 122
  • 201
1
vote
0 answers

C# procedural generation- how to do always a set number?

Ok, Working in Unity here and trying to get out this core game dynamic. Basically I have all these 3D platforms that have certain weights to them (weight meaning how often they appear in the array from which game can select next platform) - right…
blue
  • 7,175
  • 16
  • 81
  • 179
1
vote
1 answer

Unity How to create a procedural tube mesh

I want to create a procedural mesh like you can see in the following picture: Unfortunately I have no idea how to do that. Can anyone of you help me out? I think I know how to create the mesh of the tube, but I do not know how to create those…
CoderOfTheForce
  • 359
  • 7
  • 22
1
vote
2 answers

Verilog:Procedural Continuous Assignment to register is not supported

input [31:0] write_data; input [4:0] write_reg; reg [31:0] registers [31:0]; always @(*) assign registers[write_reg] = write_data; I have a 32-bit input write_data , which i want to an assign corresponding index which i get from…
stacknotflow
  • 15
  • 1
  • 1
  • 3
1
vote
1 answer

Export procedural texture to a file

Is there a way to export the diffuse map of a procedural texture from blender? And would it be seamless? I would like to generate something like a tile material and then export it to a file for use in other 3D software.
KCCLEMO
  • 63
  • 1
  • 8
1
vote
0 answers

How do I refactor procedural RPC PHP to object oriented?

I have a legacy API in PHP that I need to refactor. The request must include an operation (eg. 'get_some_data') which is determined in a massive if/else sequence. All refactoring recommendations I find online consist of converting procedural to OOP,…
user3654410
  • 464
  • 3
  • 13
1
vote
1 answer

Magic numbers in color-to-image space transformation

Please disregard below; I forgot how integer overflow works >.< After seeing the incredible answers on this Code Golf question, I thought I might mess around with generating my own images in C#. I stumbled around for a while trying to make an XOR…
Paul Ferris
  • 346
  • 5
  • 17