r/ProgrammerHumor • • Mar 17 '23

Meme This should do the trick

Post image
41.6k Upvotes

1.1k comments sorted by

8.9k

u/fliguana Mar 17 '23

Off by one

3.6k

u/tilcica Mar 17 '23

2 if we include the one he said himself

or 3 if we also include the one in the code

1.4k

u/BelinCan Mar 17 '23

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

→ More replies (18)

174

u/Kyocus Mar 17 '23

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

→ More replies (12)

85

u/space_keeper Mar 17 '23

Off by 998, because the code is never executed.

→ More replies (15)

26

u/EnIxBF Mar 17 '23

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

→ More replies (1)
→ More replies (10)

245

u/Interest-Desk Mar 17 '23

There are two hard problems in computer science.

Cache invalidation, naming things and off-by-one errors.

→ More replies (1)

46

u/NotACryptoBro Mar 17 '23

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

32

u/[deleted] Mar 17 '23

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

→ More replies (1)
→ More replies (1)

273

u/ShadyG Mar 17 '23

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

119

u/fliguana Mar 17 '23

Briefly. Then comes the extra.

Requirement was clear. 1000.

→ More replies (8)
→ More replies (5)

56

u/ennuiui Mar 17 '23

The two hardest problems in programming are:

  • Naming things

  • Caching

  • Off by one errors

44

u/Emanemanem Mar 17 '23

They went above and beyond though

→ More replies (3)

69

u/eddydude Mar 17 '23

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

56

u/fliguana Mar 17 '23

That's Indian coder logic.

→ More replies (7)

22

u/agsuy Mar 17 '23

Ya if we start in 0 we loop to n-1

CS 101.

7

u/flopsicles77 Mar 17 '23

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

→ More replies (9)

5

u/Garry_G Mar 17 '23

Was going to say the same.

→ More replies (37)

232

u/Good_Smile Mar 17 '23

What if she's case sensitive

129

u/NikhilB09 Mar 17 '23

Please no. I'm sensitive too.

→ More replies (1)

50

u/Foxhound34 Mar 17 '23

Bad man, very, very bad man.

4

u/LionOfNaples Mar 17 '23

wags finger in the air

→ More replies (1)

3.5k

u/NonCombat Mar 17 '23

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

1.4k

u/JonathisV Mar 17 '23

Pretty sure what she wanted was "it".

271

u/NonCombat Mar 17 '23

Ha well you are correct!

→ More replies (16)

28

u/[deleted] Mar 17 '23

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

→ More replies (2)

31

u/GameDestiny2 Mar 17 '23

Automated test feedback in digital textbooks be like

8

u/Scx10Deadbolt Mar 17 '23

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

→ More replies (2)
→ More replies (8)

154

u/afar1210 Mar 17 '23

Also wanted it 1000 times not 1001 times

16

u/the_unheard_thoughts Mar 17 '23

Don't think so ... I believe it wanted it 8 times

→ More replies (11)

27

u/Derpyzza Mar 17 '23

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

39

u/null_check_failed Mar 17 '23

It’s in Hindi and that is cringe meme of couples shenanigans

“Sorry baby” “mela sona” Etc etc.

→ More replies (9)

7

u/Short_Preparation951 Mar 17 '23

it is nibba nibbi talk.

babu is genderless. lol

→ More replies (5)
→ More replies (9)

711

u/[deleted] Mar 17 '23 edited Mar 17 '23

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

196

u/Valalcar Mar 17 '23

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

38

u/[deleted] Mar 18 '23

She's hiding something

→ More replies (2)

7

u/TheAuthenticFake Mar 18 '23

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

95

u/mookanana Mar 17 '23

maybe he lost her phone, and when she got a new phone, he tries to say sorry baby

but apparently also failing at that

0

u/[deleted] Mar 17 '23

[deleted]

→ More replies (11)

2.1k

u/rull3211 Mar 17 '23

Who da fuq defines a loopvariable outside of the loop

839

u/rmflow Mar 17 '23

ex C programmers

179

u/irze Mar 17 '23

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

→ More replies (2)

297

u/altermeetax Mar 17 '23

That hasn't been necessary in C for 24 years

→ More replies (23)

14

u/Alexander_The_Wolf Mar 17 '23

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

→ More replies (5)
→ More replies (9)

62

u/ThisUserIsAFailure Mar 17 '23

OP apparently

29

u/IleanK Mar 17 '23

People who are used to code in C

→ More replies (6)

14

u/Tracker_Nivrig Mar 17 '23

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

18

u/JonathisV Mar 17 '23

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.

