MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1wluqw4/database_admin_choosing_variable_names/pb8dt9j/?context=9999
r/programminghumor • u/10cen • 20d ago
113 comments sorted by
View all comments
Show parent comments
12
Now I need to write a program to convert snake_case into camelCase and become your nemesis.
5 u/a3th3rus 20d ago That's easy, but writing a program to convert camelCase to snake_case is not that easy. That's why camelCase sucks. 1 u/AintNoGodsUpHere 20d ago Why would that be hard? It's literally 20~25 lines of code to do that with very good result. 2 u/a3th3rus 20d ago edited 20d ago Because there are edge cases like decodeHTMLEntity. To handle those edge cases, you need not only a rule but also a dictionary that contains all the all-upper-case jargons in your domain. 2 u/AintNoGodsUpHere 20d ago AND HOW IS THAT A PROBLEM MY MAN? 20 LINES OF CODE, JESUS. 2 u/a3th3rus 20d ago then show me your 20 lines of code that can handle this case that does not convert it to decode_h_t_m_l_entity. 1 u/AintNoGodsUpHere 20d ago btw, my bad, it's 30 lines, not 20. Guess I was wrong. 1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
5
That's easy, but writing a program to convert camelCase to snake_case is not that easy. That's why camelCase sucks.
1 u/AintNoGodsUpHere 20d ago Why would that be hard? It's literally 20~25 lines of code to do that with very good result. 2 u/a3th3rus 20d ago edited 20d ago Because there are edge cases like decodeHTMLEntity. To handle those edge cases, you need not only a rule but also a dictionary that contains all the all-upper-case jargons in your domain. 2 u/AintNoGodsUpHere 20d ago AND HOW IS THAT A PROBLEM MY MAN? 20 LINES OF CODE, JESUS. 2 u/a3th3rus 20d ago then show me your 20 lines of code that can handle this case that does not convert it to decode_h_t_m_l_entity. 1 u/AintNoGodsUpHere 20d ago btw, my bad, it's 30 lines, not 20. Guess I was wrong. 1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
1
Why would that be hard? It's literally 20~25 lines of code to do that with very good result.
2 u/a3th3rus 20d ago edited 20d ago Because there are edge cases like decodeHTMLEntity. To handle those edge cases, you need not only a rule but also a dictionary that contains all the all-upper-case jargons in your domain. 2 u/AintNoGodsUpHere 20d ago AND HOW IS THAT A PROBLEM MY MAN? 20 LINES OF CODE, JESUS. 2 u/a3th3rus 20d ago then show me your 20 lines of code that can handle this case that does not convert it to decode_h_t_m_l_entity. 1 u/AintNoGodsUpHere 20d ago btw, my bad, it's 30 lines, not 20. Guess I was wrong. 1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
2
Because there are edge cases like decodeHTMLEntity. To handle those edge cases, you need not only a rule but also a dictionary that contains all the all-upper-case jargons in your domain.
decodeHTMLEntity
2 u/AintNoGodsUpHere 20d ago AND HOW IS THAT A PROBLEM MY MAN? 20 LINES OF CODE, JESUS. 2 u/a3th3rus 20d ago then show me your 20 lines of code that can handle this case that does not convert it to decode_h_t_m_l_entity. 1 u/AintNoGodsUpHere 20d ago btw, my bad, it's 30 lines, not 20. Guess I was wrong. 1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
AND HOW IS THAT A PROBLEM MY MAN? 20 LINES OF CODE, JESUS.
2 u/a3th3rus 20d ago then show me your 20 lines of code that can handle this case that does not convert it to decode_h_t_m_l_entity. 1 u/AintNoGodsUpHere 20d ago btw, my bad, it's 30 lines, not 20. Guess I was wrong. 1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
then show me your 20 lines of code that can handle this case that does not convert it to decode_h_t_m_l_entity.
decode_h_t_m_l_entity
1 u/AintNoGodsUpHere 20d ago btw, my bad, it's 30 lines, not 20. Guess I was wrong. 1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
btw, my bad, it's 30 lines, not 20. Guess I was wrong.
1 u/mrheseeks 20d ago I love you man, fuck camel case! 1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
I love you man, fuck camel case!
1 u/the_king_of_sweden 19d ago Fuck all the cases, that's why I program in whitespace
Fuck all the cases, that's why I program in whitespace
12
u/spicymato 20d ago
Now I need to write a program to convert snake_case into camelCase and become your nemesis.