The 'else' keyword is probably a literal translation from German (2020) (github.com)

46 points by theanonymousone 4 days ago

25 comments:

by divbzero 42 minutes ago

‘Else’ is not commonly used in English today but the meaning does fit. From Webster’s (1913):

Else, adverb or conjunction

1. Besides; except that mentioned; in addition; as, nowhere else; no one else.

2. Otherwise; in the other, or the contrary, case; if the facts were different.

“For thou desirest not sacrifice; else would I give it.” – Ps. li. 16.

After ‘or’, else is sometimes used expletively, as simply noting an alternative. “Will you give thanks, … or else shall I?” – Shak.

by stkdump an hour ago

The modern universal keywords if, else, for and while are good because they are fairly short and thus quick to type.

by divbzero 30 minutes ago

Yes, otherwise is more natural but less terse.

by autoexec 17 minutes ago

"or else" works too but that's still three extra characters

by akersten an hour ago

> I can't use "else" as a conjunction in normal speech, only in computer programs.

sure you can. who's going to stop you?

by wvenable an hour ago

Hurry up, else we'll be late. You'd better leave now, else you'll miss the bus. Do what I say, else there'll be trouble.

by mondobe 12 minutes ago

Perhaps after the robot uprising... https://www.smbc-comics.com/comic/the-program

by RachelF an hour ago

someone else ;-)

by pram an hour ago

Don’t even get me started on “elif”

by tomrod 11 minutes ago

I like elif. It means exactly what I want it to mean!

by 33 minutes ago
[deleted]
by fcarraldo an hour ago

If something were to be true, then foo.

Or if this other thing were to be true, then bar.

If it’s something else, then baz.

by zacharyvoase an hour ago

it was probably a rote translation of the German word ‘sonst’

by bitwize an hour ago

No. English has used else to mean "otherwise" since before computers came along. Wiktionary offers this quote from Call of the Wild (1903):

"He had never seen dogs fight as these wolfish creatures fought, and his first experience taught him an unforgetable lesson. It is true, it was a vicarious experience, else he would not have lived to profit by it."

https://en.wiktionary.org/wiki/else#Conjunction

There's also "or else", as made famous in crime dramas: "Meet me by the docks at midnight. Bring the money. Come alone. No cops... or else!" But in other usage it can of course be followed by something. "He had to get to work on time, or else he might be fired."

by krautsauer 18 minutes ago

"or else" is right in the second image, and it's clearly not "else".

Even if it hasn't been invented as the author claims, the question of who used it in code first is a valid one, right?

by well_actulily 5 minutes ago

[dead]

by saintfire an hour ago

Article states else is archiac English but later says someone called it ignorantly incorrect English and suggested using "or".

Ive always assumed it was effectively "otherwise" but shortened to "or else" -> "else".

Given the alternative to use "or" as the first pushback I feel that acts as confirmation. I prefer else because "or" has implications in boolean and bitwise logic that else doesn't.

by Frieren an hour ago

If ... then ... otherwise ...

Fixed!

by hcs an hour ago

if ... then ... neht ... fi

by voidmoth an hour ago

[dead]

by wewewedxfgdf 2 hours ago

The English language origin is from programming if/then/else

by dboreham 41 minutes ago

Very not true.

by LocalH 35 minutes ago

what

by xdennis an hour ago

> I can't use "else" as a conjunction in normal speech, only in computer programs.

Not true. Here's an example from 1876 in which "else" is used as a conjunction.

> My brother is poor, and I want to look as much like him as I can, else he may feel distant from me.

-- George Eliot ( https://www.victorianlondon.org/etexts/eliot/deronda-0047.sh... )

---

Here's an example of "if ... else" from the 1914 translation of Crime and Punishment ( https://en.wikisource.org/wiki/Crime_and_Punishment/Part_IV/... ):

> Perhaps it will all come back, but now if you love me, give me up . . . else I shall begin to hate you, I feel it.

Data from: Hacker News, provided by Hacker News (unofficial) API