Skip to main content
14 votes

Proving program correctness under all possible cases

Ensuring correctness of a computation mathematically is quite possible, just enormously expensive. Basically, you have to set down the requirements in a formal semantic system that is as rigid as a ...
Kilian Foth's user avatar
6 votes

Proving program correctness under all possible cases

First you have to know what a "bug" is. In some projects this might be rigorously defined, in other projects it might be "I do not like the color". And opinions will differ about ...
JonasH's user avatar
  • 6,397
5 votes
Accepted

Single code fragment to perform two different operations

What you are describing sounds like you want something similar to the relationship between a DateTime and a TimeSpan. Perhaps you could describe it as a Note and a NoteShift. I think that calling it ...
Berin Loritsch's user avatar
4 votes

Proving program correctness under all possible cases

It seems noone here answered your literal question: Is it possible to know all possible defects in a program before I write a single line of code For this question, the answer is trivial: it is ...
Doc Brown's user avatar
  • 221k
3 votes

Alternative To Generic Methods where Type is known at runtime

Curry generics Since you don't want to use reflection to call generic methods, I'll give you an alternative: Curry the generic parameter. I hope that makes sense. To handle operations that depend on ...
Theraot's user avatar
  • 9,261
2 votes

General Excel Processor and Validator

Most extract-transform-load operations cannot be made generic. Generalizing something means finding an abstraction that works in all use cases, and as you've found, when the business rules are ...
Greg Burghardt's user avatar
2 votes

I've a doubt regarding Environment Model of execution

Yes, the concept of an “environment” is a language independent concept. The term is used frequently in programming language theory, though “bindings” is more generic: names are “bound to” something, ...
amon's user avatar
  • 136k
2 votes

How should I provide generic typing and allocation for a collection library in C?

How should I provide generic typing and allocation for a collection library ... ? Establish boundaries Without scope limits, this task will evolve into a re-creation of C++. Assuming that is not the ...
chux's user avatar
  • 638
1 vote

Single code fragment to perform two different operations

The most elegant way to do this is to represent an OctiveNote as an integer. This is in swift but it should be easy to translate: enum Note: Int { case c, d, e, f, g, a, b } struct OctiveNote { ...
Daniel T.'s user avatar
  • 3,073
1 vote

Alternative To Generic Methods where Type is known at runtime

Classes that implement IEnumerable<T> also implement the non-generic interface IEnumerable, so you can just use that. Change this: private async Task<Ienumerable<?>> ...
John Wu's user avatar
  • 27k
1 vote
Accepted

Templates for generic code and code flexibility

This is part of why most of the standard library deals in iterators rather than dealing directly with containers themselves. Iterators were designed from the beginning to support iteration over the ...
Jerry Coffin's user avatar
  • 44.9k
1 vote

Adjective for function types on wether the values are received or sent

The set of valid inputs to a mathematical function is the domain, and the valid outputs the codomain or range. These should more or less equate to the values contrained by the types of your sent/...
jk.'s user avatar
  • 10.3k

Only top scored, non community-wiki answers of a minimum length are eligible