A language feature is a distinct aspect of a programming language, such as binding rules, lexical design, or facets of the type system.
Questions tagged [language-features]
618 questions
26
votes
9 answers
Is there a better C?
I want a better C. Let me explain:
I do a lot of programming in C, which is required for applications that have real-time needs such as audio programming, robotics, device drivers, etc.
While I love C, one thing that gets on my nerves after having…

Steve
- 1,512
- 1
- 14
- 17
26
votes
6 answers
Is it costly to do array.length or list.count in a loop
I know that in JavaScript, creating a for loop like this: for(int i = 0; i < arr.length; i++) is costly as it computes the array length each time.
Is this behavior costly in c# for lists and arrays as well. Or at compile-time is it optimized? Also…

maxfridbe
- 3,221
- 3
- 23
- 13
26
votes
5 answers
Does Java have Automatic Properties?
In c# you can setup properties like this:
public int CustomerId {get;set;}
Which sets up an automatic property called CustomerId, but I was wondering if there was anything similar in Java?

lomaxx
- 113,627
- 57
- 144
- 179
26
votes
9 answers
How do you force constructor signatures and static methods?
Is there a way of forcing a (child) class to have constructors with particular signatures or particular static methods in C# or Java?
You can't obviously use interfaces for this, and I know that it will have a limited usage. One instance in which I…

Sklivvz
- 30,601
- 24
- 116
- 172
25
votes
5 answers
Why has Python decided against constant references?
Note: I'm not talking about preventing the rebinding of a variable. I'm talking about preventing the modification of the memory that the variable refers to, and of any memory that can be reached from there by following the nested containers.
I have…

max
- 49,282
- 56
- 208
- 355
25
votes
3 answers
Default method return value in Java interfaces
While working with annotations I stumbled accross the following piece of code (it's the Hibernate @NotNull annotation):
@Target(value = {ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR,…

MicSim
- 26,265
- 16
- 90
- 133
25
votes
12 answers
Is Java assert broken?
While poking around the questions, I recently discovered the assert keyword in Java. At first, I was excited. Something useful I didn't already know! A more efficient way for me to check the validity of input parameters! Yay learning!
But then I…

BlairHippo
- 9,502
- 10
- 54
- 78
24
votes
3 answers
C# Null propagating operator / Conditional access expression & if blocks
The Null propagating operator / Conditional access expression coming in c#-6.0 looks like quite a handy feature. But I'm curious if it will help solve the problem of checking if a child member is not null and then calling a Boolean method on said…

Philip Pittle
- 11,821
- 8
- 59
- 123
24
votes
4 answers
Is there any Scala feature that allows you to call a method whose name is stored in a string?
Assuming you have a string containing the name of a method, an object that supports that method and some arguments, is there some language feature that allows you to call that dynamically?
Kind of like Ruby's send parameter.

Geo
- 93,257
- 117
- 344
- 520
24
votes
24 answers
What features should Java 7 onwards have to encourage switching from C#?
C# has a good momentum at the moment. What are the features that you would need to have in order to switch (or return) to Java?
It would also be quite useful if people posted workarounds for these for the current Java versions, e.g. Nullables being…

NT_
- 2,660
- 23
- 25
23
votes
7 answers
Is it possible to replace a Python function/method decorator at runtime?
If I have a function :
@aDecorator
def myfunc1():
# do something here
if __name__ = "__main__":
# this will call the function and will use the decorator @aDecorator
myfunc1()
# now I want the @aDecorator to be replaced with the decorator…

Geo
- 93,257
- 117
- 344
- 520
23
votes
6 answers
Can you create private classes in C#?
This is a question for the .NET philosophers:
It is my understanding that Microsoft consciously denied use of private classes in C#. Why did they do this and what are their arguments for doing so?
I, for example, am building a large application that…

Archeg
- 8,364
- 7
- 43
- 90
23
votes
15 answers
Are there equivalents to Ruby's method_missing in other languages?
In Ruby, objects have a handy method called method_missing which allows one to handle method calls for methods that have not even been (explicitly) defined:
Invoked by Ruby when obj is sent a message it cannot handle. symbol is the symbol for the…

Justin Ethier
- 131,333
- 52
- 229
- 284
23
votes
11 answers
How does your favorite language handle deep recursion?
I recently started learning Python and I was rather surprised to find a 1000 deep recursion limit (by default). If you set it high enough, about 30000, it crashes with a segmentation fault just like C. Although, C seems to go quite a lot…

jettero
- 835
- 2
- 13
- 26
23
votes
11 answers
Hidden Features of F#
This is the unabashed attempt of a similar C# question.
So what are your favorite F# hidden (or not) features?
Most of the features I've used so far aren't exactly hidden but have been quite refreshing. Like how trivial it is to overload operators…

Fung
- 7,530
- 7
- 53
- 68