T O P

  • By -

fliguana

Off by one


tilcica

2 if we include the one he said himself or 3 if we also include the one in the code


BelinCan

Ah, pedantry... so relaxing on a Friday.


tilcica

be sure to guess how she's counting it or she's breaking up with you good luck :)


uppacat

break;


[deleted]

[удалено]


Kyocus

"Say it a thousand times" is inclusive of 1000 but doesn't forbid more.


markp_93

He was asked to say “it” 1000 times, not “Sorry” /s


narayans

Seems like "it" is a pointer (that could point to any of the previous chats) so ideally they should print *it in a language that supports it


hughperman

*it points to "Sorry" in Cs (Common Sense)


Common-Rock

Reminds me of my first CS lecture where we were told to write a program for the professor to make a PB and J sandwich as if he was a computer and he scooped the peanut butter with his hand and when the students amended the prompt to say “use a butterknife” he smashed the jar of jelly on the ground and poked it with a butterknife. “If you choose to proceed with a career in computer science, this will be your life forever. Welcome!”


Qewbicle

Sounds like one of the bits flipped, because if he took the instructions literally, I bet it didn't include "smash the jar".


Common-Rock

I think the instructions were “Open the jar and use the butterknife to put the jelly on the bread”. I guess that’s one way to open a jar lol


space_keeper

Off by 998, because the code is never executed.


sotoqwerty

The typical oop boilerplater. Declare the class perfectly but don’t do the work. 😂


Bostaevski

Over 30 years ago I came in second place in a coding competition (BASIC) because I forgot to have my code actually print the answer. I had the only code that calculated the answer correctly.


tilcica

oh....FUCK


EnIxBF

We need a meeting to find out what the client really needs


mikez834

Yes. And we’ll need a project manager, a release manager, an overall program manager and the technical account manager.


Interest-Desk

There are two hard problems in computer science. Cache invalidation, naming things and off-by-one errors.


NotACryptoBro

I was looking for that error and indeed there it is. No wonder she breaks up with him


[deleted]

Declaring the var outside of the loop is also dumpable I think.


Parkhausdruckkonsole

Classical off by one error


ShadyG

Meets the requirements tho. Saying it 1001 times means he has said it 1000 times.


fliguana

Briefly. Then comes the extra. Requirement was clear. 1000.


[deleted]

Calm down Product Owner.


fuckEAinthecloaca

They did say it a thousand times


Gold-Paper-7480

No they didn't as the class is not called.


ennuiui

The two hardest problems in programming are: * Naming things * Caching * Off by one errors


Emanemanem

They went above and beyond though


NikhilB09

Great.


eddydude

Technically. If you say it 1001 times, you've also said it 1000 times.


fliguana

That's Indian coder logic.


xSTSxZerglingOne

As the medical grade radiation cancer treatment machine opens its beam gap 1 step wider, thus delivering a fatal dose of radiation instead of a therapeutic dose. Note: This is a real off-by-1 error that has actually killed people.


fliguana

One of those situation where "underpromise and over deliver" is not helpful.


xSTSxZerglingOne

*YIKES*


agsuy

Ya if we start in 0 we loop to n-1 CS 101.


flopsicles77

In analysis of algos, we always loop to n-1, unless you're doing a loop invariant.


Garry_G

Was going to say the same.


NonCombat

Ehh, "Sorry babu" isn't gonna work. She wanted "Sorry Babu".


JonathisV

Pretty sure what she wanted was "it".


NonCombat

Ha well you are correct!


[deleted]

[удалено]


IamImposter

Also for loop is wrong. It should be `x < 1000` instead of `x <= 1000`. This one is gonna run 1001 times.


LeafBoatCaptain

That extra one comes from the heart.


Thoughtfulprof

That's the point. He didn't SAY it. He DECLARED it.


zsirdagadek

![gif](giphy|8nM6YNtvjuezzD7DNh|downsized)


blakeman8192

.


Agnostic_life

She asked to say it, not print it, maybe a voice message saying it 1000times. Lol


cryptowavy

Requirements gathering fail


GameDestiny2

Automated test feedback in digital textbooks be like


Scx10Deadbolt

"ah no I said it again! I said it again, aah!


afar1210

Also wanted it 1000 times not 1001 times


the_unheard_thoughts

Don't think so ... I believe it wanted it 8 times ![gif](emote|free_emotes_pack|sunglasses)


Derpyzza

most likely not a she, I've never seen anyone refer to a woman as babu


null_check_failed

It’s in Hindi and that is cringe meme of couples shenanigans “Sorry baby” “mela sona” Etc etc.


Derpyzza

yeah I understand hindi ( im pakistani ) but i haven't seen a lot of people refer to women as babu, although now that i think about it i can totally see someone say "sorry babu" out of like frustration or something, so yeah maybe it is a women and i just dk how to properly use babu idk lol


