r/programminghumor • • Jan 16 '25

Semantic code

Post image
7.6k Upvotes

130 comments sorted by

View all comments

337

u/nog642 Jan 16 '25

"otherwise" means "else", not "else if"

91

u/NumeroSMG69 Jan 16 '25

Otif

0

u/[deleted] Jan 16 '25

[deleted]

10

u/B_bI_L Jan 17 '25

if following provided information is truthy (variable) {
politelly tell gentelmen "Hello ${name}"
// (info) (log) (stdout)
}
otherwise under following circumstances (var2) {
increment not gently a by the value of b
// gently would mean moving result to new variable instead of modifing old
}

2

u/mike-manley Jan 19 '25

Gentlemen it is with great pleasure to inform you, the requested action will be executed expeditiously.

→ More replies (1)
→ More replies (1)

79

u/GPeaTea Jan 16 '25

what about "otherwise then we shall"

33

u/Borfis Jan 16 '25

too terse

"otherwise, notwithstanding preceding conditions' verity, then we shall, in due course"

4

u/nog642 Jan 16 '25

It is not "notwithstanding preceding conditions". The preceding conditions do matter, if any of them are true then you don't execute the else if branch.

3

u/FBI_911_Inv Jan 17 '25

In the event that circumstances diverge from the aforementioned scenario, and irrespective of the unequivocal truthfulness of the previously delineated stipulations, we shall, in a timely and orderly manner, take appropriate actions in the foreseeable future.

→ More replies (1)

6

u/renome Jan 16 '25
otherwise should {
    semanticCode === false
} bloodyKill(self)

11

u/MhmdMC_ Jan 16 '25

Remove then. Else then we shall makes no sense.

3

u/Kokuswolf Jan 16 '25

Don't say that to loud, Perl could hear it.

2

u/Morphinepill Jan 16 '25

“Perhaps if you’d accept this alternative option”

2

u/nog642 Jan 16 '25

That still just means "else". Imagine putting the condition in that sentence, it doesn't make sense.

"if x == 5, do this, otherwise then we shall x == 6, do that". Doesn't make sense.

→ More replies (5)

18

u/ArduennSchwartzman Jan 16 '25

Proposal for new semantic: 'nonetheless':

if condition then do something1
nonetheless do something2

5

u/DrFloyd5 Jan 16 '25

That would just be an end if.

4

u/Necessary-Signal-715 Jan 16 '25

The closest keyword to the semantics of nonetheless (as in "regardless of what happened previously") would probably be finally

→ More replies (2)

5

u/bearwood_forest Jan 16 '25

Well old chap

Alright then

Otherwise

Unless

Likewise try, catch/except:

Golly good

Spot of bother

3

u/DrFloyd5 Jan 16 '25

Oh man “unless” would be a nightmare.

If (x==blue)
  A.thing()
Unless(x==red)
  Another.thing()

when x is green another thing is called.

2

u/bluesman-koala Jan 18 '25

Welcome to perl

→ More replies (3)

3

u/[deleted] Jan 16 '25

Otherwhen

3

u/legolas-mc Jan 16 '25

otherwise if

2

u/Pengwin0 Jan 16 '25

otherwise, in the happenstance that

→ More replies (10)