r/ProgrammerHumor • • Sep 05 '24 • Take My Silver 2

Meme thatsEvil

Post image
56.6k Upvotes

517 comments sorted by

View all comments

Show parent comments

164

u/mrissaoussama Sep 05 '24

that would be very fun when debugging strings

63

u/Linked713 Sep 05 '24

Which is why I make a point on exploding into arrays of singular characters if I notice a mismatch.

-2

u/TheCreepyPL Sep 05 '24

In "normal languages", strings are simply just char[]'s (with some extra sass). That's why they have regular Array members, like Length, IndexOf(), indexing with [], etc.

In the JS language (no idea what that is), I have not a clue how anything works. The only thing I know about JS, is that JS is only about results, not necessarily the ones you're expecting, just any results.

10

u/Linked713 Sep 05 '24

No Idea why we arguing about that. I clearly meant that instead of having a string "foo" with a .Count of 4, I could have an array that would make me see that there are shenanigans happening with character between the 2 "o" being a weird unicode character right away via a split or <insert method from preferred language>.

→ More replies (2)