Questions tagged [theory]

Theoretical question deal with topics that do not generally have immediate practical uses. Please be careful when using this tag: your question may be more appropriate for the Computer Science Stack Exchange site.

Filter by
Sorted by
Tagged with
0 votes
2 answers
154 views

Is a 'base' file always necessary when doing a merge?

Are there any algorithms that can do or suggest merges without requiring the "base" file, the most recent common ancestor of the two file versions that we want to merge? Is a manual merge ...
yoyo_fun's user avatar
  • 2,297
-3 votes
3 answers
151 views

NP-complete problem (subset sum) featured in Netflix series "Suits" S1 E8? [closed]

In the Netflix series Suits, Season 1, Episode 8 (Identity Crisis), the legal team, with the help of a hacker, is tasked with proving that a business magnate embezzled funds, splitting them and ...
Cade Bryant's user avatar
10 votes
9 answers
3k views

What is an immutable object anyway?

The most popular answer is - it is an object whose state does not change after creation. What does it actually mean? My understanding is that any method call on the object should give the same result. ...
kan's user avatar
  • 402
29 votes
7 answers
16k views

How can lossless compression ever exist?

If all data is essentially just a bit string, then all data can be represented as a number. Because a compression algorithm, c(x), must reduce or keep the same length of the input, then the compressed ...
Mercury's user avatar
  • 465
0 votes
1 answer
178 views

How far can one debug a low-level API in closed-source environments?

Assume a low-level API is provided without source code (e.g. DirectX). The API provides a virtualization of hardware resources (GPU, CPU, audio card, etc.), which enables the user to call hardware-...
chckx592's user avatar
2 votes
0 answers
144 views

Cohesion and coupling possible combination in software

I know what we mean by cohesion and coupling in software. And generally the best practice is to achieve high cohesion with low coupling. It seems to me though that they are inter-related. I.e. you ...
Jim's user avatar
  • 317
1 vote
2 answers
644 views

What's the difference between a pure function that expects a complex object of a particular type and object oriented programming?

What's the difference between writing OO code that depends on internal state and writing a pure function that expects an argument that is a data structure of a specific type (and thus has internal ...
Andrew's user avatar
  • 119
-2 votes
1 answer
253 views

Why is the If-then-else, while loop and for loop a structured programming control structure?

When defining McCabe's essential complexity, the idea of a structured programming control structure is present. I don't understand why an if-then-else, a while loop or a for loop can be reduced to a ...
Cedric Martens's user avatar
2 votes
2 answers
131 views

How to reflect "functional quality" when implementing ISO 250XX, which is quality model of non-functional requirements?

