Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 7422

Questions about problem solving and planning for a solution through software design.

188 votes
Accepted

Should I follow the normal path or fail early?

"Crash early" is not about which line of code comes earlier textually. It tells you to detect errors in the earliest possible step of processing, so that you don't inadvertently make decisions and com …
Kilian Foth's user avatar
4 votes

Rationale behind own layer in front of the standard API

One of the main reasons for doing this is indeed to hide complexity or protect your system model from corruption. But there is another advantage that becomes more important over time: maintainability. …
Kilian Foth's user avatar
1 vote

Method overriding as a substitution for instanceof in Java?

instanceof is bad because it forces the user of a set of classes to be aware of all the different subclasses that you invent. As it is, whenever a new subclass is written, classes that have only a l …
Kilian Foth's user avatar
3 votes

How to infer the type of a CSV file from contents or headers?

You don't need sophisticated machine learning to do this. ML is essentially just systematic similarity computation, and computing the similarity between sets of strings (the headers of a file) is simp …
Kilian Foth's user avatar
112 votes

Two structs with the same members but different naming, is it a good idea?

Yes, it makes a lot of sense. The value of a struct is not just that it encapsulates data under a handy name. The value is that it codifies your intentions so that the compiler can help you verify t …
Kilian Foth's user avatar
2 votes

Can recursion be done in parallel? Would that make sense?

Of course it's possible, but for such a small example (and, indeed, for many that are much larger) the amount of plumbing/concurrency control code you'd have to write would obscure the business code t …
Kilian Foth's user avatar
1 vote
Accepted

Java Modal Object Design

Sure, if a data sink in your application's world really is unique, i.e. all messages of some kind originating anywhere in your system should end up there, then there's nothing wrong with having a dedi …
Kilian Foth's user avatar
6 votes
Accepted

Is this caution in Android API documentation an indication of suboptimal design?

From the fragment you show there is no good reason - if both URI type and MIME type can be present simultaneously, it seems strange to null either when setting the other. There might be hidden reasons …
Kilian Foth's user avatar
2 votes

Should program arguments have mixed interpretations?

You've seen programs that interpret option arguments both as a filename and as literals? Depending on what, the state of the file system? That's an insidious defect or exploit waiting to happen. Never …
Kilian Foth's user avatar
1 vote

Instantiating a set of Objects from information in File

The question how "clean" it is to have a generic builder/deserializer/factory that can create objects of different classes from textual descriptions depends on how easy this is to do in the language. …
Kilian Foth's user avatar
3 votes

Validation of parameters in a chain of services

The decisive question you must ask yourself: Where will the parameters actually come from in practice? If you know that all these methods are ultimately just for clearer understanding for the maintai …
Kilian Foth's user avatar
6 votes

Why do we need to embed an interpreter in a program?

Because with a fully compiled tool, what it can do is limited to what the distributor thinks is useful. Sure, in theory everyone can write their own extensions in C, recompile and happily use them. …
Kilian Foth's user avatar
11 votes

Is there a design reason why Git commits only store pointers to their parents, not children?

Git is a distributed version control system. It's always possible to know that the parent commit of your commit was, since you need it to create the commit, but it's fundamentally impossible to enumer …
Kilian Foth's user avatar
12 votes
Accepted

Why is recompilation of dependent code considered bad design?

Recompiling dependent code is expensive: compiling takes time, particularly in a language as syntactically complex as C++. Historically, for most C++ compilers it was extremely expensive. But more imp …
Kilian Foth's user avatar
4 votes

Multiple boolean arguments - why is it bad?

In my view, if a method does a large, complex thing such as train an entire ML model, then tweaking various little aspects of that thing isn't violating the SRP. People usually argue against boolean …
Kilian Foth's user avatar

1
2 3 4 5 6
15 30 50 per page