Most Popular
1500 questions
53
votes
6 answers
Is a memoized pure function itself considered pure?
Let’s say fn(x) is a pure function that does something expensive, like returning a list of the prime factors of x.
And let’s say we make a memoized version of the same function called memoizedFn(x). It always returns the same result for a given…
callum
- 10,467
53
votes
8 answers
Is domain driven design an anti-SQL pattern?
I am diving in the domain driven design (DDD) and while I go more deeply in it there are some things that I don't get. As I understand it, a main point is to split the Domain Logic (Business Logic) from the Infrastructure (DB, File System,…
Leonardo Mangano
- 684
53
votes
9 answers
Should you guard against unexpected values from external APIs?
Lets say you are coding a function that takes input from an external API MyAPI.
That external API MyAPI has a contract that states it will return a string or a number.
Is it recommended to guard against things like null, undefined, boolean, etc.…
Adam Thompson
- 1,253
53
votes
1 answer
What is the use of DTO instead of Entity?
I am working on RCP application, I'm new to this application.
Spring beans are used to write business logic to save/fetch entities.
But, instead of sending entities directly to client we are converting to DTOs and populating client. While saving, we…
Naveen Kocherla
- 653
53
votes
5 answers
Microservices without data duplication
I’m finding it hard to avoid data duplication or a shared database for even the simplest microservices design, which makes me think I’m missing something. Here’s a basic example of the problem I’m facing. Assuming someone is using a web application…
Geraint Anderson
- 641
53
votes
15 answers
Clean Code: Functions with few parameters
I read the first chapters of Clean Code by Robert C. Martin, and it seems to me it's pretty good, but I have a doubt, in one part it is mentioned that it is good (cognitively) that the functions should have as few parameters as possible, it even…
OiciTrap
- 729
53
votes
7 answers
How can I prevent header hell?
We are starting a new project, from scratch. About eight developers, a dozen or so subsystems, each with four or five source files.
What can we do to prevent “header hell”, AKA “spaghetti headers”?
One header per source file?
Plus one per…
Mawg
- 4,298
53
votes
3 answers
Where does refactoring belong in GitFlow branch naming model?
I recently started working with GitFlow model as implemented by bitbucket. And there is one thing that is not completely clear to me.
We try to regularly address our technical debt by backlogging, planning, and implementing the refactoring tasks.…
AMA
- 632
- 1
- 5
- 8
53
votes
4 answers
What is the difference between a hash and a dictionary?
What is the difference between Hash and Dictionary?
Coming from a scripting background, I feel that they are similar, but I wanted to find out the exact differences. Googling did not help me much.
Sairam
- 641
53
votes
7 answers
Referencing database values in business logic
I guess this is another question about hard coding and best practices. Say I have a list of values, lets say fruit, stored in the database (it needs to be in the database as the table is used for other purposes such as SSRS reports), with an ID:
1…
Kate
- 633
53
votes
8 answers
Is it good that testers are competing to see who opens more bugs?
I'm a software developer. There is a team of testers who follow and run test cases written by the analyst, but also perform exploratory testing. It seems like the testers have been competing to see who opens more bugs, and I've noticed that the…
53
votes
5 answers
IOC Containers break OOP Principles
What is the purpose of IOC Containers? The combined reasons for it can be simplified to the following:
When using OOP/SOLID Development principles, Dependency Injection gets messy. Either you have the top-level entry points managing dependencies…
Suamere
- 1,118
53
votes
3 answers
C++ strongly typed typedef
I've been trying to think of a way of declaring strongly typed typedefs, to catch a certain class of bugs in the compilation stage. It's often the case that I'll typedef an int into several types of ids, or a vector to position or velocity:
typedef…
Kian
- 633
53
votes
3 answers
Should I create separate work and personal GitHub accounts?
I'm fairly new to programming, and I've been working on many personal projects, which I'm concerned can come across as silly and unprofessional. The kind of projects I have are a Reddit Image Downloader and a tool for GMs to use in roleplaying…
Almost Surely
- 647
53
votes
6 answers
How do languages with Maybe types instead of nulls handle edge conditions?
Eric Lippert made a very interesting point in his discussion of why C# uses a null rather than a Maybe type:
Consistency of the type system is important; can we always know that a non-nullable reference is never under any circumstances observed…
Mason Wheeler
- 83,213