Top "Language-design" questions

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

Using variable keys to access values in JavaScript objects

The code: function updateDashboardData() { $.getJSON("includes/system/ajaxDataInterface.php", {recordcount:1}, function(data) { $('.stationContainer').each(function(data) { var bsID = $(this).…

javascript language-design
Function overloading by return type?

Why don't more mainstream statically typed languages support function/method overloading by return type? I can't think of any that …

programming-languages language-design overloading function-calls
Why can't variable names start with numbers?

I was working with a new C++ developer a while back when he asked the question: "Why can't variable names …

c++ variables programming-languages language-design variable-names
How does "this" keyword work within a function?

I just came across an interesting situation in JavaScript. I have a class with a method that defines several objects …

javascript language-features language-design
Why does Java not allow foreach on iterators (only on iterables)?

Possible Duplicate: Why is Java's Iterator not an Iterable? Idiomatic way to use for-each loop given an iterator? Can we …

java syntax iterator language-design iterable
What blocks Ruby, Python to get Javascript V8 speed?

Are there any Ruby / Python features that are blocking implementation of optimizations (e.g. inline caching) V8 engine has? Python …

javascript python ruby performance language-design
Why is Multiple Inheritance not allowed in Java or C#?

I know that multiple inheritance is not allowed in Java and C#. Many books just say, multiple inheritance is not …

c# java language-design multiple-inheritance
Benefits of prototypal inheritance over classical?

So I finally stopped dragging my feet all these years and decided to learn JavaScript "properly". One of the most …

javascript oop inheritance language-design prototype-programming
Why aren't variables declared in "try" in scope in "catch" or "finally"?

In C# and in Java (and possibly other languages as well), variables declared in a "try" block are not in …

c# java exception scope language-design
Why was the switch statement designed to need a break?

Given a simple switch statement switch (int) { case 1 : { printf("1\n"); break; } case 2 : { printf("2\n"); } case 3 : { printf("3\n"); } } The absence of …

c language-design