Which keyword in your language would you like to get rid of?

Programming languages ​​vary greatly in the syntax they use. Syntax is a collection of keywords that we have to deal with in every language. But out of gut feeling, not all of these keywords seem to be wisely chosen. One reason might be that a word is a keyword that you would like to use frequently in your code, but you cannot use it. In my case, even I cannot digest a few keywords, so I ignore the language until an error appears that remembers my stubbornness.

Do you have similar things? What will be your first removal of a keyword in your language?

Update: Not a word surprises me, but I don't get it. A comment would be helpful.

-1


a source to share


8 answers


I would exclude goto from Java. Or force it to actually do something.



+3


a source


In Javascript, "c" should go.



+2


a source


I would set the static keyword in ANSI C. Now that means two different things. A static variable does not change between successful calls to the function in which it is declared. A static function is visible only within one file.

+2


a source


I would like to get rid of the if / then / else from Haskell and use a function instead.

+2


a source


I suggest a keyword that has already been removed: the Python print keyword, which has been replaced with a regular function since Python 3.0, allowing it to be handled like all other functions (walked around, etc.).

Printing is a function .

+1


a source


I would remove the lock from C # and instead introduce the Lock class instead of semantics:

using (myLock.Enter())
{
    // Critical section
}

      

The current blocking ability for any class looks pretty strange to me.

+1


a source


From C ++ and C # I would rule out goto

0


a source


I am assigning a switch statement in C ++. This is a terrible abuse, the if-ladder is almost always clearer and should be equally well optimized by the smart compiler (if only we had smart compilers), and for the include type, that's what virtual functions are for.

0


a source







All Articles