Questions tagged [language-features]

A language feature is a distinct aspect of a programming language, such as binding rules, lexical design, or facets of the type system.

618 questions
22
votes
6 answers

Should I use C++0x Features Now?

With the official release of VS 2010, is it safe for me to start using the partially-implemented C++0x feature set in my new code? The features that are of interest to me right now are both implemented by VC++ 2010 and recent versions of GCC. These…
svu2g
  • 223
  • 1
  • 4
22
votes
10 answers

Are there any disadvantages of using C# 3.0 features?

I like C# 3.0 features especially lambda expressions, auto implemented properties or in suitable cases also implicitly typed local variables (var keyword), but when my boss revealed that I am using them, he asked me not to use any C# 3.0 features in…
Curious
  • 221
  • 1
  • 3
22
votes
7 answers

ForEach loop in Mathematica

I'd like something like this: each[i_, {1,2,3}, Print[i] ] Or, more generally, to destructure arbitrary stuff in the list you're looping over, like: each[{i_, j_}, {{1,10}, {2,20}, {3,30}}, Print[i*j] ] Usually you want to use Map or other…
dreeves
  • 26,430
  • 45
  • 154
  • 229
21
votes
2 answers

What are the benefits of such flexible "self-identifiers" in F#?

While I understand self-identifiers in F#, I am puzzled as to the benefits of such flexibility. Why does F# not just support this.Blah as C# does and be done with it? I'm guessing some people use it to improve readability, but even that seems a…
bentayloruk
  • 4,060
  • 29
  • 31
21
votes
7 answers

Name this python/ruby language construct (using array values to satisfy function parameters)

What is this language construct called? In Python I can say: def a(b,c): return b+c a(*[4,5]) and get 9. Likewise in Ruby: def a(b,c) b+c end a(*[4,5]) What is this called, when one passes a single array to a function which otherwise requires…
user
  • 3,938
  • 1
  • 23
  • 19
21
votes
10 answers

How to hide (remove) a base class's methods in C#?

The essence of the problem is, given a class hierarchy like this: class A { protected void MethodToExpose() {} protected void MethodToHide(object param) {} } class B : A { new private void MethodToHide(object param) {} …
Ogre Psalm33
  • 21,366
  • 16
  • 74
  • 92
20
votes
6 answers

Should I prefer static methods in C#

Having spent a bit of time learning about functional programming, it's becoming more and more natural for me to want to work with static methods that don't perform any mutation. Are there any reasons why I should curb this instinct?
Khanzor
  • 4,830
  • 3
  • 25
  • 41
20
votes
5 answers

Shorthand for nested null checking C#

As far as I know there is not a significantly more elegant way to write the following.... string src; if((ParentContent!= null) &&(ParentContent.Image("thumbnail") != null) &&(ParentContent.Image("thumbnail").Property("src") != null)) …
Myster
  • 17,704
  • 13
  • 64
  • 93
20
votes
4 answers

C# internal VS VBNET Friend

To this SO question: What is the C# equivalent of friend?, I would personally have answered "internal", just like Ja did among the answers! However, Jon Skeet says that there is no direct equivalence of VB Friend in C#. If Jon Skeet says so, I won't…
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
19
votes
3 answers

What is the difference between a let block statement and an equivalent with statement?

OBSOLETE The block version of the let statement was dropped from ES6 before it was finalized, and it has been removed from the browsers that supported it. This question is now only of historic interest. Is there any difference between using an…
Jeremy
  • 1
  • 85
  • 340
  • 366
19
votes
5 answers

Beginner question: What is binding?

I was trying to understand the difference between early and late binding, and in the process realized that the concept of binding is nebulous to me. I think I understand that it relates to the way data-as-a-word-of-memory is linked to…
19
votes
10 answers

Does this language feature already exist?

I'm currently developing a new language for programming in a continuous environment (compare it to electrical engineering), and I've got some ideas on a certain language construction. Let me explain the feature by explanation and then by…
Pindatjuh
  • 10,550
  • 1
  • 41
  • 68
18
votes
8 answers

Is there an eval function In C#?

I'm typing an equation into a TextBox that will generate the graph of the given parabola. Is it possible to use an eval function? I'm using C# 2010 and it doesn't have Microsoft.JScript
clay turner
  • 181
  • 1
  • 1
  • 3
18
votes
4 answers

Is there a use of free floating block inside a method in Java?

I didn't know methods could have floating blocks like this: class X { public static void main( String [] args ) { { //<--- start int i; } //<-- ends } } I was aware of floating blocks outside methods, but never…
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
18
votes
10 answers

Is it bad practice to use C features in C++?

For example printf instead of cout, scanf instead of cin, using #define macros, etc?
Gustavo Puma
  • 993
  • 12
  • 27