Questions tagged [principles]
13 questions
16
votes
4 answers
Dependency Inversion Principle vs "Program to an interface, not an implementation"
I'm trying to understand how the Dependency Inversion Principle differs from the "program to an interface, not an implementation" principle.
I understand what "Program to an interface, not an implementation" means. I also understand how it allows…

Aviv Cohn
- 21,190
- 31
- 118
- 178
16
votes
2 answers
Build one to throw away vs Second-system effect
On one hand there is an advice that says "Build one to throw away". Only after finishing a software system and seeing the end product we realize what went wrong in the design phase and understand how we should have really done it.
On the other hand…

Random42
- 10,370
- 10
- 48
- 65
10
votes
4 answers
What's the name of the principle that a method should EITHER orchestrate OR do?
I recall a principle that a professor talked about while I was in school (back in the mists of time) that went something along the lines of "A method/function should either orchestrate other functions, or perform small, a specific task", but I can't…

Garandy
- 211
- 1
- 7
7
votes
2 answers
What is "Semantics visibility"?
I'm reading 97 Things Every Programmer Should Know, now I'm positioned in "Apply Functional Programming Principles", and there is a paragraph that says:
...A leading cause of defects in imperative code is attributable to
mutable variables.…

InfZero
- 171
- 3
6
votes
2 answers
How do microservices and 12-factor app principles come together?
I'm wondering how service oriented architectures can follow the 12-factor principles.
Designing an architecture as microservices means (to me) that you separate the features in services. This means you have multiple code source for the different…

Irindul
- 73
- 4
5
votes
2 answers
I keep bouncing from "god function" to "tiny SRP functions" how do I break this cycle?
This question is important for me in growing in my technical abilities. I find I swing from end-to-end, like a pendulum, in writing code that is simultaneously DRY yet readable & efficient. And I'm constantly doing this... which leads to too many…

james
- 161
- 3
4
votes
4 answers
Why is Encapsulation considered a primary principle in OOP?
I am currently trying to understand more deeply the 4 principles of OOP: Abstraction, Encapsulation, Inheritance, and Polymorphism.
After studying the four principles, I don't fully understand why Encapsulation is considered one of the four primary…

Aviv Cohn
- 21,190
- 31
- 118
- 178
2
votes
1 answer
When should concrete public methods be used if implementing an interface?
Recently I have been trying to avoid down-casting object types from an interface type to their concrete types, and 'if' statements that check for an objects concrete type at run-time. This has made me ask myself a question; Why add public methods to…

Mayron
- 181
- 4
1
vote
1 answer
Rule of Least Power - what can you deduce from it?
https://en.wikipedia.org/wiki/Rule_of_least_power
Does it mean that if you can do an animation with css you should do it with css instead of using javascript. Or if you can do an application in javascript you should do it with javascript instead of…

Claudiu Creanga
- 298
- 1
- 10
1
vote
2 answers
What are the principles of open source projects?
Although its generally agreed by organisations like the OSI and the FSF what is and isn't an open source software (basically, the the terms of the source code license) what are the guiding principals for open source projects?
Other software…

Ricardo Gladwell
- 111
- 3
0
votes
1 answer
Which principle is it to fetch only needed data?
It often makes sense to "fetch only what you need" for example if I should display only 10 rows of data then I should not fetch the entire data set because it would waste resources for a large data set.
A practical example is the SQL Limit keyword.…

Niklas Rosencrantz
- 8,008
- 17
- 56
- 95
-3
votes
2 answers
Is there reliable evidence of the benefit of implementing all practices of an Agile methodology (e.g Scrum) vs only some of them?
For example, the Scrum Guide states (emphasis mine):
The Scrum framework, as outlined herein, is immutable**. While
implementing only parts of Scrum is possible, the result is not Scrum.
Scrum exists only in its entirety and functions well as a…

Francesco Bianco
- 121
- 1
-5
votes
1 answer
violations of persistence ignorance
I have read about Persistence Ignorance principle,
The ebook give some examples of violations of this principle, but I don't understand. Could you please help me to give some explain?
Some examples of violations of this principle include:
• A…

Chau Than
- 11
- 2