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
16
votes
3 answers

Programming Constructs History

Let us research and trace back the origins of language constructs. For example: Constructs Introduced from LISP If-Else Block :"The ubiquitous if-then-else structure, now taken for granted as an essential element of any programming language, was…
unj2
  • 52,135
  • 87
  • 247
  • 375
16
votes
37 answers

What are your language "hangups"?

I've read some of the recent language vs. language questions with interest... Perl vs. Python, Python vs. Java, Can one language be better than another? One thing I've noticed is that a lot of us have very superficial reasons for disliking…
Dan Lenski
  • 76,929
  • 13
  • 76
  • 124
16
votes
16 answers

Which languages support *recursive* function literals / anonymous functions?

It seems quite a few mainstream languages support function literals these days. They are also called anonymous functions, but I don't care if they have a name. The important thing is that a function literal is an expression which yields a function…
16
votes
4 answers

Scala equivalent to Haskell's where-clauses?

Is it possible to use something similar to where-clauses in Scala? Maybe there is some trick I didn't think of? Edit: Thanks for all your answers, they are very much appreciated. To sum up: Local vars, vals and defs can be used to achieve almost the…
Kim Stebel
  • 41,826
  • 12
  • 125
  • 142
15
votes
7 answers

Consider a "disposable" keyword in C#

What are your opinions on how disposable objects are implemented in .Net? And how do you solve the repetitiveness of implementing IDisposable classes? I feel that IDisposable types are not the first-class citizens that they should've been. Too much…
Peter Lillevold
  • 33,668
  • 7
  • 97
  • 131
15
votes
8 answers

If monkey patching is permitted in both Ruby and Python, why is it more controversial in Ruby?

In many discussions I have heard about Ruby in which people have expressed their reservations about the language, the issue of monkey patching comes up as one of their primary concerns. However, I rarely hear the same arguments made in the context…
Paul Dexter
  • 405
  • 1
  • 4
  • 10
15
votes
9 answers

What is the overall design philosophy of php?

I recently had my first encounter with PHP (5) through a Drupal application for a client. There was certainly nothing difficult about the experience (documentation is good for instance), but I never had a moment where I thought, "that's really…
guns
  • 10,550
  • 3
  • 39
  • 36
15
votes
3 answers

c# switch statement more limited than vb.net 'case'

I was reading an interesting article here and it made an interesting point about the 'case' statement in vb.net vs the 'switch' statement in C#, which I've pasted below: The following Visual Basic Select Case statement can't be represented in C#…
Glinkot
  • 2,924
  • 10
  • 42
  • 67
15
votes
10 answers

Calling methods inside if() - C#

I have a couple of methods that return a bool depending on their success, is there anything wrong with calling those methods inside of the IF() ? //&& makes sure that Method2() will only get called if Method1() returned true, use & to call both…
roman m
  • 26,012
  • 31
  • 101
  • 133
15
votes
14 answers

Why can't I do ??= in C#?

I often find myself doing: foo = foo ?? x; Why can't I do: foo ??= x; Edit: I know it's not part of the language... My question is "why not"? I find the necessity to repeat "foo" to be unpleasing and potentially error-prone. It looks just as…
JoelFan
  • 37,465
  • 35
  • 132
  • 205
15
votes
15 answers

Which programming language allows to update any class on-the-fly?

I am wondering, are there any languages allows you to add/delete/update any class on the fly without reloading whole application? (Provided that I can accept some inconveniences like making sure that there is no methods running at the moment + some…
BarsMonster
  • 6,483
  • 2
  • 34
  • 47
15
votes
1 answer

C++: Adding and redefinition of default arguments in real world

There is a possibility to add or redefine default arguments of a function in C++. Let's look at the example: void foo(int a, int b, int c = -1) { std::cout << "foo(" << a << ", " << b << ", " << c << ")\n"; } int main() { foo(1, 2); //…
DAle
  • 8,990
  • 2
  • 26
  • 45
15
votes
6 answers

When to use an object or an array in javascript?

I just found out that Arrays inherit directly from Object in javascript. I'm finding the difference between an array and an object is fairly minuscule. How do i know when to use one over the other?
Derek Adair
  • 21,846
  • 31
  • 97
  • 134
15
votes
1 answer

Fixed Object Id for System Objects and Small Integers in Ruby

Why do system objects like nil, true or false have a fixed object id in Ruby. Also I tried printing out the object ids of numbers, they are the same and follow an odd number sequence pattern. Any explanation for this? [nil,true,false].each { |o|…
dexter
  • 13,365
  • 5
  • 39
  • 56
15
votes
3 answers

List of Lua derived VMs and Languages

Is there a compendium of virtual machines and languages derived or inspired by Lua? By derived, I mean usage beyond embedding and extending with modules. I'm wanting to research the Lua technology tree, and am looking for our combined knowledge of…