Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

1
vote
2answers
89 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, ...
-3
votes
1answer
69 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 ...
42
votes
3answers
5k 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 ...
4
votes
5answers
275 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 ...
1
vote
1answer
77 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 (...
0
votes
1answer
91 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 ...
11
votes
4answers
641 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 ...
12
votes
4answers
5k 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 <...
23
votes
7answers
4k 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. — ...
3
votes
1answer
50 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 ...
5
votes
3answers
208 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 ...
-2
votes
1answer
61 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 ...
67
votes
9answers
17k 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 ...
3
votes
3answers
3k 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 ...
3
votes
4answers
3k 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 ...
1
vote
1answer
235 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 ...
4
votes
4answers
262 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 ...
3
votes
1answer
290 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, ...
57
votes
8answers
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?
4
votes
2answers
185 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 ...
3
votes
3answers
152 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 ...
4
votes
1answer
416 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 ...
2
votes
1answer
193 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....
58
votes
8answers
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 ...
5
votes
4answers
273 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 ...
2
votes
2answers
227 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 ...
1
vote
2answers
138 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 ...
11
votes
2answers
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 ...
23
votes
4answers
4k 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 ...
1
vote
4answers
278 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 (...
3
votes
3answers
3k 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 ...
0
votes
1answer
801 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 ...
8
votes
6answers
1k 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 ...
1
vote
2answers
139 views

OOP (possibly Java-specific): Comprehensive Set of Method Categories [closed]

I am working on a coding convention to follow for my Java projects. I find it easier to find my way through a class when I group its methods by category. For example, rather than having each getter/...
6
votes
3answers
4k views

Why is the “period of a (pseudo)random number generator” important?

I've been trying to understand (pseudo)random number generator code from various sources and the concept of the period continues to elude me. To satisfy the minimum level of understanding, I've tried ...
1
vote
1answer
417 views

Is Exploratory testing Context Driven testing?

I do not think so, yet many sources say it is. As I understand it: Context-driven testing means that when planning testing on our project, I choose the methods, practices, etc. in order to fit the ...
1
vote
3answers
213 views

Exposition of Data Representation

I would like to know how the data representation is exposed in slide 7 of information hiding: Modifying an exposed data representation propagates to all code which directly accesses that ...
3
votes
1answer
124 views

Transitions taking place in NFA

While studying about NFA and DFA in Compiler Design I couldn't get how they converted an regular expression to NFA as shown in NFA.I would like to know why there is an epsilon transition between (8 -&...
0
votes
1answer
747 views

Significance of NFA in Compiler Design

While I was studying about Compiler Design it tells that we need 'finite automata' while designing a lexical analyzer like DFA or NFA. So I would like to know whether NFA is only used for conversion ...
0
votes
1answer
396 views

Real-time theory: how is period transformation implemented with delay requests?

To deal with transient overloads with a real-time system scheduled with rate-monotonic scheduling, one can use period transformation to reduce the period of important processes so that they have ...
4
votes
3answers
179 views

How message acknowledge deadlock problem is being solved in real world applications?

To my understanding message acknowledge deadlock problem is this: In order to sync value X between A and B A sends X to B A waits for B to send acknowledgment to A so it makes sure B has latest X B ...
74
votes
4answers
14k views

What is the purpose of a Code Review

I am in the process of trying to sell my organisation on the value of code reviews. I have worked at several places where they were employed. I have seen them used to nitpick styling choices, and ...
2
votes
2answers
3k views

How to measure algorithm accuracy?

I have a few optimization algorithms (for finding function minimum) and I'd like to check how good they are. Suppose I build test cases and compare the actual results to theoretical ones. What ...
6
votes
2answers
489 views

How can I make sense of the word “Functor” from a semantic standpoint? [closed]

When facing new programming jargon words, I first try to reason about them from an semantic and etymological standpoint when possible (that is, when they aren't obscure acronyms). For instance, you ...
4
votes
1answer
228 views

Mapping multiple differing taxonomies to each other

At work we have a varied number of websites selling second-hand products. The bosses have noticed that there's often some overlap between the products sold on some of the websites and would like to ...
3
votes
5answers
737 views

What defines the dimensionality of an array?

I know that when we speak about an array having 1, 2, or 4 dimensions, we mean arrays like this: 1: [0] 2: [0,0] 3: [0,0,0] 4: [0,0,0,0] ... Is the first 'axis' of an array the only thing that ...
30
votes
11answers
21k views

How does the “Fourth Dimension” work with arrays?

Abstract: So, as I understand it (although I have a very limited understanding), there are three dimensions that we (usually) work with physically: The 1st would be represented by a line. The 2nd ...
2
votes
0answers
143 views

Is there a theory for “transactional” sequences of failing and no-fail actions?

My question is about writing transaction-like functions that execute sequences of actions, some of which may fail. It is related to the general C++ principle "destructors can't throw," no-fail ...
0
votes
2answers
66 views

Hashing + security as it pertains to a theoretical file sharing site

These days it's possible to hash a file client-side, send the hash to the server, and have the server check whether or not that file is already uploaded. If it is, we can skip the file upload and make ...
4
votes
3answers
2k views

Japanese Multiplication simulation - is a program actually capable of improving calculation speed?

I'd like to write a simulation of Japanese Multiplication to get benchmarks on large calculations utilizing the shortcut vs traditional CPU multiplication. I'm curious as to whether it makes sense to ...