Skip to main content
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 ...
amon's user avatar
  • 136k
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 ...
doubleYou's user avatar
  • 2,867
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".
David Arno's user avatar
  • 39.6k
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 ...
Telastyn's user avatar
  • 110k
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". ...
Deduplicator's user avatar
  • 9,309
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 ...
candied_orange's user avatar
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 ...
gnasher729's user avatar
  • 49.4k
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 ...
S.D.'s user avatar
  • 1,100
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); } ...
Telastyn's user avatar
  • 110k
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 ...
Kilian Foth's user avatar
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 ...
Belgian Dog's user avatar
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 ...
JacquesB's user avatar
  • 62.3k
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 ...
Karl Bielefeldt's user avatar
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. ...
Christophe's user avatar
  • 82.2k
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 ...
Steve's user avatar
  • 12.6k
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) ...
k3b's user avatar
  • 7,621
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 ...
gnasher729's user avatar
  • 49.4k
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 ...
Syntax Junkie's user avatar
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. ...
besc's user avatar
  • 1,163
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 ...
Christophe's user avatar
  • 82.2k
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 ...
Simon B's user avatar
  • 9,782
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 ...
Telastyn's user avatar
  • 110k
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 ...
FluidCode's user avatar
  • 831
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 ...
Aganju's user avatar
  • 1,473
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 ...
wallyk's user avatar
  • 418
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 ...
Egret's user avatar
  • 414
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 ...
NinjaDarth's user avatar

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