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
157
votes
10 answers
Why are private fields private to the type, not the instance?
In C# (and many other languages) it's perfectly legitimate to access private fields of other instances of the same type. For example:
public class Foo
{
private bool aBool;
public void DoBar(Foo anotherFoo)
{
if…

RichK
- 11,318
- 6
- 35
- 49
153
votes
10 answers
What is the tilde (~) in the enum definition?
I'm always surprised that even after using C# for all this time now, I still manage to find things I didn't know about...
I've tried searching the internet for this, but using the "~" in a search isn't working for me so well and I didn't find…

hugoware
- 35,731
- 24
- 60
- 70
147
votes
2 answers
Python ? (conditional/ternary) operator for assignments
C and many other languages have a conditional (AKA ternary) operator. This allows you to make very terse choices between two values based on the truth of a condition, which makes expressions, including assignments, very concise.
I miss this because…

Will
- 73,905
- 40
- 169
- 246
141
votes
3 answers
VB.NET equivalent of C# property shorthand?
Is there a VB.NET equivalent to the C#:
public string FirstName { get; set; }
I know you can do
Public Property name() As String
Get
Return _name.ToString
End Get
Set(ByVal value As String)
_name = value
End Set
End…

Birk
- 2,173
- 4
- 21
- 26
128
votes
12 answers
Why is there a `null` value in JavaScript?
In JavaScript, there are two values which basically say 'I don't exist' - undefined and null.
A property to which a programmer has not assigned anything will be undefined, but in order for a property to become null, null must be explicitly assigned…

Christoph
- 164,997
- 36
- 182
- 240
126
votes
6 answers
Use of Begin / End Blocks and the Go keyword in SQL Server?
What are the guidelines as to when to use the BEGIN and END keywords in SQL Server?
Also, what exactly does the GO keyword do?

Tarik
- 79,711
- 83
- 236
- 349
121
votes
9 answers
What is the purpose of python's inner classes?
Python's inner/nested classes confuse me. Is there something that can't be accomplished without them? If so, what is that thing?

Geo
- 93,257
- 117
- 344
- 520
112
votes
5 answers
The written versions of the logical operators
This is the only place I've ever seen and, or and not listed as actual operators in C++. When I wrote up a test program in NetBeans, I got the red underlining as if there was a syntax error and figured the website was wrong, but it is NetBeans which…

defectivehalt
- 2,462
- 3
- 21
- 22
110
votes
36 answers
Hidden features of HTML
HTML being the most widely used language (at least as a markup language) has not gotten its due credit.
Considering that it has been around for so many years, things like the FORM / INPUT controls have still remained same with no new controls…

Binoj Antony
- 15,886
- 25
- 88
- 96
100
votes
8 answers
What unique features does Firebug have that are not built-in to Firefox?
I just cleaned my Firefox addons and wondered:
Which features does Firebug have that make it unique?
Which features are available in both Firebug and the Firefox Developer Tools?

janpio
- 10,645
- 16
- 64
- 107
95
votes
18 answers
Samples of Scala and Java code where Scala code looks simpler/has fewer lines?
I need some code samples (and I also really curious about them) of Scala and Java code which show that Scala code is more simple and concise then code written in Java (of course both samples should solve the same problem).
If there is only Scala…

Roman
- 64,384
- 92
- 238
- 332
92
votes
8 answers
Python: How to pass more than one argument to the property getter?
Consider the following example:
class A:
@property
def x(self): return 5
So, of course calling the a = A(); a.x will return 5
But imagine that you want to be able to modify the property x.
This way, for example:
class A:
@property
…

Rizo
- 3,003
- 5
- 34
- 49
86
votes
3 answers
Why isn't the eigenclass equivalent to self.class, when it looks so similar?
I've missed the memo somewhere, and I hope you'll explain this to me.
Why is the eigenclass of an object different from self.class?
class Foo
def initialize(symbol)
eigenclass = class << self
self
end
eigenclass.class_eval do
…

Robert K
- 30,064
- 12
- 61
- 79
84
votes
9 answers
Why C# doesn't implement indexed properties?
I know, I know... Eric Lippert's answer to this kind of question is usually something like "because it wasn't worth the cost of designing, implementing, testing and documenting it".
But still, I'd like a better explanation... I was reading this blog…

Thomas Levesque
- 286,951
- 70
- 623
- 758
82
votes
18 answers
What are C macros useful for?
I have written a little bit of C, and I can read it well enough to get a general idea of what it is doing, but every time I have encountered a macro it has thrown me completely. I end up having to remember what the macro is and substitute it in my…

Jack Ryan
- 8,396
- 4
- 37
- 76