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.

language-features
Filter by
Sorted by
Tagged with
0 votes
2 answers
637 views

Python dict: mapping keys to a different range under constraints

I have a dictionary d wohse keys are n integers. The keys are not necessarily consecutive numbers, however, it is known that d contains num_negative consecutive keys in range (-num_negative,0) and ...
4 votes
1 answer
387 views

PostgreSQL Parametric Window Size

Does anyone know if SQL Standards define and PostgreSQL will implement (10.x or higher) Parametric Window Size? Bellow a MVE of what I call a parametric window size: WITH D AS (SELECT T.x::FLOAT ...
1 vote
2 answers
1k views

TFIDIF Model Creation TypeError in Gensim

TypeError: 'TfidfModel' object is not callable Why can I not compute the TFIDF Matrix for each Doc after initializing? I started with 999 documents: 999 paragraphs with about 5-15 sentences each. ...
69 votes
12 answers
34k views

Will a future version of .NET support tuples in C#?

.Net 3.5 doesn't support tuples. Too bad, But not sure whether the future version of .net will support tuples or not?
0 votes
3 answers
808 views

Reverse DOM node order with Javascript

I'm curious if there is an easy way to make this transition with JavaScript. <div> <i> <b> TEXT </b> </i> </div> To this: <div> <b&...
11 votes
9 answers
1k views

Why are there finalizers in java and c#?

I'm not quite understanding why there are finalizers in languages such as java and c#. AFAIK, they: are not guaranteed to run (in java) if they do run, they may run an arbitrary amount of time after ...
11 votes
3 answers
914 views

Are move semantics incomplete?

Move semantics replace copy semantics in situations where copying is inefficient. Copy semantics deals fully with copyable objects, including const objects. Already, there exists a myriad of non-...
-3 votes
1 answer
757 views

Automatically apply C# 7 getter and setter style [closed]

Is there any way to automatically apply C# 7 getter and setter styles (or maybe other new language features)? It would be nice if there would be any way to automatically change properties like these: ...
15 votes
1 answer
3k views

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 << ", "...
23 votes
15 answers
4k views

Are there equivalents to Ruby's method_missing in other languages?

In Ruby, objects have a handy method called method_missing which allows one to handle method calls for methods that have not even been (explicitly) defined: Invoked by Ruby when obj is sent a ...
0 votes
3 answers
180 views

Is there a syntactic sugar in C# similar to `using()` except for taking waiting and releasing on a semaphore?

using (var foo = bar){} is excellent syntactic sugar. It replaces an entire blob var foo = bar try { } finally { foo.dispose() } I found myself today writing very similar blobs var foo.WaitOne()...
2 votes
2 answers
472 views

Do Redundant Namespaces incur any overhead

Other than maintenance complexity (and I would argue there is little to none), and the fact that it is not a clean solution (this I agree with) does importing redundant namespaces in a .NET class ...
1 vote
4 answers
127 views

Mechanism to ensure a loop ends

When I was in college we had a guest lecture from David Parnas. In it he mentioned a mechanism that is used to guarantee that a loop (while loop, for loop, etc.) exits safely at some point. He scoffed ...
9 votes
0 answers
2k views

CMake - Using POSIX feature test macros?

CMake as a set of handy properties that correspond to setting certain feature test macros in the underlying compiler. For example, with gcc: set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON)...
9 votes
9 answers
2k views

What features is lisp lacking? [closed]

I have read that most languages are becoming more and more like lisp, adopting features that lisp has had for a long time. I was wondering, what are the features, old or new, that lisp does not have? ...
1 vote
1 answer
3k views

Typescript allows to create a class field name by starting with number

Why typescript allows class field name in number 1: number = 1; 2: number = 2; As per this discussion Why can't variable names start with numbers? We can't create a class field name starting ...
-1 votes
1 answer
1k views

What is the definition of "language feature" in programming

I see that for such a widely used term I cannot find any definition or dedicated wikipedia article. I also use the term but I'm not sure whether I use it correctly in all cases. By looking at sites ...
2 votes
2 answers
2k views

Can tuple literals in C# 7.0 enable aspect oriented programming

I'm referring to tuple literals as described here: https://blogs.msdn.microsoft.com/dotnet/2016/08/24/whats-new-in-csharp-7-0/#comment-321926 Love the tuple literal idea. However I foresee a lot of ...
0 votes
1 answer
360 views

Installing Opencv Repository In Windows 10 for Python or Cmake

I want to know if someone can help me with install opencv repository files in Windows 10 system. I want to use xfeatures2d and i have been told from other peoples comments on other pages that the ...
28 votes
2 answers
64k views

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 ...
48 votes
4 answers
43k views

Why do enums have computed properties but not stored properties in Swift?

I am new to Swift and just came across this in the documentation: Computed properties are provided by classes, structures, and enumerations. Stored properties are provided only by classes and ...
1 vote
1 answer
285 views

In C, why this statement- 'i = 5i' compiles & sets 'i' to zero?

In GCC the following C code compiles correctly- int i = 7; i = 5i; printf("%d", i); And prints- 0. The statement i = 5i clearly makes no sense. Then why on earth the code does not give any ...
20 votes
5 answers
5k views

Shorthand for nested null checking C#

