Use for questions related to programming principles; Principles describe laws or rules that according to their proponents are nearly universal truths in software engineering.
Questions tagged [principles]
64 questions
222
votes
16 answers
What is the dependency inversion principle and why is it important?
What is the dependency inversion principle and why is it important?

Phillip Wells
- 7,402
- 9
- 43
- 41
126
votes
4 answers
Principles for Modeling CouchDB Documents
I have a question that I've been trying to answer for some time now but can't figure out:
How do you design, or divide up, CouchDB documents?
Take a Blog Post for example.
The semi "relational" way to do it would be to create a few…

Lance
- 75,200
- 93
- 289
- 503
97
votes
4 answers
Design Principles, Best Practices and Design Patterns for C (or Procedural Programming in general)?
Are there any known design principles, best-practices and design patterns that one can follow while designing a C project? Or useful design principles for procedural (imperative) programming in general?
(I'm child of the 'object-oriented generation'…

Dimi
- 981
- 1
- 7
- 5
63
votes
19 answers
Best Practices & Principles for GUI design
What is your best practical user-friendly user-interface design or principle?
Please submit those practices that you find actually makes things really useful - no matter what - if it works for your users, share…

slashmais
- 7,069
- 9
- 54
- 80
46
votes
7 answers
std::ignore for ignoring unused variable
Is it a good approach to use std::ignore for ignoring unused variables?
Suppose I have a function like this:
void func(int i)
{
//for some reason, I don't need i anymore but I cannot change signature of function
std::ignore = i;…

gaurav bharadwaj
- 1,669
- 1
- 12
- 29
34
votes
3 answers
What exactly is hadoop namenode formatting?
What exactly is involved in namenode formatting. If I type in the following command into my terminal within my hadoop installation folder:
bin/hadoop namenode -format
What exactly does it accomplish? I am looking to understand principles of…

Ace
- 1,501
- 4
- 30
- 49
33
votes
1 answer
REST Best Practices: Should you return an entity on POST and PUT calls?
In order to respect the best practices of the REST principles, is it best to return the created/updated entity upon a POST/PUT ? Or return an empty HTTP body with the Location header?
More precisely, when a resource is created by a POST, should we…

David
- 1,842
- 2
- 21
- 31
24
votes
7 answers
Principles, Best Practices and Design Patterns for functional programming
Are there any known principles, best-practices and design patterns that one can follow while writing code in a functional programming language?

amit-agrawal
- 1,563
- 2
- 13
- 24
22
votes
4 answers
Are there reasons to avoid bit-field structure members?
I long knew there are bit-fields in C and occasionally I use them for defining densely packed structs:
typedef struct Message_s {
unsigned int flag : 1;
unsigned int channel : 4;
unsigned int signal : 11;
} Message;
When I read open…

wirrbel
- 3,173
- 3
- 26
- 49
21
votes
1 answer
How does Boehm GC work for C program?
I checked Boehm GC. The GC for C/C++.
I know mark-and-sweep algorithm. What I'm in curious is how it picks up only pointers in whole C memory. My understanding about C memory is just a plain byte array. Is it possible to determine a value in memory…

eonil
- 83,476
- 81
- 317
- 516
19
votes
6 answers
Are there any Clojure Principles?
Are there any Principles for Clojure ?
a. Like the S.O.L.I.D. Object-Oriented Design Principles for OO languages like Java ?
b. or others more heuristic, like "Tell don't ask", "Favor Composition vs Inheritance", "Talk to Interfaces" ?
Are there…

Belun
- 4,151
- 7
- 34
- 51
15
votes
12 answers
Design Principles
What principles do you generally follow when doing class design?

therealhoff
- 2,375
- 3
- 16
- 20
11
votes
2 answers
RESTful: When is it OK to POST without creating a resource on server?
According to the REST principles, I understand that all POSTs to a server are supposed to be used to create a resource; modify something on the server. If you want to obtain information, you use GET.
But what about cases where you need to send…

noderman
- 1,934
- 1
- 20
- 36
8
votes
3 answers
Abuse of Closures? Violations of various principles? Or ok?
Edit: fixed several syntax and consistency issues to make the code a little more apparent and close to what I actually am doing.
I've got some code that looks like this:
SomeClass someClass;
var finalResult =
DoSomething(() =>
{
var result…

Derick Bailey
- 72,004
- 22
- 206
- 219
8
votes
1 answer
SRP & "axis of change"?
I'm reading Bob Martin's principles of OOD, specifically the SRP text, and I understand the spirit of what it's saying pretty well, but I don't quite understand a particular phrasing, from page 2 of the link (page 150 of the book):
I paraphrase:
It…

lance
- 16,092
- 19
- 77
- 136