Top "Language-design" questions

A tag for questions related to the design of any aspect of programming languages.

Elegant ways to return multiple values from a function

It seems like in most mainstream programming languages, returning multiple values from a function is an extremely awkward thing. The …

python function language-agnostic language-design syntactic-sugar
Why are many languages case sensitive?

Why are many languages case sensitive? Is it simply a matter of inheritance? C++ is case-sensitive because C is, Java …

language-design case-sensitive
Why doesn't Java have automatic properties like C#?

C# has automatic properties which greatly simplify your code: public string Name { get; set; } public string MiddleName { get; set; } public …

c# java history language-design automatic-properties
Why can't you have multiple interfaces in a bounded wildcard generic?

I know there's all sorts of counter-intuitive properties of Java's generic types. Here's one in particular that I don't understand, …

java generics language-design bounded-wildcard
Why are C# 3.0 object initializer constructor parentheses optional?

It seems that the C# 3.0 object initializer syntax allows one to exclude the open/close pair of parentheses in the …

c# syntax types language-design initializer
Why is Clojure dynamically typed?

One thing I like very much is reading about different programming languages. Currently, I'm learning Scala but that doesn't mean …

dynamic functional-programming clojure language-design paradigms
Can't set attributes on instance of "object" class

So, I was playing around with Python while answering this question, and I discovered that this is not valid: o = …

python attributes language-design
Bounding generics with 'super' keyword

Why can I use super only with wildcards and not with type parameters? For example, in the Collection interface, why …

java generics language-design super
Why does the implicit copy constructor calls the base class copy constructor and the defined copy constructor doesn't?

Consider a class hierarchy where A is the base class and B derives from A. If the copy constructor is …

c++ language-design copy-constructor
Why does Python's itertools.permutations contain duplicates? (When the original list has duplicates)

It is universally agreed that a list of n distinct symbols has n! permutations. However, when the symbols are not …

python algorithm language-design permutation