|
what is desired_val even doing?
|
# ? Jun 29, 2013 21:01 |
|
|
# ? May 17, 2024 14:36 |
|
Good luck if desired_key happens to be an integer or a valid value in data.
|
# ? Jun 29, 2013 21:16 |
|
Gul Banana posted:what is desired_val even doing? I think it was intended to be returned if nothing else was, but then the 'programmer' forgot. Every time I re-read the code something new pops out at me. So many bad things at once I can't see them all in a single viewing...
|
# ? Jun 29, 2013 21:24 |
|
QuarkJets posted:
the real travesty here is that the list was named "indexes" instead of "indices".
|
# ? Jun 29, 2013 21:42 |
|
I stopped reading at the weird overparenthesization.
|
# ? Jun 29, 2013 21:58 |
|
Ronald Raiden posted:the real travesty here is that the list was named "indexes" instead of "indices". That's just the icing on the cack.
|
# ? Jun 29, 2013 22:16 |
|
shrughes posted:I stopped reading at the weird overparenthesization. I only spot maybe 3 instances where dropping parentheses makes sense; two if statements that don't need them, and one more at the return. Although it's not like this hurts anything. There are a bunch of things wrong with this code, but using parentheses in an if statement isn't one of them
|
# ? Jun 29, 2013 22:30 |
|
In Python it's considered bad practice to use parenthesis for a 'simple' if statement. Just use the 'if' and ':' unless you need to specify ordering. Personally I still add the brackets so non-Python programmers don't ask me about it when checking over my code. e: removed typo Tesseraction fucked around with this message at 23:05 on Jun 29, 2013 |
# ? Jun 29, 2013 22:44 |
|
QuarkJets posted:I only spot maybe 3 instances where dropping parentheses makes sense; two if statements that don't need them, and one more at the return. Although it's not like this hurts anything. There are a bunch of things wrong with this code, but using parentheses in an if statement isn't one of them When judging somebody by their code you can just stop when you see the parenthesis style being weird. That the person who wrote this code is too mentally deficient to just let go of his way of doing things and follow the obvious Python standard is enough to categorize this as bad code.
|
# ? Jun 29, 2013 22:49 |
|
shrughes posted:When judging somebody by their code you can just stop when you see the parenthesis style being weird. That the person who wrote this code is too mentally deficient to just let go of his way of doing things and follow the obvious Python standard is enough to categorize this as bad code. I wouldn't call it "obvious"; PEP8 suggests wrapping long if statement expressions with parentheses, so it'd be easy for a new Python programmer to see an example of that, get confused and start putting parentheses in all of their if statements. Again, this is probably the most inconsequential and minor complaint that you could possibly raise regarding that code
|
# ? Jun 29, 2013 23:40 |
|
Dirk Pitt posted:I work with people who take this line of thinking to the extreme and say tests are a waste of time. According to some, the only way to test an app is manually. No mention of why we have had to issue a fix for 1500+ bugs in the first year this app has been in production. It sounds like they're horrible at it, because the right way to take that line of thinking to an extreme is to write proofs that your code operates as specified. If they're not writing tests and not writing proofs, it sounds like they're lazy and looking for excuses to not write the "boring" code more than anything else. (It's rather difficult to follow that development style for application code, but if instead you're building a well-specified library it's actually very worthwhile. I wouldn't recommend eschewing tests entirely, but proving your code to be correct is better than trying to catch every possible edge case in a test.)
|
# ? Jun 30, 2013 07:12 |
|
Tesseraction posted:I think they want to get the specific index of the key, which is pretty terrible as dict doesn't maintain order when built, so good job to that guy for not checking data structure implementations. In our testing setup, dict order is intentionally shuffled every time a test is ran, so as to not rely on a fixed order for tests. I think it is a great idea.
|
# ? Jun 30, 2013 12:40 |
|
Chin Strap posted:In our testing setup, dict order is intentionally shuffled every time a test is ran, so as to not rely on a fixed order for tests. I think it is a great idea. This is also the default in Python 3.3 and is optional in 2.7; the hash seed is randomized every time the interpreter is started.
|
# ? Jun 30, 2013 15:59 |
|
Tesseraction posted:In Python it's considered bad practice to use parenthesis for a 'simple' if statement. Just use the 'if' and ':' unless you need to specify ordering. The parentheses in "if (condition): " aren't hurting anybody.
|
# ? Jun 30, 2013 16:43 |
|
I mean the parentheses are bad and all but he's searching a dictionary in linear time
|
# ? Jun 30, 2013 18:19 |
|
fritz posted:The parentheses in "if (condition): " aren't hurting anybody. Yep, I was just explaining shrughes' comment as not many people know about that particular element of the syntax. Bracketing the statement isn't a syntax error so many people don't necessarily know it's considered 'bad practice.' ninepints posted:I mean the parentheses are bad and all but he's searching a dictionary in linear time This is definitely the issue of it. It's a wonderful complement of misunderstanding of dictionaries, misuse of iteration and no understanding of the enumeration functions. Each issue is a fold on the errors previous.
|
# ? Jun 30, 2013 18:58 |
|
Bunny Cuddlin posted:So this MySQL bug has been open for seven years as of today and someone... well... I think https://bugzilla.mozilla.org/show_bug.cgi?id=238041 deserves the same treatment. PYF bugs that are older than all your friends' kids.
|
# ? Jul 1, 2013 20:08 |
|
Munkeymon posted:I think https://bugzilla.mozilla.org/show_bug.cgi?id=238041 deserves the same treatment. Things which have happened during the timeframe that this bug has been open - We have seen two Papal elections, three Presidential elections, and four new members of the Supreme Court - The Red Sox broke their curse - Hurricanes Katrina and Sandy - The Space Shuttle program was reinstated, and then terminated - The iPhone (hell, six iPhones) - Steve Jobs came out that he had cancer, had surgery, had more surgery several years later, then died - Duke Nukem Forever shipped
|
# ? Jul 1, 2013 21:36 |
|
Munkeymon posted:I think https://bugzilla.mozilla.org/show_bug.cgi?id=238041 deserves the same treatment. Does Eclipse have text wrap yet?
|
# ? Jul 1, 2013 21:53 |
|
From sun.misc.FloatingDecimal:code:
|
# ? Jul 1, 2013 23:52 |
|
1337JiveTurkey posted:From sun.misc.FloatingDecimal: That code will be old enough to vote in next year's mid-term elections. I think I have a new example to explain technical debt...
|
# ? Jul 2, 2013 00:47 |
|
I give you, Coding Horrors: The Movie https://www.youtube.com/watch?v=THERgYM8gBM I lost my poo poo at "...Batman!"
|
# ? Jul 2, 2013 17:22 |
|
My stack trace code:
|
# ? Jul 2, 2013 20:43 |
|
Zaphod42 posted:I give you,
|
# ? Jul 3, 2013 00:50 |
|
http://codex.wordpress.org/Updating_WordPress
|
# ? Jul 3, 2013 01:14 |
|
Zaphod42 posted:I give you, Why am I not surprised the man talking about Ruby is a smug condescending little poo poo?
|
# ? Jul 3, 2013 01:16 |
|
shrughes posted:Why am I not surprised the man talking about Ruby is a smug condescending little poo poo? x 1000 And none of it is really condescending anyway it's just pointing out goofy unexpected behaviors without any context because it's a goofy five minute lightning talk
|
# ? Jul 3, 2013 01:21 |
|
shrughes posted:Why am I not surprised the man talking about Ruby is a smug condescending little poo poo? Nice!
|
# ? Jul 3, 2013 01:53 |
|
Zaphod42 posted:I give you, For anyone who is curious why the javascript stuff happens the way it does, there's an explanation here
|
# ? Jul 3, 2013 02:11 |
|
I always get a giggle out of this one: http://codex.wordpress.org/Editing_wp-config.php "Please, do not edit this Codex Page with the settings for your own server as you are giving the world access to your website's MySQL password, and will not make your install work. Thanks." e: So I actually looked at that and gee, that's a really bad idea. There are a number of plugins, if I recall, that do stuff requiring access to the filesystem by using ssh, why not use that?
|
# ? Jul 3, 2013 05:03 |
|
RICHUNCLEPENNYBAGS posted:I always get a giggle out of this one: http://codex.wordpress.org/Editing_wp-config.php (search for 'Reverted' and hit Prev to see what they're reverting, which seems to usually be credentials) http://codex.wordpress.org/index.php?title=Editing_wp-config.php&diff=102567&oldid=102561
|
# ? Jul 3, 2013 05:10 |
|
Munkeymon posted:PYF bugs that are older than all your friends' kids. This one is absolutely amazing: Firefox can't position scrollbars properly in textareas. I've ran into it so often, and there's simply no solution other than having no padding in textareas for firefox users.
|
# ? Jul 3, 2013 10:17 |
|
geonetix posted:This one is absolutely amazing: Firefox can't position scrollbars properly in textareas. I've ran into it so often, and there's simply no solution other than having no padding in textareas for firefox users. The best part is people appear to have been actively working on this bug for about a year now, with no resolution.
|
# ? Jul 3, 2013 13:03 |
|
RICHUNCLEPENNYBAGS posted:So I actually looked at that and gee, that's a really bad idea. There are a number of plugins, if I recall, that do stuff requiring access to the filesystem by using ssh, why not use that?
|
# ? Jul 3, 2013 14:05 |
|
LoseThos is now TempleOS and has an incredible video on the front page.
|
# ? Jul 3, 2013 15:31 |
|
seiken posted:LoseThos is now TempleOS and has an incredible video on the front page. That website confuses and scares me.
|
# ? Jul 3, 2013 15:34 |
|
I can't find a single thing that isn't wrong with that site and that video and that OS. And oh my god that bird. That bird. Edit: "And he walks the wrong way. I'unno why I did that.... H-hheh hehh I'm not a pedophile hheh!" Jewel fucked around with this message at 16:07 on Jul 3, 2013 |
# ? Jul 3, 2013 16:03 |
|
seiken posted:LoseThos is now TempleOS and has an incredible video on the front page. This is part of the Half-Life 3 ARG, I'm sure of it.
|
# ? Jul 3, 2013 16:32 |
|
When I show people projects like my VM I often wonder if I come across like the LoseThos guy.
|
# ? Jul 3, 2013 16:36 |
|
|
# ? May 17, 2024 14:36 |
|
God likes six-forty by four-eighty because it's good for children doing art.
|
# ? Jul 3, 2013 16:39 |