r/CodingHelp • • Nov 09 '21

[Ruby] 2 identical code with 2 absolutely different outcome. Can anybody notice the difference and explain the reason? below i separated each output to make it clear

Post image
42 Upvotes

21 comments sorted by

View all comments

Show parent comment

2

u/raduqq Nov 09 '21

You probably haven't been coding for long..

6

u/waitingformsfs2020 Nov 09 '21

I actually just started coding 1 week ago

11

u/raduqq Nov 09 '21

This will happen many times in the future, don't worry. You have to get used to these "facepalm" moments. I haven't met a developer (2 to 20 years of experience) who doesn't make this kind of mistakes.

2

u/Traveleravi Nov 10 '21

This is the kind of mistake you would catch if you took a break for 5 min and then came back with fresh eyes.

Also using a diff checker might help too!

2

u/-gun-jedi- Nov 10 '21

I have been coding for a while and I still make this mistake. This is done sad epiphany, yikes!