35
votes
Are the Stack and Heap hardware, OS, or language-specific concepts?
All of the above. It's complicated.
Some CPU architectures, especially x86, include a dedicated stack pointer register and instructions that allow you to easily push/pop values on that stack.
The ...
18
votes
How do you code something when you have no idea how it actually works?
If this is your first programming project, even a simple text editor may be too complicated. Something like vim or an OS is completely out of the question.
Approaching the Problem
In general, the ...
16
votes
Accepted
What is the name for the integer part of a enum?
C# enums are a set of named [integral numeric] constants.
Each constant in the enum has a numeric value. So the word you are looking for, for the "the index integer of a enum", is just "value".
15
votes
How do you code something when you have no idea how it actually works?
You don’t.
If you don’t even have a vague idea how to do something, it is a sign that it is beyond your current skills. Because if you have no idea how to even start, you’re certainly not going to ...
13
votes
Accepted
Why does the C++ standard still allow uninitialized primitive variables?
The guiding principle there is still "You don't pay for what you don't use". It has not been changed to "Let's try to play it safe, and hope the compiler fixes our performance".
...
9
votes
why languages need an import/include/using etc to refer to other code in other files?
There are many times my IDE has automatically figured out what import my code needs and autogenerated it for me. It’s tempting to think the compiler could also do it. And it could.
But now to ...
8
votes
why languages need an import/include/using etc to refer to other code in other files?
There's a difference between what you could do, and what you want to do.
Let's say my program uses three files, X, A and B. X uses a function made available in A, but spells it wrong and by ...
7
votes
Is there a cancel after certain amount of time try catch type of block?
There is no popular programming language that would have a built-in timeout system via some keywords like try and catch. (well, there may exist such languages, but not in main stream).
However, it is ...
6
votes
Accepted
Are there any languages that let you specify that a function can only be called from a single call site?
Not that I am aware of, but many languages allow something like this:
void SomeFunction() {
void InnerFunction(int a, int b, int c) {
// do stuff!
}
// blah blah
InnerFunction(1,2,3);
}
...
6
votes
Accepted
Is it possible to create a regular language from an non regular language?
Finite Languages are trivially enumerable just by listing their members, and thus weaker than even the regular languages. Therefore the entire hierarchy of formal languages deals only with infinite ...
4
votes
What is the name for the integer part of a enum?
You're just talking about the integral value here. I'd avoid using the word "index" as it doesn't necessarily follow that it will be an index in the way you describe. You can set any values for ...
4
votes
why languages need an import/include/using etc to refer to other code in other files?
Some languages like Java and C# work as you describe. In C# you can use code from other files in the same project without importing anything explicitly. Namespaces are optional and if you don't use ...
3
votes
Is there a cancel after certain amount of time try catch type of block?
I'm not personally aware of any language feature, but this is relatively common in asynchronous libraries. See bluebirdjs promise timeout or monix task timeout, for example. Language designers try to ...
3
votes
What is the name of the type of program to produce Unicode characters from ASCII combinations?
The general operation to transform some characters by others is a substitution. The more specific operation to transform an input message in an output of codes (such as Unicode) is called encoding. ...
3
votes
Accepted
What is the name of the type of program to produce Unicode characters from ASCII combinations?
I believe a keystroke composer or a keystroke translator would probably be appropriate terms for any utility which converts multiple keystrokes into individual glyphs not represented directly on the ...
2
votes
Accepted
Android application to RTL (Arabic)
What i have done in my app:
fix layout. If you use the newest android studio the function "Analyse/Inspect-Code" provides warning if you for example use layout_alignParentRight (rtl independant) ...
2
votes
What is the name of the type of program to produce Unicode characters from ASCII combinations?
Most likely this would be the keyboard driver. Your operating system will try to find out what physical keyboard you have (that is what keys in what place). The user can usually choose the keyboard ...
2
votes
How do you code something when you have no idea how it actually works?
You need to decide how you want your text editor to work.
This is one of the most aggravating and rewarding experiences of developing your own projects from start to finish. No one is sending you ...
2
votes
Why does the C++ standard still allow uninitialized primitive variables?
[...] so that objects of primitive type (int, unsigned, float, double, bool, char) get default-initialized to 0? Wouldn't this prevent an entire class of typical beginner mistakes?
I don’t think so. ...
2
votes
How Should Lexers Be Stateful?
It depends on the kind of languages and it depends on whether you see statefulness on the input or the output side of the lexer.
On the input side, lexers are often stateful: If you parse a string ...
1
vote
why languages need an import/include/using etc to refer to other code in other files?
In the case of C++, it's because they are following the compilation model of C, for backwards compatibility.
When C was developed, computers didn't gave gigabytes of RAM. It was measured in kilobytes ...
1
vote
How Should Lexers Be Stateful?
They should not be stateful.
No mutations rightfully belong in a lexer.
All you're doing is transforming one stream (usually characters) into another (usually strings). That sort of thing is best ...
1
vote
Is there a cancel after certain amount of time try catch type of block?
The example you made requires implicit multithreading that is a little bit too transparent to the developer. Even though modern processors could have many cores multithreading is still something ...
1
vote
Are there any languages that let you specify that a function can only be called from a single call site?
Many OO languages support private methods/functions, that are located within a class, and can only be called from within that class.
You can simply make a small class that conatins only your private ...
1
vote
How do you code something when you have no idea how it actually works?
Writing a full-featured text editor from scratch with no programming experience is foolish: You'll be discouraged and abandon it before learning much.
Several alternatives come to mind:
Study the ...
1
vote
What's a recommended way to design a db schema for multi-language website?
Create each "table" as a base table (with the non-translatable elements) and a translation table. The language table will contain the primary key of the base table and the language ID. You can then ...
1
vote
Regular Expressions and Language Generators
There are actually three classes of automata that (mostly) get lumped together, much in the way you described: Generators, Recognizers and Transducers. They can all be accounted for in a very general ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
languages × 93design × 9
java × 8
programming-languages × 6
compiler × 6
c# × 5
c++ × 5
python × 4
c × 4
terminology × 4
learning × 4
javascript × 3
api × 3
language-design × 3
history × 3
parsing × 3
visual-studio × 3
variables × 3
internationalization × 3
regular-expressions × 3
binding × 3
programming-practices × 2
windows × 2
frameworks × 2
objective-c × 2