In this post I will keep a list of things I would like changed in languages, frameworks and formats.
Python
Use multi-method dispatch
Allow Functions not to use brackets() like in Ruby
Add proper range like in Ruby
Add do … while loop
Allow self-defaults in the method declaration, example :
def method(self,val=self.attr1) :
.........
instead of :
def method(self,val=None) :
if val is None : val = self.attr1
.........
Java
Create a synonym for System.out.println(), just use say()
On some places the Parser could be more clever and allow us to skip using the dot-comma ;
Allow if()-like one-line methods. Example from good to bad :
- public int method(int v) v * v;
- public int method(int v) return v * v
- public int method(int v) { v * v }
- public int method(int v) { return v * v }
- public int method(int v) { return v * v; }
Allow Python like optional named arguments it is the damn 21st century !! Those variadic arguments are crock.
Reclaim back single quotes for String
Invent groovy.
Allow in-scope-up declaration, code example is worth a hundred words. F.e. we add the let keyword to Java and …
try {
let String s = "abc";
}
should be equivalent to this :
String s = null;
try {
s = "abc";
}
JavaScript
Create synonymous of function() => fun()
console.log(), really !! why not system.out.console.log() then we can all switch to Java and rejoice the brevity.
Ruby
Hmm ….
“Perl6” aka Raku
Finish it already ….
Lisp
Use curly brackets {}, instead of () and call the language Curly Lisp ………. I’m messing with you.
Prolog
Change the rule that variables have to start with UpperCase. But I don’t know with what ??
XML
Call on Tanos to remove it from the Internet 😉
JSON
Allow the use of unquoted “key” : “value”
All languages
All languages should have a command line -flag and configuration rules to exclude and physically remove from the program or convert to nope instruction specific calls.
F.e. nope() normally acts like a print(), but when the flag -nope is used the call is not even in the program.
Add Unification, like in Prolog. All languages are in a hurry to copy functional style primitives and here is this gem waiting to be used.
Add __DATA__ and __END__ sections like in Perl
Adopt Symbols like in Ruby
All languages should immediately drop their version of switch/case in favor of Raku given/when
Standardize on a single spec for templating/formatting strings across as much languages as possible, call it say() and be done with it.
Add BEGIN, END, FIRST, LAST hook to the program and code block …. AWK here we come. Of course the obligatory break and continue should be there too.
To my knowledge only Perl/Raku and Ruby has those.
What do you want to change !!