Top "Language-design" questions

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

Why does Python assignment not return a value?

Why is Python assignment a statement rather than an expression? If it was an expression which returns the value of …

python python-3.x language-design
Is "monkey patching" really that bad?

Some languages like Ruby and JavaScript have open classes which allow you to modify interfaces of even core classes like …

javascript ruby oop language-design monkeypatching
Performance of "direct" virtual call vs. interface call in C#

This benchmark appears to show that calling a virtual method directly on object reference is faster than calling it on …

c# .net performance language-design
Why are slice and range upper-bound exclusive?

Disclaimer: I am not asking if the upper-bound stopargument of slice()and range() is exclusive or how to use these …

python language-design slice
Purpose of "let expression" (LetExpr) in the Java compiler?

The Java compiler seems to have support for let expressions in com.sun.tools.javac.tree.* (look for LetExpr). One …

java compiler-construction language-design let
what does a php function return by default?

If I return nothing explicitly, what does a php function exactly return? function foo() {} What type is it? What value …

php function variables language-design
C# design: Why is new/override required on abstract methods but not on virtual methods?

Why is new/override required on abstract methods but not on virtual methods? Sample 1: abstract class ShapesClass { abstract public int …

c# virtual language-design abstract-methods
Why do local variables require initialization, but fields do not?

If I create a bool within my class, just something like bool check, it defaults to false. When I create …

c# language-design local-variables
Why optional parameters must appear at the end of the declaration

In all programming languages supporting optional parameters that I have seen there is a imitation that the optional parameters must …

c# java language-agnostic language-design optional-parameters
Is Lua based primarily on well-established programming-language ideas?

Lua occupies a good place in the space of languages that can be embedded. Are the primary ideas behind Lua's …

lua language-design