WorstPlans.com updates every Monday!

Your weekly source for terrible plans and ideas!

Tag: perl

Throw away your current barbaric programming language! Programming Emoji is the future of computation.

Background:

Essentially all major programming languages exclusively use keywords written in English. (For a couple of exceptions, see the addendum at the end.)

But this doesn’t have to be the case!

Proposal:

By using symbols instead of words, we can convey a concept both more concisely and more easily across languages.

See below for a few suggested changes:

while-true

Fig 1: This image of a snake eating its own tail is a much more visceral and obvious representation of an endless cycle than the words “WHILE TRUE.”

if-else

Fig 2: “IF” and “ELSE” have specific meanings in English. But “Else” is also a Scandinavian name! By using these unambiguous symbols, we avoid any existing meanings that might confuse people.

data-types

Fig 3: Data types (“integer” / “floating point number” / “text string”) can be replaced by these intuitive images instead. This also avoids the issue of having multiple synonyms for each type. For example, a non-integer number could be called a “float,” a “real,” a “double,” etc.—but there’s only ONE symbol to represent this concept.

 

foreach

Fig 4: Some languages use “for” to create a loop, while others use “foreach” (or “forEach,” or “for (item) in (set)”). To prevent confusion, we can standardize on a single symbol (above) to convey the idea of iteration through a loo.

Conclusion:

Don’t write another line of code in your old-fashioned text-based programming language! Programming emoji is the future.

PROS: More easily seen at small font sizes. Works across languages, and prevents any misunderstanding arising from a word having an existing unrelated-to-programming meaning (e.g. “float” meaning “to rise to the surface of water” in addition to “a ‘floating point’ number”).

CONS: Requires new custom fonts and/or Emoji support.

programming-emoji

Fig 5: An extended set of proposed replacements for basic programming terms. Color is optional, but recommended.

Addendum:

Here are a couple of programming languages that can make use of non-ASCII symbols:

  • APL,” a language created in 1964, is well known for making use of a special set of symbols. Here is an example from Wikipedia: (~RR∘.×R)/R1ιR . It is actually possible to order a keyboard with these symbols printed right on the key caps!
  • Perl 6 supports numerical characters like “” (a fraction) or “” (a Roman numeral), as documented here.

 

 

How to destroy a programming language (or natural language?) that you don’t like in one easy step with three difficult sub-steps

The issue:

Sometimes, you don’t like a programming language (like Perl or Python), or a natural language (like English or Spanish).

You might have your reasons, or maybe not—maybe you just want to destroy it completely for no reason at all!

 

Proposal: Here’s a simple way to go about wreaking destruction on the language in question while leaving no one the wiser:

  1. Propose a “new and improved” version of the language. Example: “Perl 6 will be so much better than Perl 5!” Or: “Esperanto: it’s like English, but the spelling is much more regular!”
    1. Make sure it’s very similar at first glance, but annoyingly incompatible in key regards.
    2. Next, make sure there are a few bonus features, but not enough to actually justify the switching cost.
  2. For programming languages, start creating software in this language. For natural languages, start creating novels, newspapers, and works of art in this language.
  3. Make sure there is a HUGE delay in switching; “everyone should learn English 2.0, but it isn’t ready quite yet… so in the meantime, English 1.0 is deprecated.”
  4. Finally, you just have to wait! Instead of switching to the “upgraded” language, people will probably switch to an entirely different one.

 

Great examples in history:

  • Successful destruction: Perl 5 –> Perl 6
  • To be determined: Python 2 –> Python 3
  • Failure: English –> Esperanto

PROS: Lets you surreptitiously destroy the language that has drawn your wrath.

CONS: None!