All Questions
175 questions
0
votes
3
answers
434
views
Would you test this piece of configuration code? How do I determine which code is worth testing?
We have a piece of code that decorates an interface to transparently add retry logic.
Inversion of Control configuration
service.AddOurRestApiClient()
.AddResilienceHandler("Retry", ...
3
votes
5
answers
993
views
How are strings simultaneously objects and primitive data types in C#?
In C#, strings can be used like objects with methods, properties, and other features of objects. At the same time, strings are treated the same as primitive data types like int or float in numerous ...
0
votes
2
answers
417
views
How to restrict the construction of a domain object to an external service?
I have this object
RelativeFoo{int relativeCode, Origin relativeTo}
And I want to map it to this other object
AbsoluteFoo{int absoluteCode}
In order to do this, I need to use a service whose ...
1
vote
2
answers
385
views
Are experienced developers and software architects able to describe an entire software application in terms of design patterns?
Do experienced developers and software architects see entire application in terms of design patterns?
In other words experienced developers and software architects able to describe an entire software ...
-2
votes
1
answer
300
views
Why aren't constructors atomic? [closed]
If thrown exceptions in constructors can lead to memory leaks or partially-constructed objects, then why we don't make them atomic? so neither an object nor it's local variables will get created/...
3
votes
2
answers
987
views
GetOrCreate method for a database operation
I have read this thread: Is it bad coding practice to create something in a get if it does not exist?
But, my question involve a method which gets a record from a database or creates it if it doesn't ...
4
votes
7
answers
2k
views
When to use a class with a constructor vs using a method returning an object
I've been working in a rather large codebase filled to the brim with small classes such as
class Person
{
public string name;
public int age;
public int height;
}
As a mainly front-end ...
-4
votes
1
answer
69
views
Calculate math function depend on N value [closed]
I have method with the following prototype :
R[] = method(k,n)
which :
n = ordinal value 0 <n <10^9
k = math function depend on n value : i.e n^6
R = array of computed values
For example :
n = ...
0
votes
2
answers
1k
views
Where should I put the initialization validation of a Value Object?
Hi I am making a Value Object.
public class Age
{
public Age(int age)
{
Value = age
}
public int Value { get; private set; }
}
I want to check ...
0
votes
3
answers
362
views
Solutions for polyadic functions/methods
In the book Clean Code, Robert C. Martin says that we should avoid polyadic functions (functions that contain four or more arguments).
One of the solutions presented by him is the use of objects as ...
1
vote
1
answer
147
views
How significant is the speed of native code for back end tasks?
Going native is extremely good for front end development. Whether its using android vs ionics, c++ vs dotnet/java, the benefits to GUI are significant.
I was wondering if the same had significant ...
83
votes
12
answers
31k
views
What is the utility and advantage of getters & setters especially when they are merely used to read and assign values to properties of an object? [closed]
I’m still really new to learning to program. Just learning the syntax for a few programming languages at the moment.
The courses I viewed for C# and Java touched only very briefly on getters & ...
1
vote
1
answer
210
views
How do Java's proposed Inline Classes compared to Value Types in C#
There is talk once again about Inline Classes being added to Java.
As someone who understands C#, what is the best ways to think about them?
As a C# program what am I likely to misunderstand about ...
-4
votes
1
answer
2k
views
Use Case Diagram for Vending machine
I want to create a use case diagram for a vending machine which has the following states:
Accepts coins of 1,5,10,25 Cents
Allow user to select products Coke(25), Pepsi(35), Soda(45)
Allow user to ...
-3
votes
2
answers
2k
views
What is the benefit of Java collection streams over C# or Scala collections?
Java collection streams were introduced in Java 8, which came out in March of 2014.
By that time, we already had well-established mechanisms for manipulating collections in several other languages, ...