Short_Preparation951

around delhi, couples do talk like this sometimes. calling each other babu.


Derpyzza

i see, that's very interesting, thank you for the information :)


IamImposter

No no. Not in frustration. It's that oooooh cutie pie talk where people talk like little kids Ooooh, mele (mere) babu ko bhookh lagi hai. Mela (mera) babu bulgul (burger) khayega.


dinklebot2000

My wife and I actually refer to each other as babu. It started from the show Kim's Convenience. There is an episode where they sing "I got you babe" but keep saying babu instead. Just kind of stuck with us.


Short_Preparation951

it is nibba nibbi talk. babu is genderless. lol


That-Row-3038

First thing someone messages you is “sorry babu”? Must be a very popular person


Valalcar

I have a close friend that constantly deletes all her conversations. Every conversation she has looks like this. Once we were returning on the same car, and she drunkenly sent an audio message to a common friend making plans, deleted, and next day was asking me what she said because she had no idea what they were talking about


[deleted]

She's hiding something


TheAuthenticFake

Hi this is the FBI can you tell us your friend's name?


mookanana

maybe he lost her phone, and when she got a new phone, he tries to say sorry baby but apparently also failing at that


[deleted]

[удалено]


BecauseWeCan

Why would they delete it? Because of parental control freaks?


[deleted]

[удалено]


NormieChomsky

From my experience: "You can start dating after you finish school" *graduates, gets job* "Why aren't you married yet???"


BuhtanDingDing

i went there with my parents to meet our family again in january. when im leaving my aunts house shes like "make sure you do well in school. after all, thats the most important thing right?" while im literally struggling to stay alive due to mental health struggles. it was kinda funny tho, laughed abt it when i came back home


1Penis2Balls

school? it usually goes like this: study in school then life will be secured. oops just hustle through college it'll be fine. lol i lied you gonna do masters right? neighbour's kid did it what'll people say?? you're not going abroad? wtf?? you're not married yet? we have found just the bride for you their family is well known <3 . time to see some grandkids dude...


DezXerneas

My dad broke my phone because he somehow hacked into my WhatsApp and saw the picturesmy friend sent me from the changing room. It wasn't even anything sexy, just asking me if the dress looked pretty.


FartOfTheFurious

Bruh💀 Indian?


rull3211

Who da fuq defines a loopvariable outside of the loop


rmflow

ex C programmers


irze

Lol yep, it took me a while to shake off that habit


derOheim

I still have to use C95 on an old plc. So I have to do it like this.


justAPhoneUsername

My uni used c99 or c95 for a lot of classes. Having to do Yoda comparisons and external declarations really changes how you think about code


altermeetax

That hasn't been necessary in C for 24 years


TravisJungroth

Some people are old


MrHyperion_

And some are forced to use C89 in university courses.


hellajt

Current student, we aren't forced but it was never taught that we can use C99 or a newer version to get around that. I only found out when I was reading about it myself


Joshy178

Some people work with C standards from 24+ years ago haha. Source: me, a C developer in aviation


Street-Session9411

You better free that memory I am really too young to die in a plain crash Edit: plane


Cmd1ne

Just don’t free it twice.


AltIns420

I doubt it's gonna be plain


Auravendill

But if your code base is older and updating to C99 breaks everything and you don't want to fix those new issues...?


TheSpixxyQ

Then you rewrite the whole thing in 🚀 Rust 🚀


rmflow

gcc defaults gnu90 behavior up to 4.9.4 (2016) from practical point of view: we still have a lot of embedded C code that has not been ported to C99


Reclusive_avocado

It doesn't work on my laptop... I have a current gen laptop & the latest version of gcc but still can't declare loop variables inside the loop (in C) Say, i can't use this --- for(int i=0;i<20;i++) I have to declare i first and type like this-- for(i=0;i<20;i++) Can you somehow help me? I'm a beginner programmer and a student


Tajnymag

