Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "elseif"
-
A guy that just did not know how to code. He had years and years of experience (?), but DID NOT KNOW HOW TO CODE. He was given a simple task, spent weeks on it and what came out was usually 60 lines of "if, elseif, elsif....else".
He was given several warnings, and eventually "voluntarily" left the company.
I still get screenshots of his code sent by one of my ex-colleagues who's still there when he stumbles across it.15 -
Wow I hate VBA... What a fucking shitty syntax:
For x in y
...
Next x
If x Then
...
ElseIf y Then
...
End If
While z
...
Wend
WTF even is this? Wend? WTH! Why can't you just use a End While? For fuck sake I hate this language31 -
What really grinds my gears.
When a co-worker gives me feedback from a review of my code be like "you should use if..elseif..else instead of switch, because it performs much better.
in this case performing much better means it is only 25 pikosecond instead of 30 pikosecond in a function which is called apprx. 3 times a month in production *facepalm*
I'm always with "let's get maximum performance from our software", but c'mon... really?!???4 -
Else if, elif, elseif, if else garrgghj. I can never remember what it is in whatever language I happen to use...13
-
In PHP, this:
<?php
if($a < $b) {
$c = 'W';
} elseif($a > $b) {
$c = 'E';
} else {
$c = ' ';
}
?>
Does the same as this:
<?php
$c = ' WE'[$c<=>$a];
?>
How cool is that?!? xD14 -
That moment where you see code of someone who riddles their code with nested if-else and if-elseif statements.
I don't remember writing an else statement for years. It almost always can be avoided (and the rare cases where it makes sense I prefer the switch statement).
Yet I never grasp why people do:
```
if(someCondition) {
// huge nested code block
} else {
throw new Error();
}
```
Instead of
```
if (!someCondition) {
throw new Error();
}
// continue in the normal scope
```
And then we have experts that like doing:
```
if(someCondition) {
if (bar) {
$foo = 'narf';
} else {
$foo = 'poit';
}
// huge code block
if($foo == 'narf') {
if(yetAntherCondition) {
// huge code block
} else {
throw new Error();
}
// huge code block
} else {
throw new Error();
}
} else {
throw new Error();
}
```
Help!
If ever was to design a programming language, I'd forbid the `else` and `elseif` keywords. I have yet to find an instance where I could not replace some `else` by either a guard or an early return or introducing some polymorphism.1 -
Someone tell me should I just give up because I'm stupid and simple shit escapes me or tell me bro calm the fuck down the guy is full of shit...
Dude says he can't verify 3rd statement in a nested IF - elseif logic because the third check for a false condition is the True condition in the first 2 statements.
So
If (mode) = manual and then
Data(g) /= Status1
Or else Data(g) = Invalid
Then
Do this thing that sounds cool
Elsif
Data(g) = Status1
And then Data(g) /= Invalid
Then
Do something else equally cool
Elsif (mode) /= manual
and then Data(g) /= Invalid
and then Data(g) /= Status1
Then
Do some less cool stuff
end if4 -
I think I'm just starting to lose my patience...
For some fucking reason, the fucking "POST" gets outputted on the GET request, and the GET "elseif" doesn't show up.
W.
T.
FFFFFFFFFFFFFFFFFFFFFFFFFFFF!!!11 -
$dow = date('l');
if($dow == 'Monday') {
$project = $_GET['project'];
while($dow !== 'Friday') {
exec('buildProject');
$dow = date('l');
}
exec('submitProject');
execInBackground('celebrate');
while(!isset($project_approval) {
exec('wait');
}
if($_GET@['project_approval'] == 'approved') {
exec('celebrateGoHome');
}
elseif($_GET['project_approval'] == 'nevermind') {
exec('burnItAllDown');
}
else{
exec('hangHeadGoHome');
}
}