As far as I know there is not a significantly more elegant way to write the following.... string src; if((ParentContent!= null) &&(ParentContent.Image("thumbnail") != null) &&(...
42 votes
6 answers
39k views

What is the difference between VB and VBScript

What is the difference between VB and VBScript?
1 vote
4 answers
167 views

Is there any way to make a function's return accessible via a property?

I'm a JS dev, experimenting with functional programming ideas, and I'm wondering if there's anyway to use chains for synchronous functions in the way the promise chains are written. For example: ...
0 votes
3 answers
340 views

in es6 do we need to add `return` literal, if there are conditions within function

As far as I have used es6; I come to know that in this we can omit return literal like .then((res) => res.body } // equivalent to return res.body so my question is if there are multiple ...
0 votes
1 answer
82 views

C# Feature Quetion : How does signalr allow calling of client functions from hub?

How does SignalR allow the developer to call a function name that has not been defined in c#. An example would be: Clients.All.sayHello("Greetings!"); The sayHello(string msg) has not been defined. ...
29 votes
5 answers
33k views

Scoped using-directive within a struct/class declaration? [duplicate]

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 ...
1 vote
1 answer
110 views

Is there any programming language which has a for-while loop?

This is what I mean by a for-while loop: for (<init>; <update>) <body> while (<test>); It roughly translates to: <init> <body> while (<test>) { <...
2 votes
3 answers
328 views

What language features eliminate a whole class of errors? [closed]

I have often seen claims that a programming language feature eliminates a whole class of errors. For example, I have seen claims that: A strong type system eliminates the class of errors caused by ...
19 votes
3 answers
2k views

What is the difference between a let block statement and an equivalent with statement?

OBSOLETE The block version of the let statement was dropped from ES6 before it was finalized, and it has been removed from the browsers that supported it. This question is now only of historic ...
5 votes
3 answers
20k views

Should I use a Guid and Guid.Empty or a nullable Guid?

I have certain scenarios (e.g. a custom class to hold Sql parameters) in which a variable may or may not be required. Traditionally I have always defined these being of type Guid? and used myGuid....
1 vote
1 answer
599 views

Don't understand the need for $cacheFactory if Factories are singletons

I'm relatively new to AngularJs and I'm trying to build a single page application with it. My application runs within a content management site. I have 3 factories for user, group and site functions. ...
2 votes
1 answer
151 views

Which microversion of Python 2.7 introduced set comprehension?

It works in my interpreter (2.7.12). From http://sopython.com/wiki/In_which_Python_version_was_feature_X_introduced%3F I know, that it was introduced in 2.7. Unfortunately the online documentation ...
100 votes
8 answers
22k views

What unique features does Firebug have that are not built-in to Firefox?

I just cleaned my Firefox addons and wondered: Which features does Firebug have that make it unique? Which features are available in both Firebug and the Firefox Developer Tools?
5 votes
7 answers
4k views

GOTO command in PHP?

I've heard rumors that PHP is planning on introducing a "goto" command. What is it supposed to be doing? I've tried searching a bit, but haven't found anything awfully descriptive. I understand that ...
15 votes
3 answers
6k views

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 ...
3 votes
1 answer
1k views

Null-propagation replacement for null check prior conditional statement

After seeing a similar question, I was wondering if the following expression ... if (attribute != null && attribute.Description == input) ... would behave (almost) identical, to following ...
16 votes
16 answers
3k views

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 ...
3 votes
2 answers
933 views

Programming language besides Tcl where everything is string

Are there any programming languages where everything is a string. For example, let's consider this Tcl snippet (comments shows the equivalent statement in C/Java) for e.g. set x [append ab cd] ;# c = ...
47 votes
7 answers
89k views

What is the purpose of long, double, byte, char in Java?

So I'm learning java, and I have a question. It seems that the types int, boolean and string will be good for just about everything I'll ever need in terms of variables, except perhaps float could be ...
-7 votes
1 answer
298 views

Reasoning behind swift's function notation? [closed]

Why does Swift use this function notation: func greet(person: String, day: String) -> String { return "Hello \(person), today is \(day)." } I don't get why it uses the small arrow -> ...
0 votes
2 answers
54 views

Would making package in Java something other that a folder be a good idea?

Right now, that is all a package is. So when I create a new Package in Eclipse, I am just asked its name. But what if Package was something like or exactly like Interface and everything under the ...
2 votes
0 answers
479 views

Difference between "var", "let" and "const" [duplicate]

ECMAScript 6 introduced two new ways of declaring variables: the let statement and the const statement. How are they different from the var keyword?
0 votes
5 answers
4k views

Algorithm for Dating Website

Out of curiosity, i'm wondering if anyone has had any experience writing a Dating Website. I hear the word algorithm used alot but have never really came across a situation where i've needed to use ...
3 votes
7 answers
14k views

how can we override method in child class without using "virtual" in parent class

This is a interview question. So is it possible to override a method without virtual specified in parent method?
1 vote
2 answers
224 views

Which are the features of C++0x that will remain for sure (if any)?

Are there any features of C++0x that are known to be there for sure? Like, maybe, threads in the standard library?
7 votes
4 answers
1k views

Convergence of Mathematics and Programming Languages

It seems that there is a strong movement for the convergence of mathematics and computer programming languages, this is notably evidenced by the influence of the lambda calculus on modern languages. ...
-1 votes
3 answers
152 views

c++ bool anomaly -- why is this possible?

I just stumbled across this: When postifix incrementing a bool twice, the integer value still is 1 instead of the expected 2. I'd like to know why this happens. bool test = false; // results in ...
2 votes
1 answer
80 views

Java language spec: LambdaExpression in Java ConditionalExpression

In the Java 8 specification there is the following syntax description of the conditional operator ?: : ConditionalExpression: ConditionalOrExpression ConditionalOrExpression ? Expression : ...

1 2 3
4
5
13