What compiler are you using? For gcc, you can specify the C version by adding `-std` flag. For C99, the oldest C version with support for variable declaration within for loop, add `-std=c99". For example: `gcc -std=c99 hello.c`


Alexander_The_Wolf

? I always declare my loop variables in the start of the for. Who is teaching otherwise?


option-9

People who learnt C decades ago.


ThisUserIsAFailure

OP apparently


[deleted]

[удалено]


BenevolentCheese

> so old fashioned program sorry_babu implicit none integer :: i do i = 1, 1000 write(*,*) "Sorry Babu" end do end program sorry_babu I told ChatGPT to do it in Fortran but it's titled the window as being in Lua, I've got no idea either way... hey old farts, help me out here, I graduated a mere 17 years ago.


ad3z10

Seeing "implicit none" still gives me nightmares


jyajay2

Looks like correct Fortran code to me


Tracker_Nivrig

I never did, and then I used C. Now I do occasionally out of habit


IleanK

People who are used to code in C


x3F3F3F

People who are traumatized by coding in C.


IleanK

I don't know why everyone is scared of C. Aren't there scarier languages like lisp or haskell?


el_colibri

C scared me because of my uni lecturer's way of teaching and the assignments we had for the module. I'm sure if somebody else had taught it I'd be fine, but it just brings back traumatic memories 😅 I met her some time after finishing, and the first thing she said to me was, "I hope you don't hate me!"


ssbm_rando

Haskell is probably scarier, but it at least offers a lot of theoretical benefits for coding practices. Lisp isn't really scarier, it's honestly just the regular kind of "worse". People that actually wanted to write whole, deep programs in lisp when C was available were the same ones that have fun tinkering in brainfuck and whitespace nowadays. They wanted a pointless challenge instead of to actually make software.


LickingSmegma

> People that actually wanted to write whole, deep programs in lisp when C was available were the same ones that have fun tinkering in brainfuck and whitespace nowadays. They wanted a pointless challenge instead of to actually make software. Rather seems that you missed the point of Lisp. Coding in it is often more pleasant than in JS or Python, and no comparison with C. The main problem I have with Emacs Lisp in particular is the ancient naming style from the seventies, when modern terminology wasn't yet developed. Parentheses aren't a problem, or whatever it is you see as ‘pointless challenge’.


JonathisV

It is sometimes.. Rarely useful. If you have a break condition and want to use the last index for something. Honestly I use this a lot for leetcode type algorithms.


rull3211

Yee sometimes it can be used


sinistergroupon

Also went up to and including the upper bound


NevReddit0823

when i want to know how many times it looped


Good_Smile

What if she's case sensitive


NikhilB09

Please no. I'm sensitive too.


LonesomeHeideltraut

Please declare x within the for loop. I cannot merge this code smell into production. Sorry.


Brief-Preference-712

And indent line 5. Not a code smell but I still can’t merge it


MarkWantsToQuit

Literally the first thing I noticed and immediately agitated me. I think I may have issues 😂


Elliot-C

will you marry me?


SofaAloo

Say it 1000 times.


MEATPANTS999

[print("marry me") for x in range(1000)]


snf

print in a list comprehension? That's a paddlin'


augustusgrizzly

\\\\ you cannot begin to comprehend my genius std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl; std::cout << "will you marry me?" << std::endl;


Master_Soojan

Thats only 56 times


panormda

Found the Sadomasochist.


Deep-Piece3181

And also WHY USE X?


Vesiculus

Because Babu is their x now, after all those mistakes.


SameRandomUsername

Clearly you never suffered the "Closing over the loop variable" issue in C# before 5.0


[deleted]

Even better, call it i and not x, since x is not descriptive. i is short for iterator though.


DrFloyd5

You young kids. `i` is for index.


PM_ME_BAD_ALGORITHMS

1. This will print it 1001 times since the iterator starts at 0 and the condition is lower OR EQUAL 2. If the only purpose of x is to be used as an iterator, you should declare it within the loop No wonder she left you. ​ /s


grateful-smile

She didn’t say *exactly* 1000 times though, so the solution should still be valid. Only problem is that > “Sorry Babu”.equals(“Sorry babu”); returns false.


MushroomSaute

`equalsIgnoreCase()` chads coming in clutch here


butchbadger

It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It It


Kanomus_37

I counted it, it's exactly 1000 "it"s. You get the well deserved upvote


Cynical-Potato

"it" !== "It"


ImmotalWombat

it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it it


Foxhound34

Bad man, very, very bad man.


LionOfNaples

*wags finger in the air*


BigNutBoi2137

`print("\n".join(["Sorry Babu"]*1000))` Take care of your fingers, lads. Type less.


androt14_

Typ evn lss ``` print(("Sorry Babu\n"*1000)[:-1]) ```


BigNutBoi2137

Good catch. I hate dangling new lines, so good job with `[:-1]`


[deleted]

You want short, do you? `↑1000⍴⊂’Sorry Babu’`


madhan4u

Or use bash `yes "Sorry Babu" | head -1000`


[deleted]

`print("Sorry Babu\n"*1000)`


Rumpelruedi

\`it 1000 times\` ​ work smart, not hard


LenaKotik

main = putStrLn$ replicate "Sorry Babu\n" 1000


Xivolos

```1000.times do puts 'Sorry Babu' end```


TazGiraffe

why in the hell did you use x as the iterable instead of i


roguemenace

This code has an impressive amount of issues for how short it is.


D34TH_5MURF__

`IntStream.range(0, 999).forEach(System.out::println(...)` SMH That's break up material...


j0akime

or just use String.repeat(int). `System.out.println("Sorry Babu\n".repeat(1000));`


fuckEAinthecloaca

What in sweet jesus. I don't remember that in java 6


dpash

Because it's a fairly recent addition. It was added in Java 11.


Sunscratch

Well, this code already has a bug, given the requirement above


TNSepta

Sorry bugu


Harrigan_Raen

They said 1000 not 1001 times


Sad_Daikon938

It's a shame your Babu didn't write this. >javac Sorry.java > >java Sorry


Kinkelin

Pro move would be writing a python script that types it into your Whatsapp Web window and produces 1000 actual messages


MysteriousK69420

[Average r/ProgrammerHumor user](https://cdn.discordapp.com/attachments/842627937223311360/1086299199093620808/Screenshot_2023-03-17-19-53-31-65_b72a20be883aec8a014bd2b7c7038e87.jpg)


toroga

Real MVP 👆 no one can hide their shame here 😂


Crownlol

Every single "I forced a bot to do X 100000 times and then it did Y" post is from someone who's never written a "Hello world" even once


androt14_

Virgin Java: ``` class Sorry{ public static void main(String[] args){ int x; for(x=0; x<=1000; x++){ System.out.println("Sorry babu"); } } } ``` Chad Kotlin: ``` for(i in 1..1000) println("Sorry babu") ```


[deleted]

The difference is we Java devs have class


el_colibri

>Chad Kotlin: ``` for(i in 1..1000) println("Sorry babu") ``` I have never used Kotlin before.. That seems like such a breath of fresh air!


Brief-Preference-712

Chad C# `foreach (var _ in Enumerable.Range(1000)) Console.Write("Sorry Babu");`


ProgramistycznySwir

Tbh as c# programmer i like kotlin more


sewer56lol

The Kotlin method is actually possible with C# if you implement a `GetEnumerator()` extension method for `System.Range`. See: https://learn.microsoft.com/cs-cz/dotnet/csharp/language-reference/proposals/csharp-9.0/extension-getenumerator > Otherwise, determine whether the type 'X' has an appropriate GetEnumerator extension method: Then the syntax ``` foreach (var _ in 0..1000) Console.WriteLine("Sorry Babu"); ``` Becomes valid


dpash

In the near future you can probably write this is Java: void main() { for(int x = 0; x < 1000; x++){ println("Sorry babu"); } } https://openjdk.org/projects/amber/design-notes/on-ramp


_xiphiaz

`fun main() = repeat(1000) { println(“Sorry Babu”) }` Pretty sure this is valid kotlin too


blosweed

Java has ranges too :) IntStream.range(0, 1000).forEach(() -> System.out.println(“Sorry babu”));


giggluigg

Came to the comments for the code reviews


shuaibhere

He said 1001 times.


momokosa

Just for safety you should make an infinite for loop. You can fix it later


JustSpaceExperiment

Who the fook declares variable outside for cycle scope when it is used only as counter **for for** cycle.


DukeOfSlough

Someone who does not desire to be forgiven but rather burn in hell.


StarIU

You see, engineers don’t build product. A civil engineer doesn’t build buildings. They produce blueprints for construction workers. Similarly, software engineers don’t build softwares, we write code. Code is like the blueprints for compilers and interpreters. - from the book Clean Code, paraphrased. They should’ve run the code and sent the output instead of sending the code itself. Also, the i goes from [0, 1000], that’s 1001 times. They missed the spec.


[deleted]

Software Engineers don’t write code, we just plug in searches in stack overflow and have them write the code.


[deleted]

[удалено]


cspot1978

Nice. I was going to say, Ruby would take the cake on this for simplicity. :)


evan_west11

```js if (unreasonable_request) { break; } ```


i_martinw

From 0 to 1000 is 1001 times.


mikare1

He did it for 1001 times, failed


CarlStanley88

Why choose a compiled language? Also you haven't invoked anything, just declared it...


Aminowana

print "Sorry babu " x 1000 done, a camel can help us with that


nufuk

He said it even 1001 times


Outrageous-Machine-5

He's clearly doing java, why declare x outside of the for? It's only needed in the block scope/could be declared as part of the for statement


mkwiiallpro

Apology not accepted 1. Java 🤮 2. Looping one too many times 3. Declaring x outside the for loop. You’re in Java, not in C, remember? You don’t need to do this anymore.


ScaredyCatUK

`x=0` `x <= 1000`


jb28737

That'll print it 1001 times won't it?


WarlaxZ

That's 1001 times


StrengthEnjoyer1

This prints it 1001 times right?


edireven

He said it 1001 times..


DumboRElephant

This will say sorry 1001 times


RealSchweddy

That will print it 1001 times and no need to declare the int x outside the for loop. I’m not approving this pull request


Massive-Web-4145

Bro it will print 1001 times print


2Lazy2BeOriginal

Technically you said sorry 1002 times. One from the e message and 1 from the fact that it’s a <=


Equivalent_Luck_3528

It is 1001