Questions tagged [language-features]
Questions about distinctive aspects of particular computer languages, particularly in the way they are written or in the expressive capabilities provided to the programmer.
153 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
5
votes
4
answers
325
views
A [[byvalue]] attribute for C++?
Background
C++ attributes are a useful way to document assumptions and intent within code, and to prevent warnings. (e.g. [[fallthrough]])
Now, the Core Guidelines recommend to For "in" parameters, ...
4
votes
4
answers
805
views
Why is ArrayList not a Stack
I've been wondering for a while why an ArrayList does not have a stack-like interface (think push() and pop())
I frequently find myself using these constructs in Java:
list.get(list.size() - 1);
list....
35
votes
11
answers
13k
views
Why don't programming languages or IDEs support attaching descriptive metadata to variables?
As developers, we often face the challenge of balancing meaningful variable names with code readability. Long, descriptive names can make code harder to read, while short names may lack context. For ...
5
votes
1
answer
2k
views
Does a programming language with ML-style modules need packages?
This is a clarification of a closed question. I've limited the scope as requested.
First, a few definitions, following e.g. A modular module system. Consider any programming language with a selected ...
4
votes
3
answers
1k
views
Why does HTML collapse whitespace?
I've been trying to better understand (at least at a high level) why the early versions of HTML were designed the way they were. Most of the decisions make sense; I can deduce (at least at a high ...
13
votes
4
answers
6k
views
Can Just-In-Time compilation be considered a secure feature?
The commonly endorsed, and considered the most reliable, way of evaluating the security of a program is through examining its source code. That is, this method is based on the fundamental assumption: &...
2
votes
1
answer
137
views
Hot reloading anonymous functions in a custom scripting language
I am implementing anonymous functions (lambdas) in a scripting language that supports hot reloading. The language currently supports passing user defined functions (pointers) to plugin functions which ...
4
votes
4
answers
1k
views
Is there a cancel after certain amount of time try catch type of block?
I'm going through a beginner programming learning guides and the teacher brings up the try catch block paradigm.
The code you put in the try block is run and if an error happens the code in the catch ...
9
votes
6
answers
2k
views
Do any programming languages use types as values? Would there be any point?
The standard way that types are handled in programming languages that have such a concept, is that they are:
removed entirely at compile time and are just used to determine memory layout, function ...
-2
votes
1
answer
503
views
Which non-standard C features can I use? [closed]
C and C++ have standards, but support isn't perfect, the only available copies on the internet are drafts, and there are immensely useful things that aren't standard, such as __attribute__((cleanup)). ...
1
vote
3
answers
230
views
Unifying and modularizing the while / do feature set in c
disclaimer: I'm a university student who's one-year-new to programming. Please don't slaughter me in your responses as I am still a human being
I have an idea that I want some feedback on. I am ...
1
vote
2
answers
1k
views
Template argument type exclusion: Would this make for a useful C++ feature?
When using templates we can have T be any type upon class instantiation. If T is a specific type that needs to be handled differently or in a special way we can specialize or partial specialize that ...
-2
votes
1
answer
221
views
Is there a common agreed upon token symbol used in computer science or common across languages?
I have seen tokens like this:
var message = "Hello, {Name}";
and like this:
var message = "Hello, ${name}";
and like this:
var message = "Hello, @NAME";
and a few ...
4
votes
4
answers
1k
views
Is checking the type of a variable antithetical to OOP?
As an example, in PHP you can run
gettype($myVariable);
to obtain the type of a variable $myVariable.
Is such functionality antithetical to OOP principles?
1
vote
2
answers
1k
views
Logically, is there a reason why ++i++ can not be a valid expression?
I had to increment my integer twice in a loop, so I thought I would try and be clever:
for (int i = 0; !sl.isEmpty(); ++i++) { ... }
++i++ however is not an assignable expression, at least in GCC.
...