→ More replies (1)

8

u/sinistergroupon Mar 17 '23

Also went up to and including the upper bound

8

u/NevReddit0823 Mar 17 '23

when i want to know how many times it looped

→ More replies (1)
→ More replies (27)

1.6k

u/LonesomeHeideltraut Mar 17 '23

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

146

u/Brief-Preference-712 Mar 17 '23

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

→ More replies (5)

342

u/MarkWantsToQuit Mar 17 '23

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

→ More replies (3)

71

u/Deep-Piece3181 Mar 17 '23

And also WHY USE X?

43

u/Vesiculus Mar 17 '23

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

→ More replies (6)

21

u/SameRandomUsername Mar 17 '23

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

24

u/[deleted] Mar 17 '23

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

59

u/DrFloyd5 Mar 17 '23

You young kids. i is for index.

→ More replies (19)
→ More replies (22)

641

u/PM_ME_BAD_ALGORITHMS Mar 17 '23
  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

78

u/grateful-smile Mar 17 '23

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.

30

u/MushroomSaute Mar 17 '23

equalsIgnoreCase() chads coming in clutch here

→ More replies (1)
→ More replies (3)
→ More replies (15)

95

u/butchbadger Mar 17 '23

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

45

u/Kanomus_37 Mar 17 '23

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

→ More replies (2)

207

u/BigNutBoi2137 Mar 17 '23

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

110

u/androt14_ Mar 17 '23

Typ evn lss

print(("Sorry Babu\n"*1000)[:-1])

66

u/BigNutBoi2137 Mar 17 '23

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

→ More replies (1)

8

u/[deleted] Mar 17 '23

You want short, do you?

↑1000⍴⊂’Sorry Babu’

→ More replies (7)
→ More replies (7)

32

u/[deleted] Mar 17 '23

print("Sorry Babu\n"*1000)

→ More replies (5)

20

u/Rumpelruedi Mar 17 '23

`it 1000 times`

work smart, not hard

6

u/LenaKotik Mar 17 '23

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

8

u/Xivolos Mar 17 '23

1000.times do puts 'Sorry Babu' end

6

u/fmfm5029 Mar 17 '23
seq {1..100} |> Seq.iter (fun _ -> printfn "Sorry Babu")

I love F#!

→ More replies (6)

67

u/TazGiraffe Mar 17 '23

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

31

u/roguemenace Mar 17 '23

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

→ More replies (3)

31

u/D34TH_5MURF__ Mar 17 '23

IntStream.range(0, 999).forEach(System.out::println(...)

SMH

That's break up material...

24

u/j0akime Mar 17 '23

or just use String.repeat(int).

System.out.println("Sorry Babu\n".repeat(1000));

8

u/fuckEAinthecloaca Mar 17 '23

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

→ More replies (2)
→ More replies (2)

55

u/Sunscratch Mar 17 '23

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

→ More replies (1)

25

u/Harrigan_Raen Mar 17 '23

They said 1000 not 1001 times

19

u/Sad_Daikon938 Mar 17 '23 edited Mar 18 '23

It's a shame your Babu didn't write this.

javac Sorry.java

java Sorry

94

u/Kinkelin Mar 17 '23

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

→ More replies (7)

72

u/androt14_ Mar 17 '23

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")

55

u/[deleted] Mar 17 '23

The difference is we Java devs have class

→ More replies (5)

10

u/el_colibri Mar 17 '23

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!

→ More replies (6)

11

u/Brief-Preference-712 Mar 17 '23

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

9

u/ProgramistycznySwir Mar 17 '23

Tbh as c# programmer i like kotlin more

→ More replies (3)

4

u/dpash Mar 17 '23

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

→ More replies (1)

4

u/_xiphiaz Mar 17 '23

fun main() = repeat(1000) { println(“Sorry Babu”) }

Pretty sure this is valid kotlin too

4

u/blosweed Mar 17 '23

Java has ranges too :)

IntStream.range(0, 1000).forEach(() -> System.out.println(“Sorry babu”));
→ More replies (5)

15

u/giggluigg Mar 17 '23

Came to the comments for the code reviews

→ More replies (1)

11

u/momokosa Mar 17 '23

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

→ More replies (1)

10

u/JustSpaceExperiment Mar 17 '23

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

8

u/DukeOfSlough Mar 17 '23

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

→ More replies (1)

8

u/StarIU Mar 17 '23

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.

7

u/evan_west11 Mar 17 '23
if (unreasonable_request) {  
   break;  
}

6

u/i_martinw Mar 17 '23

