Questions about distinctive aspects of particular computer languages, particularly in the way they are written or in the expressive capabilities provided to the programmer.

learn more… | top users | synonyms

4
votes
7answers
555 views

Would an “as if” block be a reasonable language feature?

Consider the following "if cast": class A { public void f1() { ... } } class B : A { public void f2() { ... } } A a = foo(); // might return A or B if ( a is B ) { // It's B, go for it ...
1
vote
2answers
162 views

What's the reason of choosing PascalCasing over camelCasing or vice versa from a programming language design POV?

I like both but I notice languages that use camelCasing for members sometimes need more adjustments when you want to edit your code. For example (in Python): node.customData() vs ...
3
votes
2answers
306 views

Is there a name for the 'break n' construct?

In a conversation earlier this week I was discussing certain language features, and I realized I don't have a good word / phrase to describe a particular feature. Some languages, such as PHP, have a ...
2
votes
1answer
164 views

Languages supporting unicode logic operators

Are there any programming languages that support the use of unicode logic operators? For example, many programming languages use "!=" as the "does not equal" operator, but in mathematics the symbol ...
3
votes
2answers
182 views

Variable declaration versus assignment syntax

Working on a statically typed language with type inference and streamlined syntax, and need to make final decision about syntax for variable declaration versus assignment. Specifically I'm trying to ...
-2
votes
4answers
274 views

What are the advantages of converting empty strings to evaluate to true as compared to false? [closed]

When converting a string to a boolean, what are the advantages of having a programming language evaluate an empty string as true and what are the advantages of having it evaluate it to false?
-6
votes
4answers
331 views

Why must a constructor's call to the superconstructor be the first call?

It is an error if you do anything in a constructor before calling the superconstructor. I remember that I had problems because of that. Yet, I do not see how this saves us from errors. It could save ...
6
votes
6answers
1k views

In Java, why were protected members made accessible to classes of the same package?

From the official documentation... Modifier Class Package Subclass World public Y Y Y Y protected Y Y Y N no modifier Y Y N ...
6
votes
3answers
368 views

Is the usage of internal scope blocks within a function bad style?

