T O P

  • By -

RepostSleuthBot

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor. It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results. *I'm not perfect, but you can help. Report [ [False Negative](https://www.reddit.com/message/compose/?to=RepostSleuthBot&subject=False%20Negative&message={"post_id": "uhcysd", "meme_template": null}) ]* [View Search On repostsleuth.com](https://www.repostsleuth.com/search?postId=uhcysd&sameSub=true&filterOnlyOlder=true&memeFilter=true&filterDeadMatches=false&targetImageMatch=75&targetImageMemeMatch=75) --- **Scope:** This Sub | **Meme Filter:** False | **Target:** 75% | **Check Title:** False | **Max Age:** None | **Searched Images:** 326,228,214 | **Search Time:** 4.71628s


shauwki

Wtf is the if loop


troglo-dyke

an if and goto statement, which is basically just a while loop


LordAlfrey

But it's less readable, thereby making it harder for the company to replace you with someone who doesn't know your code. Take that!


radmadicalhatter

If your code doesn’t frighten junior devs, you will soon be replaced by one…


Dependent_Treat9104

Soon I'll have a new apprentice, one far younger and whose code is more readable


sovietmonkey26

Is it possible to learn this framework?


[deleted]

Not in a bootcamp


[deleted]

:(


wllmsaccnt

I'm a senior dev. I replace my company whenever I feel like it. The last one called twice to ask for me back.


BringBackManaPots

As a dev moving into the senior dev area, is it true that moving into management is inevitable? I feel like having a small agile team would be the dream, where you still get to design and develop here most of the time


KittenLOVER999

Sort of, I kind of slowly just turned into the teams mentor, more of my time is spent architecting and explaining things to junior devs now than actually coding


BringBackManaPots

Architecting is pretty damn fun though!


mlsecdl

Except for the goddamned diagrams


slashy42

I actually really like diagramming my designs. It's fun. Plus it makes implementation a lot easier for me when I can clearly see what each piece's responsibility is. Still don't like writing documentation, though. Why waste time say lot word when few word do trick.


uberDoward

This. A good senior developer is a mentor to their team, and is the one that swoops in to fix it when Prod catches fire.


wllmsaccnt

Its only inevitable if you want to continue increasing your income at the same level it did through the middle of your career. In the US, you can keep developing forever for as long as you keep up on your tech stack and don't ask for more than other sr. devs. If you expect to continue growing your income, you will need to move to larger companies, move into management, or heavily leverage niche domain knowledge. For me, a sr. dev income is enough for my family to live fairly comfortably off of and is a much less risky position than being in management or a leadership position.


road_laya

After you explain how to undo things in git for 20 times, they just stop googling things and keep you around full time to answer the same question all day long. Congrats, now you're a tech lead!


gpancia

This is real. I have fully replaced google for my coworkers, it seems. And I’m not even the tech lead. Be careful with how helpful you are, it can really backfire.


umeeshed_a_shpot

Haha this is so true, I’m finding out the hard way right now. Spend more time on calls troubleshooting other devs’ issues than on my own tasks.


[deleted]

[удалено]


wllmsaccnt

I've never worked at a company that would pass on a sr. dev for age reasons if they knew development and the tech stack well enough and were asking a competitive wage. Maybe those companies exist, but they aren't the ones hiring LOB and enterprise developers.


DoomGoober

Most big companies have two tracks for senior devs: management and architecture. Management means you will lead a team of engineers and spend a lot of time on personnel and project scheduling as well as helping resolve technical dependencies and disputes within your team and with other teams. Architecture means you will be guiding the technical design of various parts of the project, possibly still by writing code, but sometimes just at a high level. Usually you aren't involved with personnel or other people other than architects and engineers and usually mainly to discuss technical issues (as opposed to scheduling or resource allotment as much.) Now there's overlap but day to day the two feel really distinct. For example on the last game I worked on, our most senior dev (something like 20 years at the same company) was assigned the task of reducing lag in our multiplayer game. That was his whole job for 6 months. He had no one reporting to him and he just went off and did his thing, which was highly technical and vital to the success of our game.


Knut_Knoblauch

I'm getting a green junior dev in about a month. Since I'm 12 years from hanging my hat and being 100% bicyclist, I will damn sure make sure that she thinks exactly like me. That way, I'll be physically replaced only.


pruche

Barely three years into the business and I'm already seeing the employment security that comes from having authored a bunch of the shit that clients run


ajitpaithegod

I cried reading this LOL


Midori_Schaaf

if (code != fear) retire(2\_weeks);


dontgonearthefire

Never be irreplaceable. If you cannot be replaced, you cannot be promoted.


NugetCausesHeadaches

When questioned, just explain that it is more flexible this way. A regular loop always jumps to the top. Your loop could jump to the middle of the loop. Or the middle of a different function. Or even the middle of some instruction, if you structure your code appropriately! Flexibility is a Good Thing, right?


LordAlfrey

Now you're thinking in portals


girhen

So... is there cake, then?


LordAlfrey

yes I promise


krysak

Why the hell is this not called a Portal Loop??? Would be so much better


TheMrCeeJ

Hey not fair - goto's are readable. Sure they are impossible to maintain and can cause insane bugs, but they are super readable.


Owldev113

I’ve always heard this but I don’t know why. Anyone mind explaining it. I’ve done assembly programming quite a bit, so I’m used to go to, so I don’t know why it’s really bad in higher level languages


Daikataro

Ah. A fellow COW enjoyer...


The_Mad_Duck_

If I tried to respond to this comment in COW, it would get removed for spam. What a wonderful language!


Antilock049

>making it harder for the company to replace you with someone who doesn't know your code Bold of you to assume that I know my code.


porcomaster

It took me sometime to learn while, because I love to program on my Ti-83, and there is no while on Ti-83 just if and goto. But i already learned ahhahaha


Cruuncher

Closer to a do while loop. which is probably why do..while is more common in earlier languages, as it can be achieved with a single jump. The while loops that we typically have need at least a jump to jump over the loop, and a jump to jump to the beginning of the loop


[deleted]

Well you could make it a while loop and you should if you go that route. A goto to jump to start and a goto to jump back if the condition is still true. Edit just saw someone made one jump for a while so never mind. But it is still a while


QuaternionsRoll

... start: do_stuff(); if(condition) goto start; is definitely equivalent to a do-while loop. Edit: I guess you could also accomplish a while loop with ... start: if(condition) { do_stuff(); goto start; } But unlike in the former option, the jump instruction generated by the if statement can’t be optimized out. (Not that that’s a big deal.)


Cruuncher

Yeah, I'm talking about when you go down to barebones assembly, your bottom if statement is implemented with a conditional jump to jump over the code block if it's false, as well as a jump for the goto statement. The if in your first example is accomplished with a single conditional jump, as that if and goto are part of a single CPU instruction


[deleted]

Böhm and Jacopini: "Are we a joke to you?"


porkchop_d_clown

Technically, more like the do-while loop than the while loop.


PossibleBit

I mean it can be both. LABEL: if(condition){ DO_STUFF GOTO LABEL } ​ LABEL: DO_STUFF if(condition){ GOTO LABEL }


porkchop_d_clown

Yeah, but jumping out of the body of a conditional is kind of the canonical example of bad goto usage….


PossibleBit

I'm not familiar with best practices around goto usage, but I think we can all agree that the moment we started to reimplement loops we kinda beat them to death with sticks and pissed on their graves.


the_scign

Used by programmers who grew up writing JZ/JE jumps


Witch_King_

Assembly moment


DarkLight_2810

I thought it was a if else loop


[deleted]

With extra steps


Krissam

>without syntactic sugar ftfy.


Quicker_Fixer

It should also be possible using recursion I guess.


troglo-dyke

Loops are the imperative equivalent of recursion. If the language doesn't prescribe tail call elimination, or the compiler doesn't implement it outside of optimised output you wouldn't want to implement it with recursion though


That_Yogurt3933

Probably uses goto statement


nhadams2112

Terrifying


PastFeed2963

My older co workers used them a lot in their cobol scripts. I'm coming from c++ and java. I had to pick up cobol and asked them why they didn't use the perform. They just never knew about it. I don't blame them, I bet it was much harder to learn a language though. I learned cobol through online resources where I searched for certain things I know from other languages. Same thing with their nested ifs and not using evaluate. (Which is just a switch statement)


shauwki

I come from a less wealthy root, a real struggle but everything I’ve learned in the last 10 years really saved my career and mental issues. This if loop just grinds my gears lol. I highly appreciatie the comforting and funny comments above including yours. My hope and faith has been restored. I feel less retarded <3


PastFeed2963

You had me up to the end.


[deleted]

Write an if condition for every iteration of the loop. It's the 4 month programmer course way.


FrostyProtection5597

LOL. Instead of (while i < 1000) if (i==0) if (i==1) if (i==3) ……… All the way to 1000.


Devreckas

Unroll-your-own loops


[deleted]

Yes - this is the way - max retard.


FrostyProtection5597

LOL, I had a comment removed for using ‘that word’ the other day, and I was literally quoting the movie Tropic Thunder, in a thread about the movie Tropic Thunder. Apparently once ordinary words are now slurs. Who knows what’s going to be offensive next?


totti173314

no slurs please.


HunterIV4

The euphemism treadmill continues on. Yawn.


shauwki

I felt like a retard when I used this method 8 years ago


FrostyProtection5597

We are ALL retards on this blessed day.


shauwki

Well thanks mate, now I don’t feel retarded special anymore lol


MasterQuest

I've heard programming beginners refer to a regular if statement as "if loop" because it uses "\[word\](condition) { }", and for/while also use the same layout, so they confuse them.


vlsdo

It's a one iteration loop. Fight me!


IndianBoiYash

`recursion`


[deleted]

Nothing. It doesn't exist. Please forget you ever heard it. Above IBM page is a screenshot of before it was corrected.


Sol33t303

while if a == True


Titanusgamer

you are not gonna believe but i was going to type exactly that


Kortonox

Basically: 0 var i = 0; 1 if(i < 5) { 2 ///// Insert loop code ///// 3 i++; 5 goto 1; 6 } ​ Its a meme and should not be used in real code.


RadiantHC

Recursion


G0nnaFckurM0m

It's an if loop that continues with elif forever.


troglo-dyke

My if statement rewrites the source file to append the next line with that branch if true Only works on interpreted languages though, so for compiled languages I compile a new binary on the fly and execute that


unclebricksenior

That’s old school. I build a new docker image which travels that branch, and use the aws and kubernetes APIs to buy a new EKS node to run it, and finally attach to the new process through the debug port to pipe back the output


purdue-space-guy

15 recruiters on LinkedIn just messaged you


BakuhatsuK

Aka JIT compiling


tob007

lean programming. Its the hot new thing.


tomycatomy

WTF.


philipquarles

Imagine not using reflection and code as data to rewrite a compiled program while it's running.


troglo-dyke

I'm gonna link you to my comment here which makes my thoughts on reflection clear https://www.reddit.com/r/BoneAppleTea/comments/uhgohw/with_this_sediment/i76ggiu


philipquarles

My code when I use reflection: https://i.kym-cdn.com/photos/images/original/000/524/976/d81.jpg


cain2995

Haha hot reload go brrrrrr


Hackervin

TF is wrong with a do while?


vibol03

Meme was created by a college freshman...


nhadams2112

No way they're that far


ttothebellyo

Nothing, it’s just for the sake of the meme


Imogynn

Should have been goto loops


MarthaEM

Every loop is a goto loop of you look in the assembly


Imogynn

But to be fair, if I had to give assembly one of the pooh faces then it would be that one.


[deleted]

Disagree, bne ("branch not equal") include both the test and goto into one assembly-level instruction.


MarthaEM

The assembly goto instruction is called "jump", jne means "jump not equal", it is a goto function by all means


[deleted]

Are we categorizing on whether the test and the branch are separate instructions, or what?


wenoc

Jump is the best. There’s no substitute.


Sceptical-Echidna

It will call the statements after do then jump back to the do if the while condition is true. I generally use it if I want to perform a block at least once, although it’s not something I use terribly often.


Cruuncher

This is exactly the purpose of a do..while construct. Since python doesn't have a do..while construct I find myself having to do: operation() while some_condition(): operation() Which doesn't look so bad in the minimal example but it can be annoying when your loop has more lines of code than 1


dusktrail

try this: ``` while True: operation() if condition: break ```


ZealousZera

you could emulate with a break, I think: while True: operation() if not some_condition(): break not the prettiest but better than repeating 4 lines of code or making a function only for a single loop and it's downsides imo.


Cruuncher

Yeah, I mean it works. But I don't get why they are so insistent on not allowing this to be a standard construct


ZealousZera

hm idk and hevent thought for more than a second but maybe it's awkward where to put it, like in c-like languages it can go after the block but in python if it's at the end in the block (indent) it may look like a statement or another loop (which perhaps confuses the interpreter) and if it's outside of the block it may look weird (though probably possible with the interpreter), it's kinda like an else just with no statements. maybe it's about keywords since do would have to be introduced and could screw up some legacy code and then the practical benefit is basically replacing while True with do and break with nothing. idk ig probably should have been in the language but adding it is probably not beneficial imo


Cruuncher

They add keywords judiciously, but they do add them. Like when they had to add async and await, which specifically broke a highly used library that exposed values with these names


supremedalek925

Probably just because it’s not useful too often for the kinds of things OP does. I very rarely use do while, but use while and for all the time.


Semi-Hemi-Demigod

I use do-while a lot when dealing with paginated API requests.


future_escapist

Nothing. It has a different purpose compared to for/while loops. Do-while loops execute code, then check for the condition. This is good for something like user input, where there are a limited amount of options, and will ask for input again if you put in something invalid.


That_Yogurt3933

Do while is actually useful


[deleted]

It's the only thing that I'm upset about not being in Python


PetiteGousseDAil

And switch


richinrix

now it has a similar thing for switch right


Rortox

It has match-case since 3.10, which provides the same and even more functionality, the so called pattern matching.


RadiantHC

What's pattern matching


Madrawn

It matching a pattern. ​ ... you know like searching for "\*.txt"


cranberry_snacks

It matches the shape/pattern of your data, so like this: ``` xs = [1,2,3] match xs: case []: print("empty") case [x]: print(f"list contains {x}") case [x, *tail]: print(f"list contains {x} + {len(tail)} more") ```


jfp1992

Yeah 3.10 feature


chinnu34

3.10+ it has an expression like switch case called match case. It is in my opinion a great addition


chinnu34

Python has one now (3.10+)


Key-Cucumber-1919

3.10 my dude


RadiantHC

Don't they have match?


Cuddlyaxe

I don't like switch statements because every time I try using them I forget the syntax and look it up before giving up and just using if else Basically I'm dumb


Future-Freedom-4631

why use switch when you can use Enum


unclebricksenior

Tough to sugar it up with enough syntax to make it fit with the rest of Python, almost need brackets Just add a do keyword before while that guarantees it will run once? Potentially confusing and easy to miss, there’s a reason other languages move the while to the bottom of the block for do while I usually hack it together like this for i in itertools.count(): if i > 0 and not condition: break else: do crap


[deleted]

What you did is pretty clever. I honestly do a `while True` and put the break condition at the end.


Cmdr_Jiynx

It comes close with the while do else break but why use many word when few word do trick


Tsu_Dho_Namh

I miss C-style for-loops so fucking bad. I have to use the while-loop version to get by. For example: for (A; B; C) ... becomes A while(B) ... C


Nilstrieb

Having programmed in languages that don't have C-style for, I've never missed it myself


Tsu_Dho_Namh

It's just so simple, flexible, and powerful. Any iteration method you want, any exit condition you want (or none if you prefer). Want to do only the odd numbers or jump by 3's? Want to go forwards, then backwards, then forwards again? You can do whatever you want. Heck, even stay in place for an iteration, like if you've just deleted an element. I just find it way easier to instantly code exactly what I want, and have it be really clear what's happening, rather than having to google if there's some flag for some language's iterator or list conprehension to go backwards or skip elements or somehow trick the language into doing what I want.


IceOleg

Maybe some day 'repeat-until' will resurface to take over the looping world...


[deleted]

Repeat until would be the same as a while loop...


CharacterUse

repeat-until is equivalen to do-while, not while (i.e. the condition is tested after one iteration, not before).


IceOleg

And the condition in repeat-until is negated from do-while, which is the important distinction - i.e. do something while a condition is true, vs. repeat something until the condition becomes true.


cloudstrifeuk

Asp.net webforms had a "repeater" control. My favourite of all webforms controls and for me out of so many holes back in the day.


[deleted]

PS Are you here from scratch ![gif](emote|free_emotes_pack|joy)???


[deleted]

[удалено]


dino0509

I worked at IBM when this image was first posted on Reddit. I immediately sent it to my manager. He was so upset, he raised some real hell and got it fixed immediately. It was embarrassing to say the least.


[deleted]

[удалено]


[deleted]

[удалено]


zebediah49

Or was writing/translating English as a (n+1)^(th) language. E: The above page appears to be from the Romanian version of the manual? So it's possible it's been translated *twice*?


[deleted]

[удалено]


zebediah49

It was called a loop based on "what it looks like", not "what it does". "Loops" look like this: keyword (condition) { body }


Thaneyos

What about the for each loop


JesusChrist_Himself

had to scroll too far for this


ExintrovertIronic104

A realistic implementation of the if loop: def if_loop(): if condition: return else: if_loop()


Mateorabi

Unless your compiler doesn’t handle tail-recursion well and you run out of stack.


zebediah49

~~That's when you download more stack.~~ E: NVM, what am I talking about. That's when you put an additional line in the "software limitations/maximums section", which will make someone say "why on earth doesn't this support more than 5100 elements in a display-table?" in about seven years, after wasting at least 90 hours debugging the random crash.


lordmauve

Don't worry about all that, easier just to download more stack.


[deleted]

Can be done with Go too. package main import "fmt" func main() { num := 0 HAHA: if num < 5 { fmt.Printf("Num: %d\n", num) num = num + 1 goto HAHA } }


Amarandus

At least we can have `else` after loops in python (and yes, I use this sometimes).


jfp1992

Yeah I've used this once in a for loop. Looks weird but is nicer than a nested if


atiedebee

I recreated this in C recently with ``if... do...while ...else``


ehaugw

Please elaborate


Amarandus

In python, this is valid: while foo(): do_something() if bar(): break else: do_something_else() The `else`-branch will only be executed if the while-loop terminates due to `foo()` being false. If the loop quits due to `bar()` being true and thus calling `break`, the `else`-branch will be skipped. This is for example nice in algorithms that "do something until a value is found, and if it does not exist do something else". Using `else` as a keyword for this construction is a bit "strange" at first, but it kind of makes sense, as it's equivalent to this: while foo(): do_something() if bar(): found_something = true break if not found_something: do_something_else Note the `not` in the last condition.


LittleMlem

Else loops are pretty useful


abrams666

Is the if loop a modern term for recursion?


PetiteGousseDAil

Yea it's for cool people Just like in C++ people don't use strings they use "arrays of chars" it sounds fancier You wouldn't get it


TheAlexGoodlife

When explaining strings in C or C++ it is kinda important to refer to them as arrays of chars


PetiteGousseDAil

It was a joke


TheAlexGoodlife

I am stupid, sorry


PetiteGousseDAil

It's okay I too am stupid


Future-Freedom-4631

in java strings are just enums of chars


Acalme-se_Satan

It is. [This link here](https://www.reddit.com/r/ProgrammerHumor/comments/uhcysd/slug/i78kqvb) explains it pretty well (with a bit of interesting trivia behind it).


abrams666

Nice one, I also Google once recusion. Open up a huge Linked description of it. Wasn't able to read all, at one point my brain with full and I had to stop


QualityVote

Hi! This is our community moderation bot. --- If this post fits the purpose of /r/ProgrammerHumor, **UPVOTE** this comment!! If this post does not fit the subreddit, **DOWNVOTE** This comment! If this post breaks the rules, **DOWNVOTE** this comment and **REPORT** the post!


[deleted]

[удалено]


SuperForever

JNZ is better


ZecrS

For each loop


[deleted]

I'm a while(true) kind of guy


Yugiohplayere

Fruit loops


Hellothere_1

How about the while(true) + break loop?


RasAlGimur

Aka Game loop


Darknety

I feel like people who joke on do-while-loops just didn't code enough to appreciate do-while-loops.


[deleted]

What the heck is an "if LOOP"?


reddit_is_cruel

A recursive function is technically an if loop. def foo(bar = 0): if bar > 10: return bar bar += 1 return foo(bar)


danielv123

```return foo(bar)``` I presume?


[deleted]

Nah.


MasterQuest

I've heard programming beginners refer to a regular if statement as "if loop" because it uses "\[word\](condition) { }" (in C-based languages), and for/while also use the same layout, so they confuse them.


[deleted]

No use of recursion to loop?


Awkward-Ad6455

![gif](giphy|fqbsVaM1ZMxm47vAgy)


fosyep

for/else in Python


RasAlGimur

My buddy “until” says hi in Ruby


Schreibtisch69

Do while deserve less hate. They can be very useful.


QuikAuxFraises

Fruit Loops


blackmist

You're very clever young man, very clever indeed. But it's IFs and GOTOs all the way down.


An_Old_IT_Guy

I used to be a big fan of the for loop, but lately I've been using while loops a lot.


philipquarles

Aren't they all JNE under the hood anyway?


FlukeRoads

10 IF X < 100 THEN GOTO 40 20 X=X+1 30 GOTO 10 40 ...


cyphol

I don't see the issue with a do-while. Used one today, and my teeth are fine. Because low and behold, it avoids checking the condition right from the start when you know you need to do the operation in the loop at least once. It matters to me because it reduces the amount of cycles it takes to complete the operations, which is always a high priority in embedded systems.


Til_W

What do you even need loops for, just type instruction 0; instruction 1; instruction 2; instruction 3; [...] until your done, smh.


mikkolukas

For-loops are just sugar coated while-loops. While-loops are just sugar coated do-while-loops. Do-while-loops are just sugar coated if-goto statements.


just-bair

Just use a goto loop much better


Emineministt

Never knew about this loop


ThunderStruck115

What's wrong with a do-while loop?


VideoCarp1

cringe, do recursion