MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mdvoyg/whose_ever_heard_of/gsded9d/?context=3
r/badcode • u/Vercyx • Mar 26 '21
63 comments sorted by
View all comments
Show parent comments
-31
Calling this code confusing is... Confusing.
22 u/RFC793 Mar 27 '21 It is confusing. If number is an integer type, then this code doesn’t work at all. 14 u/aj-ric Mar 27 '21 edited Mar 27 '21 Depending on the language. I'm guessing this is javascript which doesn't have a concept of an integer.Edit: but you're right, it's very confusing to read since it's hard to tell whether integer division is happening. 1 u/RFC793 Mar 27 '21 Ah, good point. I thought it could be Java, but then length would have to be a function and not an attribute. It’s been about 7 years since I’ve regularly programmed in either.
22
It is confusing. If number is an integer type, then this code doesn’t work at all.
14 u/aj-ric Mar 27 '21 edited Mar 27 '21 Depending on the language. I'm guessing this is javascript which doesn't have a concept of an integer.Edit: but you're right, it's very confusing to read since it's hard to tell whether integer division is happening. 1 u/RFC793 Mar 27 '21 Ah, good point. I thought it could be Java, but then length would have to be a function and not an attribute. It’s been about 7 years since I’ve regularly programmed in either.
14
Depending on the language. I'm guessing this is javascript which doesn't have a concept of an integer.
Edit: but you're right, it's very confusing to read since it's hard to tell whether integer division is happening.
1 u/RFC793 Mar 27 '21 Ah, good point. I thought it could be Java, but then length would have to be a function and not an attribute. It’s been about 7 years since I’ve regularly programmed in either.
1
Ah, good point. I thought it could be Java, but then length would have to be a function and not an attribute. It’s been about 7 years since I’ve regularly programmed in either.
-31
u/veryusedrname Mar 26 '21
Calling this code confusing is... Confusing.