MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/rllpgt/rate_my_hash_function_and_function_naming/
r/badcode • u/[deleted] • Dec 21 '21
9 comments sorted by
33
Outstanding. Only a complete n00b would use an array of objects and find here.
find
13 u/twoPoundsOfGoldfish Dec 21 '21 only the most unintelligent of minds would use a map.
13
only the most unintelligent of minds would use a map.
7
mark ftw
6
Ok you can use classes for that,I'll allow it.
5
Fantastic. Only the weirdest of code would use an array, get indices, use indices and a nested function. This man is a god of inefficiency
8
Image Transcription: Code
function returnAgeUsingName(name) { let ages = [21, 23, 45, 42]; function returnAgeIndexUsingName(name) { switch (name) { case "John": return 0; case "Mollina": return 1; case "Elvis": return 2; case "Kopfler": return 3; } } return ages[reurnAgeIndexUsingName(name)]; } console.log(returnAgeUsingName("Kopfler"));
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
2
No JSON, no associative array? No problem!
Wait they have that all wrong on this card: No! JSON! No! Associative array! No, problem!
What I enjoy doing on solo project is having the most absurd variable and function names. One of then for a variable was cargoesvrooooooooooom.
33
u/Notimecelduv Dec 21 '21
Outstanding. Only a complete n00b would use an array of objects and
findhere.7
u/BoNoMyTiResArEGoNe Dec 21 '21
mark ftw
6
u/CaitaXD Dec 22 '21
Ok you can use classes for that,I'll allow it.
5
u/HarryCoder123 Dec 23 '21
Fantastic. Only the weirdest of code would use an array, get indices, use indices and a nested function. This man is a god of inefficiency
8
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Dec 21 '21
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
2
u/ragingroku Dec 22 '21
No JSON, no associative array? No problem!
Wait they have that all wrong on this card: No! JSON! No! Associative array! No, problem!
2
u/ButterM-40 Dec 27 '21
What I enjoy doing on solo project is having the most absurd variable and function names. One of then for a variable was cargoesvrooooooooooom.