Questions tagged [structured-programming]
A programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops.
15 questions
0
votes
1
answer
222
views
Is there a good reason not to use a "super class" (an all-encompassing class) [closed]
I write embedded software and I often find myself structuring my code such that there is one large parent class that contains just about everything. For example, consider you want to model a hardware ...
17
votes
6
answers
9k
views
Foreach-loop with break/return vs. while-loop with explicit invariant and post-condition
This is the most popular way (it seems to me) of checking if a value is in an array:
for (int x : array)
{
if (x == value)
return true;
}
return false;
However, in a book I’ve read ...
23
votes
6
answers
6k
views
Beginner: Why aren't operations contained within output commands?
I'm going through an introductory programming book and it lists a simple example in pseudocode:
Start
input myNumber
set myAnswer = myNumber * 2
output myAnswer
Stop
Why can't we omit creating ...
1
vote
2
answers
237
views
Structuring data to represent a tree with squirrels
What I want to represent
Let's assume I have several schemas of the following kind:
It is a tree on which positions of squirrels are represented by a blue dot. The number of bifurcations differ from ...
2
votes
5
answers
3k
views
Should unit-tests be entirely self-contained? [duplicate]
As the title suggests my question is whether or not
unit-tests should be entirely self-contained or can
one rely on the results yielded by previous tests?
What I mean, in case that it isn't entirely ...
3
votes
1
answer
411
views
Aren't structured programming and object oriented programming complementary?
It seems there is a lot of discussion on the web about the differences between these two paradigms, and how OOP is somewhat better than structured programming.
But aren't they complementary? From my ...
5
votes
2
answers
945
views
Lua and multi-paradigm programming: scope and capabilities
Despite having started learning programming with Pascal and C, after the jump to OO (C++, Java) I lost sense of the structured programming paradigm. I have started learning Lua and I have researched ...
116
votes
4
answers
80k
views
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 ...