RSSAmplifier

soc.me · Sep 21, 2019

Language Design: Unary Operators are Unnecessary

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

TL;DR: Unary operators are a waste of a language’s complexity budget. Replace them with methods. Many languages provide unary prefix operators – symbols placed in front of the value they apply to – such as: ! : Logical complement (on booleans) ~ : Bitwise complement (on numbers) - : Numeric complement (on numbers) + : useless (on numbers) Except for reasons of tradition and familiarity, their…

Read on /languages/unary-operators-are-unnecessary.html

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.