From 0 to 1000 is 1001 times.

6

u/mikare1 Mar 17 '23

He did it for 1001 times, failed

6

u/CarlStanley88 Mar 17 '23

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

11

u/Aminowana Mar 17 '23

print "Sorry babu " x 1000

done, a camel can help us with that

→ More replies (1)

5

u/[deleted] Mar 17 '23

He said it even 1001 times

5

u/Outrageous-Machine-5 Mar 17 '23

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

15

u/mkwiiallpro Mar 17 '23

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.

4

u/ScaredyCatUK Mar 17 '23

x=0

x <= 1000

4

u/jb28737 Mar 17 '23

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

4

u/WarlaxZ Mar 17 '23

That's 1001 times

4

u/StrengthEnjoyer1 Mar 17 '23

This prints it 1001 times right?

4

u/edireven Mar 17 '23 edited Dec 19 '25

sparkle wipe dinner live include yoke direction label middle act

This post was mass deleted and anonymized with Redact

4

u/DumboRElephant Mar 17 '23

This will say sorry 1001 times

4

u/RealSchweddy Mar 17 '23

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

4

u/Massive-Web-4145 Mar 17 '23

Bro it will print 1001 times print

4

u/2Lazy2BeOriginal Mar 17 '23

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

1

u/Assembly_x86 Mar 17 '23

include <stdio.h>

void main() { for(int i = 0; i <= 1000;i++) { printf("Sorry"); } }

1

u/NikhilB09 Mar 17 '23

C, you got the point

→ More replies (2)

1

u/[deleted] Mar 17 '23

Now shows how the conversation continued

2

u/NikhilB09 Mar 17 '23

Sorry babu

Sorry babu

Sorry babu

...

Sorry babu

Sorry babu

Sorry babu

1

u/GeekCornerReddit Mar 17 '23

What is that button between the camera and attachment buttons?

3

u/[deleted] Mar 17 '23

the 'main' method is soooo last season, do you even top-level statements?

3

u/_Weyland_ Mar 17 '23

Or you could do it by hand, with 10x ctrl+c, ctrl+v

3

u/Tanjirou_and_kirito Mar 17 '23

"No one outside of this chat, not even WhatsApp, can read or listen to them"

well.....

3

u/Nickjet45 Mar 17 '23

Well 1001 times still requires you to say it 1000 times

3

u/SembeiNorimaki Mar 17 '23

That will say sorry 1001 times.

3

u/Pango_l1n Mar 17 '23

That’s 1001 times, not counting the first one

3

u/GoogleIsYourFrenemy Mar 17 '23

I said 1000, not 1001. Typically.

3

u/guiltedrose Mar 17 '23

So salty they did it in Java

3

u/fndasltn Mar 17 '23

print("Sorry babu\n"*100)

3

u/Chance_Fly_6273 Mar 17 '23

It’s 1002 times total, task failed

3

u/Shahi_FF Mar 17 '23

for(int i=1;i<=1000; ++i){

std::cout<<"Sorry, Babu"<<std::endl;

}

3

u/Lambejor Mar 17 '23

This will be 1001 times. You are starting at 0. Should be < 1000 exclusive. Classic off by one error XD

3

u/moonisflat Mar 17 '23

1001 times

3

u/[deleted] Mar 17 '23

Thats 1001 times

3

u/myheroscape20 Mar 17 '23

1001, tisk tisk

3

u/HokieNerd Mar 17 '23

How am I reading this chat, if no one outside this chat can read it? 🤔

→ More replies (1)

3

u/Blapman007 Mar 18 '23

python can get it done in two lines

3

u/ManaxP Mar 18 '23

Forgot to import std.io

3

u/not-moist-man Mar 18 '23

Alas 1001 times

3

u/scooterpdx42 Mar 18 '23

But that will print it 1,001 times.

9

u/Filin_Fill Mar 17 '23 edited Mar 17 '23

if you want to do it in python:

for i in range(1000):
    print('Sorry Babu')
→ More replies (2)

4

u/BrainDW Mar 17 '23

Imagine making a class just to make a for loop that prints a 1000 times

2

u/stillbarefoot Mar 17 '23

Not reusable. At least put “Sorry Babu” in a variable so he can apologise to other girls too without much effort.

2

u/ChickenEmbarrassed77 Mar 17 '23

this says it 1001 times though

2

u/x3F3F3F Mar 17 '23

That's 1001, try again.

2

u/[deleted] Mar 17 '23

I got u bro

public class Bubu {

`public static void main(String[] args) {`


`int x = 1;`

`while (x<=1000) {`