We want to adopt ISO 25000 quality model, which explicitly states it does not deal with functional requirements (i.e. its Functional suitability is truly about assessing how the functions fit in the ...
John V's user avatar
  • 4,918
1 vote
1 answer
153 views

How does the classic proof for the halting problem work?

I've looked up a lot proofs for the halting problem (that are basic enough that I can understand what they are trying say ^^) but for all of them I don't get their last step right before they pull the ...
wischi's user avatar
  • 129
1 vote
7 answers
244 views

Academic question about table design

I just had an argument with my professor about surrogate key usage in my project's database design. My professor insisted that a primary key (natural or surrogate) should not ever be exposed, even in ...
Shira Ishikawa's user avatar
3 votes
5 answers
442 views

Always better to wait?

I've been wondering if this concept has a name and a consolidated theory behind. If you need to build software, but you don't need it right now, it's always better to wait because the technology ...
Legisey's user avatar
  • 155
0 votes
1 answer
153 views

What could cause a bug to be "Person-Dependent"?

This is quite theoretical, and I hope it's the right SE site. A couple of years ago I worked at a company using Maya 2014 (I think that was the version) with a couple of other 3D Artists. Eventually ...
anon's user avatar
  • 109
6 votes
2 answers
1k views

What is the logic in the order of operator precedence? [closed]

Absolutely academic context question- I found countless articles listing the order of operator precedence in all languages, but what is the logical reasoning behind that specific order? For clarity ...
Benson's user avatar
  • 79
1 vote
1 answer
487 views

Why do programming languages have both double and float? [duplicate]

I know that doubles are more precise than floats and that they should be used for financial stuff and other things that require precision, but why do we use floats? Why not just get rid of floats and ...
Adam Oates's user avatar
0 votes
2 answers
170 views

If "negative" conditions are mentioned in the spec, are such tests still negative?

In most definitions of negative testing, the idea is that we test outside what is specified/expected and it is highly related to robustness. So basically, if the behavior for such conditions is ...
John V's user avatar
  • 4,918
-1 votes
2 answers
229 views

Improving Availability vs Mean Time Between Failures

Let's assume that I have to deal with an unreliable system accessed by many users that goes down/fails, let's say, X times for X minutes weekly. If only one of the following can be improved due to ...
Claudio's user avatar
2 votes
2 answers
228 views

Testing and Debugging Techniques vs. Rice's Theorem

As far as I got it correctly, as a result of Rice's theorem, the equivalence of two programs is generally not decidable. Nevertheless, there exists a wide variety of testing and debugging techniques, ...
Wanderer's user avatar
  • 131
-2 votes
1 answer
80 views

Proof that computer communication only exists of function calls and events

I am writing a paper about the use of a message broker for inter-process communication where I state that all computer communications can be broken down into two categories: Function calls Events My ...
Vinno97's user avatar
  • 111
54 votes
3 answers
17k views

What's the difference between a subclass and a subtype?

The highest rated answer to this question about the Liskov Substitution Principle takes pains to distinguish between the terms subtype and subclass. It also makes the point that some languages ...
tel's user avatar
  • 569
6 votes
5 answers
423 views

Does only the concept of mathematical functions justify why methods need only to return one value

Most modern programming languages do not allow multiple return types (excluding scenarios like C#'s out parameters or the newest use of Tuples). This is because all languages implement the concept of ...
Lefteris008's user avatar
2 votes
1 answer
574 views

How does this function for calculating modular exponentiation work ?

I know that the rule in maths for modulus is this: ab mod n =(a mod n ) (b mod n) mod n I have found the following code for computing the modular exponentiation: pow(base,exponent,modulus){ if (...
user avatar
0 votes
1 answer
97 views

Are there any theories about computing speed propotional to object amount? [closed]

If I want to calculate the movements of each moving objects driven by regular algorithm, then how can I measure required computing power? Is required computing power proportional to the quantity of ...
differntial's user avatar
11 votes
4 answers
692 views

Should I build a fully featured application or a bare bones one and then slowly add features?

I work in a manufacturing plant that has tasked IT with creating a shop floor scheduling program (that is very badly needed). Based on others experience, would it be better to take less time and build ...
Kyle Vancamp's user avatar
27 votes
4 answers
16k views

Is colon in python blocks technically necesary?

This is really just a theoretical question by a python newbie who wants to understand more. I keep forgetting the colon after the block initial statements in python. Those are what I mean: for <...
Tomáš Zato's user avatar
25 votes
7 answers
6k views

Ninety-ninety rule in practice

The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time. — ...
Josip Ivic's user avatar
  • 1,627
3 votes
1 answer
51 views

Trying to get a better understanding of the definition of measurement

The book Software Metrics A Rigorous and Practical Approach defines measurement as ...the process by which numbers or symbols are assigned to attributes of entities in the real world in such a ...
Gary In's user avatar
  • 133
4 votes
3 answers
299 views

Non-Recursive data types = No need for garbage collection?

If all data types are made non-recursive using tricks like a table of node IDs linking to data and data uses only other node IDs to form a graph, then can all memory be managed using just Reference ...
clinux's user avatar
  • 287
-2 votes
1 answer
190 views

If the set of MIPS instructions were changed to accommodate 128 records theory question

If the set of MIPS instructions were changed to accommodate 128 records and 4 times more instructions type-I, which would be the largest hexadecimal immediate value that could be supported, keeping ...
Blind Roach's user avatar
68 votes
9 answers
23k views

What is the meaning of the 90/10 rule of program optimization?

According to Wikipedia, the 90 / 10 rule of program optimization states that “90% of a program execution time is spent in executing 10% of the code” (see the second paragraph here). I really don't ...
Rakshith Ravi's user avatar
5 votes
3 answers
9k views

Why do we need stacks and queues?

I don't see the reason to have classes for stacks, queues and deques if we have the data structure linked list, since a linked list can act as both a stack and a queue (and always has the functions of ...
NightSkyCode's user avatar
7 votes
5 answers
15k views

Why does recursion return the first call in the stack and not the last?

I cant for the life of me figure out why this returns 0 rather than 5. i keeps getting incremented before it hits the last return statement, however it always returns 0, from the first call in the ...
NightSkyCode's user avatar
2 votes
1 answer
1k views

Relation and difference between recursively enumerable languages and Turing complete languages?

From https://en.wikipedia.org/wiki/Recursively_enumerable_language a formal language is called recursively enumerable (also recognizable, partially decidable, semidecidable, Turing-acceptable or ...
Tim's user avatar
  • 5,425
4 votes
4 answers
704 views

Is Program Running Time Affected by File Size?

Say I wrote a program containing 3 methods. Each method was 100 lines. Method 1 was main(), and Method 2 was called by main(). I then duplicated the program into an identical second program. After ...
Logan Hartman's user avatar
3 votes
1 answer
521 views

Between Applicative Functor and Monad

Is it possible to design an Applicative Functor with a few extra stack manipulation functions push, pop, and a specialized branching function ifA :: forall a. f Boolean -> f a -> f a -> f a, ...
clinux's user avatar
  • 287
58 votes
8 answers
9k views

Are events only used for GUI programming?

Are events only used for GUI programming? How do you handle in normal backend programming when something happens to this other thing?
user3093620's user avatar
4 votes
2 answers
291 views

Referential Transparency by using Zero References?

Referential Transparency is one of the corner stones of functional programming that allows us to apply equative reasoning to our code. However it does so at a cost to performance, by use of immutable ...
clinux's user avatar
  • 287
3 votes
3 answers
175 views

Why SW quality is said to be contextual..isn't it true for quality of anything?

Reading the book The Economics of Software Quality, it reads that: To further complicate the definition, quality often depends on the context in which a software component or feature operates. The ...
Pietross's user avatar
  • 331
8 votes
1 answer
2k views

Exclusive upper bound in random number range

Why do languages' random number generators tend to return a value exclusive of the upper bound of the range? For example, an implicit range - JavaScript's random() method "Return a random number ...
John K's user avatar
  • 1,406
2 votes
1 answer
490 views

"Selected design can be derived from requirements" - meaning and difference against traceability?

ISO 12207 contains interesting points for design verification: a) The design is correct and consistent with and traceable to requirements. c) Selected design can be derived from requirements....
Pietross's user avatar
  • 331
58 votes
8 answers
7k views

How can we be certain that the lower components of computer programming like compilers, assemblers, machine instructions, etc. are flawless?

Since we are becoming more and more reliant on computing, including very critical tasks of day-to-day life, I was just wondering how those vital components are tested. More technically, how are the ...
Sudip Bhandari's user avatar
7 votes
4 answers
1k views

Are a class's methods a type of closure?

Per MDN A closure is a special kind of object that combines two things: a function, and the environment in which that function was created. The environment consists of any local variables that were ...
tt9's user avatar
  • 611
2 votes
2 answers
358 views

Has any language ever supported a conditional assignment target? [closed]

I've never seen a programming language with conditional assignment targets, eg.: // If (x == y), then var1 will be set to 1, else var2 will be set to 1 ((x == y) ? var1 : var2) = 1 The target of the ...
Brendan Hill's user avatar
1 vote
2 answers
168 views

How to mitigate complexity of fallbacks introduced to automatically retry upon failure?

So this may come off a bit broad and generalized, but after spending some time working around under developers, I've come to notice many different methods and design patterns. However, one big thing ...
JD Davis's user avatar
  • 1,367
11 votes
2 answers
2k views

Functional programming, compared to the process of a computer [duplicate]

In functional programming, it is considered bad practice (at least from my observations) to use state changes. Since computers operate in an imperative-language-like matter (performing one operation ...
sneelhorses's user avatar
23 votes
4 answers
5k views

Is a memory of all possible permutations of a kilobyte block and pointers possible?

This is a hard enough idea to wrap my head around and I would greatly appreciate any edits/help to get it more readable for those in-the-know. Is it theoretically possible to have a hard drive that ...
Amagii Discordus Penndragon's user avatar
1 vote
4 answers
342 views

A secondary "type system" for references?

I'm designing a language and was wondering how to incorporate C++-like references with regards to their place in the type system. I think they're useful for operations like indexing and dereferencing (...
jcora's user avatar
  • 1,461
4 votes
3 answers
4k views

Banning zero-argument functions -- what problems could it cause in a hypothetical language?

I'm creating a programming language as a hobby, but I encountered a problem with designing its syntax. The problem is the conflict between the syntax for defining zero-argument functions and the ...
jcora's user avatar
  • 1,461
0 votes
1 answer
1k views

CGI Scripts and Python / Ruby [closed]

I am new to web programming. Now unfortunately, I was a kid during the advent of the world wide web and didn't have access either. So now when I am just starting out, it feels like there's a myriad of ...
Silver's user avatar
  • 103
8 votes
6 answers
2k views

performance versus reusability

How can I write functions that are reusable without sacrificing performance? I am repeatedly coming up against the situation where I want to write a function in a way that makes it reusable (e.g. it ...
Caltor's user avatar
  • 189