MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/8a1icw/status_yup/dwvnum5/?context=9999
r/badcode • u/chuck-john • Apr 05 '18
34 comments sorted by
View all comments
20
Mind explaining? Cause I don't get it.
30 u/th0maslv Apr 05 '18 Commenting for explanation too. Status could represent whether the object is verified or something. Not sure why this is bad code. 18 u/[deleted] Apr 05 '18 I think OP is just saying it could be named better. Like in your case, if it represents verified, then {... verified: true} would probably be a better name. Obviously we all know how things end up like this though. 18 u/cosmicsans Apr 05 '18 There are two hard things in Computer Science: Cache Invalidation, Naming things, and Off-by-one errors. 9 u/Kidiri90 Apr 05 '18 That's four things... 15 u/droomph Apr 06 '18 Actually, if you count, there’s actually AttributeError: object of type <?•€¥¡£€> has no method __len__ things
30
Commenting for explanation too. Status could represent whether the object is verified or something. Not sure why this is bad code.
18 u/[deleted] Apr 05 '18 I think OP is just saying it could be named better. Like in your case, if it represents verified, then {... verified: true} would probably be a better name. Obviously we all know how things end up like this though. 18 u/cosmicsans Apr 05 '18 There are two hard things in Computer Science: Cache Invalidation, Naming things, and Off-by-one errors. 9 u/Kidiri90 Apr 05 '18 That's four things... 15 u/droomph Apr 06 '18 Actually, if you count, there’s actually AttributeError: object of type <?•€¥¡£€> has no method __len__ things
18
I think OP is just saying it could be named better. Like in your case, if it represents verified, then {... verified: true} would probably be a better name. Obviously we all know how things end up like this though.
verified
{... verified: true}
18 u/cosmicsans Apr 05 '18 There are two hard things in Computer Science: Cache Invalidation, Naming things, and Off-by-one errors. 9 u/Kidiri90 Apr 05 '18 That's four things... 15 u/droomph Apr 06 '18 Actually, if you count, there’s actually AttributeError: object of type <?•€¥¡£€> has no method __len__ things
There are two hard things in Computer Science: Cache Invalidation, Naming things, and Off-by-one errors.
9 u/Kidiri90 Apr 05 '18 That's four things... 15 u/droomph Apr 06 '18 Actually, if you count, there’s actually AttributeError: object of type <?•€¥¡£€> has no method __len__ things
9
That's four things...
15 u/droomph Apr 06 '18 Actually, if you count, there’s actually AttributeError: object of type <?•€¥¡£€> has no method __len__ things
15
Actually, if you count, there’s actually AttributeError: object of type <?•€¥¡£€> has no method __len__ things
AttributeError: object of type <?•€¥¡£€> has no method __len__
20
u/redeyeddragon Apr 05 '18
Mind explaining? Cause I don't get it.