	`System.out.println("Sorry, bubu");`

`x++;`


	`}`


`}`	

}

2

u/Kain343 Mar 17 '23

That's 1001 times. Don't forgive!

2

u/PhantomOTOpera Mar 17 '23

That will print 1001 times, and there's no need do declare x outside the for loop. 0/10 code

2

u/[deleted] Mar 17 '23

This is the junior dev solution, the senior dev solution is :"It one thousand times". Way fewer keystrokes.

2

u/blorppps Mar 17 '23

incorrect that prints it 1001 times

2

u/[deleted] Mar 17 '23

that will print out one extra , a 'one to grow on' I suppose

2

u/plastigoop Mar 17 '23

Is that 1001?

2

u/Touhou_Fever Mar 17 '23

Isn’t that 1001?

2

u/PrestelBruh890 Mar 17 '23

That's 1001 times

2

u/[deleted] Mar 17 '23

Thats 1001 times

2

u/Torebbjorn Mar 17 '23

That's 1001 times, and also shitty code

2

u/[deleted] Mar 17 '23

Now do it in assembly

2

u/Louuss Mar 17 '23

That’s 1001 times

2

u/spartanpaladin Mar 17 '23

Oops n now you told it 1001 times.

2

u/ChiaraStellata Mar 17 '23

Why would you not write this in one line of Python? Or one line of C# using top-level statements? Or BASIC or Perl if you want to go old school? So weird to choose the most verbose solution.

→ More replies (2)

2

u/Every_Masterpiece_15 Mar 17 '23 edited Mar 17 '23

There are more efficient ways to tell sorry, actually think you can do the trick faster using Perl!

!/usr/bin/perl

use feature ':5.10'; use warnings; use strict;

$a = 1; while ($a < 1000){ say "Sorry"; $a++; }

2

u/Roosen_A Mar 17 '23

You should compile it you can't send the source code

2

u/KnGod Mar 17 '23

He said it 1002 times so idk

2

u/specialsymbol Mar 17 '23

That's 1001 times..

2

u/[deleted] Mar 17 '23

Cringe

2

u/I_need_handjob Mar 17 '23

Says sorry 1001 times

2

u/unclemikesart Mar 17 '23

You expect forgiveness and then you send me Java code!? No class.

2

u/TheUndisputedRoaster Mar 17 '23

print("Sorry Babu" \n)*1000

Simple

2

u/[deleted] Mar 17 '23

U don’t run it..

2

u/SirFireball Mar 17 '23

If you’re gonna make this joke, why write it in a lang with this much boilerplate?

2

u/Fit_Fee_3304 Mar 17 '23

Bro printed it 1001 times and that too b is not capital 💀

2

u/CB9611 Mar 17 '23

You're gonna say it 1001 times with that code, sheesh

2

u/TerminalJovian Mar 17 '23

Won't this print it 1001 times?

2

u/0x0MG Mar 17 '23

python -c 'print("Sorry babu " * 1000)'

2

u/EelBait Mar 17 '23

1001. Off by one bug.

2

u/[deleted] Mar 17 '23

She sends back 403

→ More replies (3)

2

u/TheEngineerGGG Mar 17 '23

You forgot to call the method

2

u/Fusseldieb Mar 18 '23

That is the equivalent of boomer humor. Prove me wrong.

2

u/International-Top746 Mar 18 '23

The code will say 1001 times. Which doesn't match the requirements

2

u/Elongated_Rhino Mar 18 '23

Girl says compilation error

2

u/[deleted] Mar 18 '23

*crashes

2

u/Ducking_eh Mar 18 '23

If he wanted to make sure the message wasn’t miss-interpreted; he should of done it in Assembly

2

u/daddysbonner Mar 18 '23

write it in assembly way better

2

u/Horror_Peak_9435 Mar 18 '23

Actually it prints 1001 times so you should use x=1 instead of x=0 Also you can use Excel instead of Java you can get the result in half a millisecond and you can copy that and also you do not require ide to run the program

2

u/soumo_25 Mar 18 '23

It will print 1001 times

2

u/[deleted] Mar 18 '23

Actually it’s 1001 times the loop will be executed. 😂

2

u/Schievel1 Mar 18 '23

Don’t be too harsh on him. He’s programming Java. I think even this economy should have a place for the mentally challenged.

2

u/[deleted] Mar 18 '23

Oof that's gonna say sorry 1001 times....

2

u/Longjumping_Rub_9689 Mar 19 '23

you said it 1001 times btw

2

u/NoSwadYt Mar 17 '23

Its 1001x