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
7
votes
9 answers

What's the rationale behind headers?

I don't quite understand the point of having a header; it seems to violate the DRY principle! All the information in a header is (can be) contained in the implementation.
RCIX
  • 38,647
  • 50
  • 150
  • 207
5
votes
3 answers

How to properly create features, tests, stories and break them down

I am trying to grasp the entire TDD methodology and as such, I don’t really know how to present this as a nice concise question so here is the long drawn out version. I seem to be experiencing a gap between the bowling (Martin), money (Feathers),…
5
votes
2 answers

Organizing classes into namespaces

Are there some principles of organizing classes into namespaces? For example is it OK if classes from namespace N depends on classes from N.X? And if classes from N.X depends on classes from N?
xoposhiy
  • 217
  • 3
  • 6
5
votes
4 answers

Never produce to an unknown pathway, in software too? [Toyota principle]

In Toyota manufacturing lines they always know what path a part have traveled. Just so they can be sure they can fix it of something goes wrong. Is this applicable in software too? All error messages should tell me exactly what path they traveled.…
Flinkman
  • 17,732
  • 8
  • 32
  • 53
4
votes
5 answers

How do you name a class/method that only calls other methods?

Say I follow the Single Responsibility Principle and I have the following classes. public class Extractor { public Container extract(List list) { ... some extraction } } public class Converter { public String…
reach44
  • 41
  • 3
4
votes
1 answer

How does Node.js process incoming requests?

In order to dive into more complex concepts about Node.js, I am doing some research to make sure I understand the principles about the language and the basic building blocks it´s build upon. As far as I´m concerned, Node.js relies in the reactor…
Luis Orbaiceta
  • 443
  • 4
  • 15
4
votes
8 answers

OO Software Design Principles

I am a huge fan of software design principles such as SOLID and DRY. What other principles exist for OO software design? Note. I’m not looking for answers like "comment your code" but instead looking for OO design principles like the ones discussed…
Kane
  • 16,471
  • 11
  • 61
  • 86
3
votes
4 answers

Is returning a functions value from a for-loop bad practice in C++?

My colleague just had a look at my code and said, that according to "some standard" returning a functions value out of a for loop is bad practice. The function looks something like this: bool CentralWidget::isBitFieldFree(const QString& define, int…
tobilocker
  • 891
  • 8
  • 27
3
votes
2 answers

What does "dependency inversion principle" mean in OOP?

What is meant by the "dependency inversion principle" in object-oriented programming? What does it do?
bunty
  • 2,665
  • 8
  • 30
  • 27
3
votes
1 answer

Guidelines/principles for package and component design

Alright, our visual studio solution grows big in terms of the number of projects in it. Except for things that are obvious, I want to check whether the way it is now is what it has to be or we can better reorganize/package it. Do you know of any…
tranmq
  • 15,168
  • 3
  • 31
  • 27
2
votes
1 answer

Is Orthogonality inversely proportional with DRY principles?

According to The Pragmatic Programmer book "Orthogonality is closely related to the DRY principle". I'm not sure if I understand it the way the author wants the reader to. So I ask the question above. For example, you have class A and class B. Both…
2
votes
5 answers

Do you prefer compiled or scripted languages?

Since this is wide community using all kind of different technologies, it seems like appropriate place to ask this. Do you like to compile or do you prefer scripting? I ask this because I tend to program things in small scripting languages with…
majkinetor
  • 8,730
  • 9
  • 54
  • 72
2
votes
1 answer

QT infinite view on model

I am looking for a way to create an infinite view on a model that is not initialized completely. I would like to create something similar to an Excel spreadsheet, and all I came in was to start with an initialized model (e.g. 100x100 empty cells,…
Lidbey
  • 251
  • 1
  • 12
2
votes
1 answer

SOLID - Violated Open-Closed principle

I have the following code snippet class Vehicle{ public String brand; public double price; public int productionYear; public String toString(String formatType) { switch(formatType) { case "JSON": // JSON formatting here return…
Vlad Danila
  • 1,222
  • 3
  • 18
  • 38
2
votes
3 answers

Objectively Good OO Design Principles

Premise I believe that there is a way to objectively define "Good" and "Bad" Object-Oriented design techniques and that, as a community we can determine what these are. This is an academic exercise. If done with seriousness and resolve, I believe…
chadmyers
  • 3,800
  • 21
  • 29