Questions tagged [procedural]

Procedural programming is a design methodology in which large programs are broken down into procedures or subroutines.

Procedural programming is a design methodology in which large programs are broken down into procedures or subroutines. It is a form of imperative programming.

Examples of programming languages that support procedural designs include C and Pascal.

44 questions
112
votes
4 answers

What's The Difference Between Imperative, Procedural and Structured Programming?

By researching around (books, Wikipedia, similar questions on SE, etc) I came to understand that Imperative programming is one of the major programming paradigms, where you describe a series of commands (or statements) for the computer to execute…
111
votes
13 answers

Why is C not considered an 'object-oriented' language?

It seems that C has its own quasi-objects such as 'structs' that can be considered as objects (in the high-level way that we would normally think). And also, C files themselves are basically separate "modules", right? Then aren't modules kind of…
Dark Templar
  • 6,223
  • 16
  • 46
  • 46
99
votes
16 answers

Why aren't user-defined operators more common?

One feature I miss in from functional languages is the idea that operators are just functions, so adding a custom operator is often as simple as adding a function. Many procedural languages allow operator overloads, so in some sense operators are…
beatgammit
  • 1,907
  • 3
  • 18
  • 25
82
votes
12 answers

What's the benefit of object-oriented programming over procedural programming?

I'm trying to understand the difference between procedural languages like C and object-oriented languages like C++. I've never used C++, but I've been discussing with my friends on how to differentiate the two. I've been told C++ has object-oriented…
niko
  • 2,119
  • 3
  • 22
  • 19
33
votes
4 answers

What exactly is procedural programming? How exactly is it different from OOP? Is it the same as functional programming?

I am programming in Java in a very object-oriented (OO) style. OOP comes very intuitively to me, but I have very little knowledge about other kinds of programming. What exactly is procedural programming? How exactly is it different from OOP? Is it…
Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
25
votes
7 answers

What were the Design Patterns of the procedural programming era?

Similar: How was programming done 20 years ago? OOP is quite fashionable nowadays, having its roots in Simula 67 in the 1960s, and later made popular by Smalltalk and C++. We have DRY, SOLID, many books about design patterns in the object-oriented…
Vorac
  • 7,073
  • 7
  • 38
  • 58
13
votes
4 answers

Cleanest way to write logically procedural software in an OO language

I'm an electrical engineer and I don't know what the hell I'm doing. Please save the future maintainers of my code. Recently I've been working on a number of smaller programs (in C#) whose functionality is logically "procedural". For example, one of…
Lombard
  • 241
  • 2
  • 6
13
votes
5 answers

Is unit testing procedural code effective?

On a current project, the powers that be want to have unit testing incorporated into our development cycle to avoid the constant amount of bugs that seem to seep into our code. The problem is that the spaghetti code is 95% percent procedural, which…
canadiancreed
  • 871
  • 1
  • 9
  • 22
11
votes
8 answers

Structuring Procedural vs OO code

I have spent the vast majority of my programming career using Java and very OO based C++. I am really interested in learning to think more procedurally, so I have been starting to do some practice using a more restricted subset of C++ (basically C)…
JParrilla
  • 671
  • 1
  • 6
  • 9
10
votes
2 answers

Programming to Data Oriented Interfaces

There is a portion of our codebase written in the following style: // IScheduledTask.cs public interface IScheduledTask { string TaskName { get; set; } int TaskPriority { get; set; } List Subtasks { get; set; } // ...…
walpen
  • 3,231
  • 1
  • 11
  • 20
8
votes
2 answers

Is recursive code slower than non-recursive code?

Now I'm only a novice programmer, but what my friends that are studying programming tell me is that recursive code is a good thing, it leads to less code duplication and it looks more elegant. Now it may be so, but everytime I've tried my hand with…
Overly Excessive
  • 191
  • 1
  • 1
  • 4
8
votes
6 answers

Naming functions that retrieve a value

I have this personal rule to start all function/method names with a verb. My verb of choice for functions or methods that get a value based on some data structure or object is get. I'm wondering if that's a good idea. The good thing about get is…
futlib
  • 2,107
  • 3
  • 21
  • 26
6
votes
1 answer

Testing procedural code

TL;DR. Writing procedural code within a DB transaction. How can I improve design of the code so it's better testable? In my application I have a service object that perform multiple things within the same transaction. See code in Ruby below: class…
6
votes
6 answers

Can you learn OO programming without procedural?

I've seen a number of question asking whether someone should learn procedural or OO first. But is this even possible? Can you learn OO programming without first having an understanding of procedural programming? Obviously, they can learn to program…
Winston Ewert
  • 24,732
  • 12
  • 72
  • 103
6
votes
2 answers

Non-OOP languages advantages and good uses

I'm a C# developer, but I also know Java, JavaScript, XSLT, a little of C and Perl, and some other that I may have forgotten. Still, the paradigm I'm most familiar with is OOP. I have always thought that OOP was the natural evolution of procedural…
Raphael
  • 1,987
  • 2
  • 16
  • 15
1
2 3