There are some (quite rare) cases where there is a risk of: reusing a variable which is not intended to be reused (see example 1), or using a variable instead of another, semantically close (see ...
11
votes
3answers
1k views

Writing a Compiler Compiler - Insight on Use and Features

This is part of a series of questions which focuses on the sister project to the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. The ...
21
votes
6answers
1k views

How can I say that programming language compiles to other languages?

How can I say in english, that programming language can be compiled to other programming languages? The example can be Haxe. On the website the language is decribed as "Multiplatform": ...
2
votes
2answers
800 views

Why does JavaScript count array lengths by the last index?

JavaScript seems to calculate the array length property by the number of the last index in the array rather than counting the number of items in the array. Example: var testArray = ['a', 'b', 'c']; ...
-1
votes
4answers
635 views

Is is acceptable to create mediocre code now in preparation for new language features? [closed]

I'll be specific: Java 8 is promised to bring lambda expressions as well as method and constructor references among other things. As a Java developer I'm super psyched about that. In my day to day ...
7
votes
4answers
428 views

When to import names into the global namespace? (using x::y, from x import y etc.)

I've been programming in various languages for about 10 years now. And I still haven't figured out when it is a good idea to import something into the global namespace (using x::y in C++, from x ...
1
vote
3answers
813 views

Is function overloading in general considered Evil? [closed]

Recently I found about two new programming languages(Vala and google's GO) which don't support method or function overloading and intend on not supporting them in the future ever! The creators of ...
6
votes
1answer
623 views

Are non Turing-complete languages considered programming languages at all?

Reading a recent question: Is it actually possible to have a 'useful' programming language that isn't Turing complete?, I've come to wonder whether non Turing-complete programming languages are ...
26
votes
5answers
2k views

Is it actually possible to have a 'useful' programming language that isn't Turing complete?

Where it is accepted that a language has to be Turing complete to be any good, is it actually possible to have a 'useful' programming language that isn't Turing complete? I should clarify that this ...
1
vote
3answers
317 views

Multiple attribution in Python, JS, …?

I accidentally discovered this a=b=c=d=e=f=2 in python(2.7)(and JavaScript a few minutes later) interpreter . Is this a feature or just the way the interpreter works, if is a feature how it is ...
-2
votes
1answer
464 views

Why C# has no monkeypatching? [closed]

I was reading about monkeypatching _ dynamically overriding the functionality of classes. C# allows dynamic extending, but no monkeypatching, which I find reasonable. But I wondered why they ...
4
votes
5answers
423 views

What do you call “X <= $foo <= Y” comparison?

While writing a Perl statement like if ( $foo >= X && $foo <= Y ) yet again, I wondered why many programming languages do not support the more comfortable form if ( X <= $foo <= Y ...
0
votes
2answers
603 views

Static and dynamic programming languages [closed]

Someone who's just getting started in programming asked me about the advantage of different approaches programming languages take. For example, some allow the programmer to omit variable declarations ...
10
votes
8answers
1k views

Why aren't design patterns added to the languages constructs?

Recently I was talking with a colleague who mentioned that his company was working on adding the MVC design pattern as a PHP extension. He explained that they wrote C code for adding Controllers, ...
3
votes
3answers
159 views

What actions should I not rely on the packaged functionality of my language for?

While talking with one of my coworkers, he was talking about the issues the language we used had with encryption/decryption and said that a developer should always salt their own hashes. Another ...
1
vote
2answers
156 views

What are/would be the characterists and applications of a programming paradigm where functions can't have statements?

Suppose there is a language where, instead of statements, functions could only be defined in relation to other functions and operators such as partial application and composition. What would be the ...
1
vote
1answer
382 views

Incorporating GoF design patterns in Objective-C without Abstract/Virtual classes

As someone who is becoming more comfortable working in Objective-C I would like to be able to incorporate more design patterns and OOP features in my projects but struggle to implement them as ...
6
votes
3answers
386 views

Is there a language where collections can be used as objects without altering the behavior?

Is there a language where collections can be used as objects without altering the behavior? As an example, first, imagine those functions work: function capitalize(str) //suppose this ...
0
votes
1answer
508 views

An alternative to multiple inheritance when creating an abstraction layer?

In my project I am creating an abstraction layer for some APIs. The purpose of the layer is to make multi-platform easier, and also to simplify the APIs to the feature set that I need while also ...
11
votes
3answers
2k views

Appropriate programming language to design music software

I want to design a software for my musical instrument which is a rhythmic one (there is no melody). All I want these software to do is : make the user able to compose music play what user has ...
21
votes
6answers
5k views

Why the static data members have to be defined outside the class separately in C++ (unlike Java)?

class A { static int foo () {} // ok static int x; // <--- needed to be defined separately in .cpp file }; I don't see a need of having A::x defined separately in a .cpp file (or same file ...
10
votes
7answers
379 views

What is a good alternative to the name variable for a language that only has immutable references or labels?

For example, in functional languages, variables are single assignment and their values are immutable once assigned. So they have two states unbound and bound, once bound they can't be changed. Is ...
10
votes
11answers
998 views

What do you do when you can't seem to understand a certain part of programming? [closed]

I'm learning new languages as I go along, I write code for very basic programs in multiple languages, and I go to classes. I've read books, articles, lessons, videos, you name it, however I can't seem ...
11
votes
5answers
1k views

Is there a specific purpose for heterogeneous lists?

Coming from a C# and Java background, I'm used to my lists being homogeneous, and that makes sense to me. When I started picking up Lisp, I noticed that the lists can be heterogeneous. When I started ...
5
votes
2answers
270 views

C++ users proposals

I believe I have some good suggestions to improve the C++ language. Who should I contact to discuss this? Do I have the chance to be heard, especially if I'm not a renowned expert?
0
votes
2answers
1k views

Are there any languages that have both high- and low-level facilities? [closed]

Are there any languages that have both high- and low-level facilities? If not, is it feasible to create one? Why or why not? In theory, it would be very helpful to have a programming language that ...
2
votes
7answers
234 views

What's a good way to prepare for this course titled “Programming Language Security”?

I have a course with the following description: The purpose of this course is the study of programming language security features and languages designed to support it explicitly. Static and ...
7
votes
3answers
836 views

What common programming problems are best solved by using prototypes and closures?

As much as I understand both concepts, I can't see how can I take advantage of JavaScript's closures and prototypes aside from using them for creating instantiable and/or encapsulated class-like ...
4
votes
3answers
476 views

Does Java have automatic memory management?

I have started learning about C# and I come to what is called 'Automatic memory management' or 'Garbage collectors' and I'm wondering if Java contains something like this as well? and if it does, does ...
15
votes
4answers
2k views

Is Java instanceof operator considered reflection, and what defines reflection?

I had a discussion with a coworker today, whether usage of using the Java operator instanceof is a kind of reflection. And the discussion quickly evolved into what actually defines reflection. So, ...
2
votes
3answers
239 views

Can applications override the OS keyboard layout?

We have in-house .NET application, which can be used across multiple languages. Lately we received a strange bug that is when our application is being used, user was unable to enter accent characters ...
6
votes
5answers
426 views

Java without implementation inheritance

In a recent video on Java, Joshua Bloch states at 4 minutes 20 seconds into the video: And then there's inheritance, and that was a marketing necessity. You know, we can argue whether you really ...
6
votes
3answers
377 views

Is there really a choice of the best language for a specific project?

Programmers.SE has plenty of questions of beginner programmers asking if they must use a specific language or another one in their daily work, or if they must learn a language or another. Those ...
2
votes
2answers
104 views

Problem understanding what “Exporting functions means”

I cannot understand what the following means "ISAPI applications can be written using any language which allows the export of standard C functions, for instance C, C++, Delphi." What is "allowing ...
11
votes
2answers
498 views

How easy should a language development framework be to use?

This is part of a series of questions which focuses on a project called the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. Another ...
6
votes
3answers
432 views

Is structural typing in a hierarchical model necessary?

This is part of a series of questions which focuses on a project called the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. Another ...
4
votes
3answers
751 views

Unusual languages for numerical analysis [closed]

This question is inspired by these questions (here and here). I do mostly numerical work, and I usually use C++, Fortran, and occasionally Numpy. I'm trying to broaden my horizons, and I'm looking ...
3
votes
1answer
172 views

Will the portions of Boost that are incorporated into the new C++ standard continue to be developed?

What will happen to the portions of the Boost library that are incorporated into the new C++ standard? Will they continue to evolve and any changes be reincorporated into the standard which follows ...
0
votes
4answers
559 views

About languages strongly typed with late binding, do they make sense?

I never learnt anything about VB6 (and I dont want to) but I wanted to search for bad things in computer software, so my first though was VB6. So for example, VB6 was strongly typed with late ...
2
votes
9answers
709 views

The New Programming Language & BCL for the Cloud

Let's say you need to implement a new programming language and BCL designed specifically for operating in the cloud (it won't be used on client machines ever). It should be optimized for cloud ...
11
votes
10answers
1k views

Why dynamically typed languages do not let the developer specify the type?

The dynamically typed languages I know never let the developers specify the types of variables, or at least have a very limited support for that. JavaScript, for example, doesn't provide any ...
6
votes
1answer
4k views

A combined if/switch statement syntax with exception handling for a C#-inspired language

It is sometimes necessary to try/catch exceptions inside the "if" condition, but not the body that follows. In C#, this is really rather cumbersome, requiring locals and code that isn't entirely ...