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
43
votes
1 answer

Why doesn't Java varargs support collections?

In my Java code I often use the very handy method(Class... args) varargs. As far as I know, they allow you to pass any amount of Class objects or an array of Class[]. Since I also often use the Java collection classes, I am frustrated by the lack of…
tb189
  • 1,942
  • 3
  • 22
  • 37
41
votes
19 answers

Have you ever restricted yourself to using a subset of language features?

Have you ever restricted yourself to using a subset of language features, and more importantly, why? I'm curious to find out who choose to use only certain language features and avoid others in order to win big in areas such as, but not limited to,…
Jonathon Watney
  • 20,248
  • 9
  • 38
  • 40
41
votes
6 answers

What is the difference between VB and VBScript

What is the difference between VB and VBScript?
DNR
  • 3,706
  • 14
  • 56
  • 91
38
votes
3 answers

Java's switch equivalent in Clojure?

Is there an equivalent for Java's switch construct in Clojure? If yes, what is it? If no, do we have to use if else ladder to achieve it?
vikbehal
  • 1,486
  • 3
  • 21
  • 48
36
votes
1 answer

What's the new way to iterate over a Java Map in Scala 2.8.0?

How does scala.collection.JavaConversions supercede the answers given in Stack Overflow question Iterating over Java collections in Scala (it doesn't work because the "jcl" package is gone) and in Iterating over Map with Scala (it doesn't work for…
Alex R
  • 11,364
  • 15
  • 100
  • 180
33
votes
12 answers

Is there, or is there ever going to be, a conditional operator in Delphi?

I kept my hands off Delphi for too long, I guess; busied myself with Java and PHP a lot over the last couple of years. Now, when I got back to doing a little Delphi job, I realised I really miss the conditional operator which is supported by both…
Peter Perháč
  • 20,434
  • 21
  • 120
  • 152
31
votes
14 answers

What's so great about Scala?

What makes Scala such a wonderful language, other than the type system? Almost everything I read about the language brings out 'strong typing' as a big reason to use Scala, but there has to be more than that. What are some of the other compelling…
Don Werve
  • 5,100
  • 2
  • 26
  • 32
31
votes
5 answers

What is the rationale for not having static constructor in C++?

What is the rationale for not having static constructor in C++? If it were allowed, we would be initializing all the static members in it, at one place in a very organized way, as: //illegal C++ class sample { public: static int some_integer; …
Nawaz
  • 353,942
  • 115
  • 666
  • 851
31
votes
6 answers

How to declare a C# Record Type?

I read on a blog that C# 7 will feature record types class studentInfo(string StudentFName, string StudentMName, string StudentLName); However when I tried it, I get these errors CS0116 A namespace cannot directly contain members such as…
Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
31
votes
6 answers

What is the maximum length of a C#/CLI identifier?

Which other restrictions are there on names (beside the obvious uniqueness within a scope)? Where are those defined?
David Schmitt
  • 58,259
  • 26
  • 121
  • 165
30
votes
7 answers

Why does HTML5 not include a way of loading local HTML into the document?

I've thinking about this a lot lately. Why does HTML5 not really let you load HTML into your document to break up your HTML files? It has support for nearly every other asset (images, videos, audio). Yes we have iframes, embeds, and objects but…
Matt
  • 22,224
  • 25
  • 80
  • 116
29
votes
5 answers

Scoped using-directive within a struct/class declaration?

I find that my C++ header files are quite hard to read (and really tedious to type) with all the fully-qualified types (which goes as deep as 4 nested namespaces). This is the question (all the answers give messy alternatives to implementing it, but…
Zach Saw
  • 4,308
  • 3
  • 33
  • 49
29
votes
4 answers

Any chances to imitate times() Ruby method in C#?

Every time I need to do something N times inside an algorithm using C# I write this code for (int i = 0; i < N; i++) { ... } Studying Ruby I have learned about method times() which can be used with the same semantics like this N.times do …
Alexander Prokofyev
  • 33,874
  • 33
  • 95
  • 118
28
votes
2 answers

Reading a line from standard input in Python

What (if any) are the differences between the following two methods of reading a line from standard input: raw_input() and sys.stdin.readline() ? And in which cases one of these methods is preferable over the other ?
Grigor Gevorgyan
  • 6,753
  • 4
  • 35
  • 64
28
votes
9 answers

Can someone demystify the yield keyword?

I have seen the yield keyword being used quite a lot on Stack Overflow and blogs. I don't use LINQ. Can someone explain the yield keyword? I know that similar questions exist. But none really explain what is its use in plain simple language.
Sandbox
  • 7,910
  • 11
  • 53
  • 67