What do you want was automatically in your favorite programming language?

As a programmer, I often look at some features of the language that I am currently using, and I think to myself: "This is quite difficult for the programmer to do, and it could be taken care of automatically."

One example of such a function is memory management, which for some time was automatic in different languages. While memory management is not so difficult to do manually most of the time, doing it completely completely through the application without memory leak is extremely difficult. Automation has simplified the work so that programmers can focus on more important issues.

Are there any features that you think should be automated since the reward / difficulty ratio is too low (say, for example, concurrency)?

This question is intended to brainstorm about what the future of programming can be and what languages ​​can be done for us, so that we focus on more important tasks, so please post your wishes even if you don’t think that automation is practical / doable. Good answers point to things that are really hard to do in many languages, unlike monolingual pets.

+6
language-agnostic programming-languages theory language-features
source share
16 answers

No matter what language can automatically do for me, I want to make a way for myself.

+9
source share

Parallel programming / parallelism , which is (semi-) automated, against fiddling with threads, callbacks, and synchronization. Possibility of parallelization for loops, such as:

Parallel.ForEach(fooList, item => { item.PerformLongTask(); } 

only consists of winning.

However, some languages ​​already support this functionality. Notably, F # has asynchronous workflows. Starting to release .NET 4.0, the Parallel Extensions library will make concurrency much easier in C # and VB.NET. I believe that Python also has some concurrency library, although I personally have not used it.

What would be nice is that parallelism is fully automated in purely functional languages, that is, you do not need to change your code even slightly and automatically let it work almost optimally on several cores. Please note that this can only be done with purely functional languages ​​(such as Haskell, but not CAML / F #). However, constructs such as the example above would be very convenient for automating parallelism in object-oriented and other languages.

I would suggest that in the near future libraries, design patterns, and even entire programming languages ​​that focus on simple and high-level support for parallelism will increasingly be distributed, as desktop computers begin to move from 2 cores to 4 and then 8 cores and the advantage of automated concurrency It becomes much more obvious.

+7
source share
 exec("Build a system to keep the customer happy, based on requirements.txt"); 
+5
source share

In Java, I would like to use a keyword that will make the whole class immutable.

eg.

 public immutable class Xyz { } 

And the compiler would warn me if immutability conditions were violated.

+5
source share

In Java, create beans with fewer words.

For example:

 bean Student { String name; int id; type1 property1; type2 property2; } 

and this will create private bean fields, default accessors, toString, hashCode, equals, etc.

+5
source share

Concurrency. That was my main idea when asking this question. This over time becomes more and more important, as current processors already have up to 8 logical cores (4 cores + hyperthreading), and 12 logical cores will appear in a few months. In the future, we will have many worms at our disposal, but most programmable languages ​​will only make it easier for us to use one at a time.

The Threads + Synchronization model, which is displayed by most programming languages, is extremely low and very close to what the processor does. For me, the current level of concurrency support is roughly equivalent to C memory support: not integrated, but some things can be delegated to the OS (malloc, free).

I want some language to come up with a suitable abstraction that will either simplify the Threads + Synchronization model or just completely hide it for us (just like automatic memory management makes a good old malloc / free deprecated in Java).

Some functional languages, such as Erlang, have a reputation for good support for multithreading, but the brain switch required for functional programming does not really make all tests easier.

+4
source share

.Net:

A warning when manipulating strings with methods such as Replace and not returning a value (new string) to a variable , because if you don't know that the string is immutable, this problem will upset you.

+4
source share

In C ++, enter the output for variable declarations, so I don't need to write

 for (vector<some_longwinded_type>::const_iterator i = v.begin(); i != v.end(); ++i) { ... } 

Fortunately, this happens in C ++ 1x as auto :

 for (auto i = v.begin(); i != v.end(); ++i) { ... } 
+2
source share

Coffee. I mean, the language is called Java, so it should be able to make my coffee! I hate getting up from programming, going to a coffee pot, and getting to know someone from marketing took the last goblet and didn't make another pot.

+2
source share

Persistence, it seems to me, we write too much code to cope with persistence, when it really should be a configuration problem.

+2
source share

In C ++, listing in a string.

In Ada, the language defines the image attribute of an enumerated type as a function that returns a string corresponding to the textual representation of the enumeration value.

C ++ does not provide such a clean object. To get an approximate equivalent, several lines of the very secret macro black art preprocessor are required.

+1
source share

For languages ​​that provide operator overloading, provide automatically generated overloads for symmetric operations when only one operation is defined. For example, if a programmer provides an equality operator but not an inequality operator, a language can easily generate it. In C ++, the same could be done for copy constructors and assignment operators.

I think that automatically creating one side of a symmetric operation would be nice. Of course, I would definitely like to explicitly say not to do this when necessary. I suppose that implementing both sides with one of them would be private and empty could do the job.

0
source share

All that LINQ does. C # messed up with me, and now it's hard for me to do anything with collections in any other language. In Python, I often use lists, but they are not as powerful as LINQ. I did not find another language that simplifies working with collections, as in C #.

0
source share

In Visual Studio, I want “Delete Unused Operations” to be executed in all project files. I find it a significant waste of time to manually open each individual file and invoke this file-based operation.

0
source share

In terms of dynamic languages, I would like to see better tool support. Steve Yegg has a great post . For example, there are many cases where a tool can look into different code paths and determine if methods or functions exist and provide the smoke test compiler equivalent. Obviously, if you use a lot of really dynamic code, this will not work, but the fact is that you are probably not, so it would be nice if Python, say, would tell you that .ToLowerCase () would not was a valid function at compile time, and did not wait until you click on the else clause.

 s = "a Mixed Case String" if True: s = s.lower() else: s = s.ToLowerCase() 
0
source share

Easy: initialize variables in C / C ++, as C # does. This would save several debugging sessions in other people's code.

Of course, there would be a keyword unless you specifically want to initialize var.

 noinit float myVal; // undefined float my2ndVal; // 0.0f 
0
source share

All Articles