Questions tagged [principles]

Use for questions related to programming principles; Principles describe laws or rules that according to their proponents are nearly universal truths in software engineering.

64 questions
188
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?
153
votes
3 answers

What is the EAFP principle in Python?

What is meant by "using the EAFP principle" in Python? Could you provide any examples?
Unpaid Oracles
  • 1,747
  • 2
  • 12
  • 8
123
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 Pollard
  • 66,757
  • 77
  • 237
  • 416
94
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
  • 951
  • 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
  • 6,783
  • 9
  • 50
  • 74
35
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,503
  • 1
  • 10
  • 25
33
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,303
  • 2
  • 26
  • 42
26
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,712
  • 2
  • 20
  • 30
23
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,543
  • 1
  • 13
  • 24
20
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
  • 2,859
  • 2
  • 19
  • 43
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
  • 3,931
  • 6
  • 31
  • 48
17
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
  • 75,400
  • 74
  • 294
  • 482
15
votes
12 answers

Design Principles

What principles do you generally follow when doing class design?
therealhoff
  • 2,345
  • 3
  • 15
  • 20
9
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,824
  • 17
  • 32
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
  • 69,055
  • 21
  • 193
  • 207
1
2 3 4 5