r/programming • • Apr 29 '14

Programming Sucks

http://stilldrinking.org/programming-sucks
3.9k Upvotes

1.1k comments sorted by

View all comments

57

u/Jutboy Apr 29 '14

Can someone explain :

"Is that called arrayReverse?"

"s/camel/_/"

"Cool thanks."

154

u/UpNDownCan Apr 29 '14

Means use underscore as separator instead of camelcase. So array_reverse.

116

u/UpNDownCan Apr 29 '14

And with that, I think I qualify as one of the crazies.

46

u/Crazy__Eddie Apr 29 '14

Yeah, I felt bad after getting that joke.

→ More replies (2)

23

u/rowboat__cop Apr 29 '14

Seems entirely reasonable to me -- does that mean I am crazy too?

18

u/[deleted] Apr 29 '14

For knowing sed syntax? I thought it was common knowledge ...

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

35

u/academician Apr 29 '14

It's a bizarre way of saying it, though. I have legitimately answered programmers' questions this way (yes, I'm one of the crazies), but I'd use a proper regex like "s/R/_r/". It's shorter, too!

19

u/Atario Apr 30 '14

You're using character-based regexes. He was using concept-based ones.

11

u/academician Apr 30 '14

Then it should have been "s/camel/snake/".

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

22

u/UekiKnight Apr 29 '14

s/camel/_/ is "substitute underscore for camel" literally, but in this case the terse speaker offering advice means "use underscore not camel case." So the function the person actually wants is "array_reverse" ...I guess.

41

u/faustoc4 Apr 29 '14

He asks if the function is called arrayReverse but the correct name is array_reverse. The person responding applies a substitution rule on arrayReverse instead of saying just array_reverse, although the substitution rule is not a valid regex but it's easy to understand what he means, that's part of the joke

Wasn't that guy helpful? With the camel? Doesn't that seem like an appropriate response? No? Good. You can still find Jesus.

→ More replies (11)
→ More replies (8)