10 points

What’s wrong with “else”

permalink
report
reply
51 points

It’s not ifn't

permalink
report
parent
reply
19 points

*it’sn’t

permalink
report
parent
reply
5 points

I’dn’t’ve said it like that.

permalink
report
parent
reply
1 point

Perchance

permalink
report
parent
reply
0 points

^This

OP raises a valid point

permalink
report
parent
reply
6 points

if(condition) {#block never used} else {#actually do a thing}

Vs

ifn't(condition) {#actually do a thing}

Vs

if!(condition) {#actually do a thing}

permalink
report
parent
reply
0 points

vs

if (not condition) {#actually do a thing}

permalink
report
parent
reply
3 points

Cannot start a statement with else. One can with ifn’t. There is a new thing where we don’t branch (which is a separate discussion).

Or am I missing the joke…

permalink
report
parent
reply
53 points
Deleted by creator
permalink
report
reply
67 points

unlessn’t

permalink
report
parent
reply
28 points

I’m sorry, I hate the “unless” so much

permalink
report
parent
reply
4 points

At one of my first jobs, I was tasked to rewrite a bunch of legacy Perl scripts in Python and the unless lines always made me trip up. I don’t know why but it really messed with my mental flow when reading Perl code

permalink
report
parent
reply
10 points

Basic used “else”.

It’s nice. “if”, “then”, and “else”. I spent a year programming a shitty roulette game on an Apple 2e back in high school. I still remember the joy of using if/then/else paired with goto to make a horrible mess of spaghetti logic.

But yeah, “else” is nice.

permalink
report
parent
reply
2 points

Let’s just scrap every language except various forms of BASIC.

permalink
report
parent
reply
4 points

Please God, no. I had to unravel terminal scripting code that was written in some propriety BASIC language with basically no documentation.

Took me a chunk of time trying to figure out how it worked before I made the realization that it was BASIC

permalink
report
parent
reply
7 points
*

Using a standalone ‘else’ would tickle my brain in the same nice way that being able to declare a variable inside an ‘if’ statement as if it were a ‘for’ loop (which you can do in modern C++) does.

permalink
report
parent
reply
2 points

Or a rust “if let”

permalink
report
parent
reply
1 point

Block scoped variables are bad?

permalink
report
parent
reply
2 points

Many languages let you scope variables.

In c# you can create an arbitrary scope to declare variables in. Most likely in others as well.

permalink
report
parent
reply
5 points

The Perl version of it is even greater!

permalink
report
parent
reply
7 points

I haven’t written any Ruby for years, but I still praise it in every conversation I have regarding programming languages. It’s basically a much simpler Python, with some design ideas that are both beautiful and deeply strange.

permalink
report
parent
reply
3 points

Ruby was designed to evoke joy and they absolutely succeeded. Usually, programming is mostly a means to an end to me. But using Ruby just feels so amazing, it’s almost impossible to even describe to somebody who has never used it before.

permalink
report
parent
reply

reminds me of #ifndef instead of #if !defined(...)

permalink
report
reply
106 points

Please God let this be a humorous post that somehow does not also find a way to manage to come true…

permalink
report
reply
90 points
*

I would have bought it if they said ifnot instead, it’s the same number of characters and wouldn’t require a major parser overhaul to support keywords with a ’ in the name.

permalink
report
parent
reply
15 points

Yeah, to be clear, I don’t like it, I don’t like it one bit:-P.

permalink
report
parent
reply
4 points

If not anybody have time for that.

permalink
report
parent
reply
45 points

i mean, “unless” tends to be the usual term for an “if not” keyword in languages that implement such a thing

permalink
report
parent
reply
21 points

Which is awful and incredibly confusing. I hate ruby

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
1 point

Gulp…

link]

Also, just for fun, the prequel:

permalink
report
parent
reply
8 points

i assume “ifnot” wasn’t edgy enough and makes inferior noises on custom mechanical keyboards? /s

permalink
report
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 5.2K

    Monthly active users

  • 1.1K

    Posts

  • 38K

    Comments