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.
2
votes
1answer
184 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 ...
2
votes
4answers
1k 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
23 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
229 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 ...
2
votes
1answer
94 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, ...
53
votes
8answers
8k 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?
3
votes
2answers
143 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
117 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 ...
3
votes
1answer
64 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
102 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....
56
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 ...
4
votes
4answers
212 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
182 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
111 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
1k 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
217 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
303 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 ...
7
votes
6answers
804 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
122 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/...
1
vote
1answer
199 views
Hypothetical : What restrictions will I need to add to Java so that I can remove its GC? [closed]
This is a hypothetical, yet very technically precise question I'm trying to ask all the compiler/static analysis programmers.
I'm trying to understand the extent of prohibitive features I would need ...
3
votes
3answers
1k 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 ...
0
votes
1answer
149 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
163 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 ...
1
vote
1answer
107 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
375 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
223 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
153 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 ...
62
votes
4answers
8k 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 ...
1
vote
2answers
1k 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 ...
5
votes
2answers
286 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
134 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
375 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
11k 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
126 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
60 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 ...
10
votes
9answers
1k views
Theoretically bug-free programs
I have read lot of articles which state that code can't be bug-free, and they are talking about these theorems:
Halting problem
Gödel's incompleteness theorem
Rice's theorem
Actually Rice's theorem ...
6
votes
4answers
6k views
Left and Right most Derivation
So i understand the semantics of derivations as far as Backus Naur Form goes. One thing I cannot find in any text book or the various lecturers' notes that are on-line is this.
When would a right ...
3
votes
1answer
1k views
Epsilon Transitions in an NFA
I'm attempting to teach myself the basics of finite automata and have been exploring the differences between Deterministic Finite Automata and Non Deterministic Finite Automita.
One thing that pops ...
6
votes
5answers
1k views
What negative consequences can arise from this language design rule?
Clarification: the rule is meant to prevent accessing variables that are not declared yet.
Clarification 2: the rule mandates that the compiler follows calls to functions which are defined in the ...
0
votes
2answers
105 views
Could one sample be enough for a perceptron training?
I need to compare a picture and decide whether or not it is similar to another one. In this case, I would like to use a simple perceptron that compares pixelmaps of both pictures. But I have only very ...
18
votes
6answers
2k views
What is an example of a computationally impossible business problem?
I have coworker who refuses to accept the reality that Turing machines (and Von Neuman machines by extension) cannot solve their own halting problem stating:
You can do anything with enough time ...
124
votes
11answers
31k views
How has an increase in the complexity of systems affected successive generations of programmers?
As a "new" programmer (I first wrote a line of code in 2009), I've noticed it's relatively easy to create a program that exhibits quite complex elements today with things like .NET framework for ...
1
vote
1answer
545 views
Minimax in a bayesian game with multiple players who do not play in order
Premise: I know that such a game would be better solved by MCTS, however, from a theoretical point of view, would it be possible to apply minimax to a bayesian multiplayer game where the order of ...
33
votes
9answers
7k views
Why not expose a primary key
In my education I have been told that it is a flawed idea to expose actual primary keys (not only DB keys, but all primary accessors) to the user.
I always thought it to be a security problem (...
1
vote
1answer
283 views
category theory based language
It may sound naive, but is there any programming language, or research thereof, based entirely on category theory?
I mean this as opposed to embedding CT concepts as an additional feature (like for ...
5
votes
4answers
754 views
Are there any formalized/mathematical theories of software testing?
Googling "software testing theory" only seems to give theories in the soft sense of the word; I have not been able to find anything that would classify as a theory in the mathematical, information ...
1
vote
1answer
573 views
Operating systems theory — using minimum number of semaphores
This situation is prone to deadlock of processes in an operating system and I'd like to solve it with the minimum of semaphores. Basically there are three cooperating processes that all read data ...