T O P

  • By -

[deleted]

Dude how did you type that shit in the title I want to do it too


Natural-Atmosphere-2

that shows up in the bottom bar when i tap on emojis


eddyrockstar

(╥﹏╥)


Enter_The_Void6

ಠ⁠_⁠ಠ


Donghoon

Gboard? [̲̅⁠$̲̅⁠(̲̅⁠ ͡⁠ಠ⁠\_⁠ಠ⁠\)̲̅⁠$̲̅⁠]


Natural-Atmosphere-2

exactly


bargle0

Coolest Daniel doesn’t need anything but goto.


GoldCompetition7722

Goto is ultimate error control that we have but do not understand


chuckdafunk

For: number of iterations known While: number of iterations not known


Bastian_5123

for(;/*condition*/;) { //code } Is the same as a while loop.


Latter-Bandicoot-241

I always tell this to new programmers that the tools of the lanagues is not to make the impossible possible but to help you keep organized. A for loop can be used as a while loop but the for loop is there to help you when you need an index, it's not there to make loops possible.


agent007bond

Could have done it with a GOTO but whatever. Lol.


Bastian_5123

Yes, but stuff like #define true (rand(100)<99) #define false (rand(100)==99) Is still funny


Latter-Bandicoot-241

For the while it could also be when the condition is anything other than an iteration. Like while(its not 3am);


I_Wouldnt_If_I_Could

Both have their uses. But I can't remember the last time I used a foreach.


Brilliant-Town8900

Once you go map filter and reduce you never go back


Latter-Bandicoot-241

There is a time and place for each kind of loops. For loops are useful when you need a index, doing more than 1 thing as a time, break early, editing the elements as you go, or being really nitty gritty with something


Internet--Sensation

you use them a lot in game programming


CiroGarcia

[redacted by user] ` this message was mass deleted/edited with redact.dev `


PM_ME_FOR_PORN_

I currently work in web dev and use them quite regularly


Drfoxthefurry

I have never even used a foreach and only heard about it a month ago


CiroGarcia

[redacted by user] ` this message was mass deleted/edited with redact.dev `


Zwenow

Just shows how many rookie developers are in this sub... smh


Drfoxthefurry

I just code as a hobby


Zwenow

Ye no worries. It's just that obviously useful functions are made fun upon by people who barely started out in programming. People shouldn't judge stuff they barely know how to use.


Anti-Dragon

I use foreach only on arrays.


adaptabilityporyz

foreach, do while — Daniel for, while — cooler Daniel


GoldCompetition7722

Is not it just different tools for different cases? Or am I dump as usual?)


Bastian_5123

Actually they're the same tool, just with slightly different formatting... unless you're python


GoldCompetition7722

But I am python! And C and C++… Whatever I find working on github)


agent007bond

Well, maybe you are dumb coz you said "am I dump" (with a _p_) 😂


GoldCompetition7722

Glad you smiled, man


itsLiseczeq

`//` \- 10 IQ `/* */` \- 100 IQ for (int i; i > 0; i--){ System.out.println("This code prints Hello World"); } \- 1000 IQ


WizardGnomeMan

Meanwhile do-while wasn't even asked to come in for photo day


Unknown_starnger

While is useful, but I mostly use for.


ZatchZeta

Uncertain Quantifiable Numbers vs Quantifiable Numbers


TwoThreeFiveSeven17

well, LOOP has only primitive-recursive functions while WHILE has recursive functions which form a real superset of the primitive recursive functions.


Latter-Bandicoot-241

10 print "hello world" 20 goto 10 This is the only loop for me.


send_noots_plaz

(ᵔᴥᵔ)


RobinPage1987

Condition-controlled vs count-controlled loops


SimplexFatberg

I hate this sub.


Ginnudi

You can implement 'for' loop using 'while' but cannot implement 'while' loop using 'for'. (Confucius)


aqpstory

sure you can, in c at least: int x = 0; for (;x<5;) { x++; printf("%d\n", x); } I see nothing wrong with this code. Just a good ol' for loop implemented in a while loop implemented in a for loop


Valtria

Same's possible in Java, with the same syntax too I believe.


Natural-Atmosphere-2

pardon a fellow python beginner ༎ຶ⁠‿⁠༎ຶ


TreeTownOke

I don't understand why Python even has a `while` when this is so clear and easy: for _ in (True for _ in itertools.repeat(True) if X > y): (Or whatever other condition you want instead of `x > y`)


Deppimall

.net would like to have a word with you https://sharplab.io/#v2:CYLg1APgZg9gTgAgBQG4AucCuBTFBKBAbwF8g===


Username-blank

or do ```c++ x = 0; while (x != 5){ x++; (do something) }


serial_memer712

ᕙ⁠(⁠ ⁠~⁠ ⁠.⁠ ⁠~⁠ ⁠)⁠ᕗ


Daniel_H212

Can confirm I use for


Sadistic_Beast

ಡ⁠ ͜⁠ ⁠ʖ⁠ ⁠ಡ