|
The exciting follow-up to "I hate graphic designers." main nav example: code:
substitute fucked around with this message at 16:35 on Feb 21, 2014 |
# ? Feb 21, 2014 06:38 |
|
|
# ? May 28, 2024 16:08 |
|
I sincerely hope that's generated code. Code generated by a tool produced in 2004.
|
# ? Feb 21, 2014 07:24 |
|
EntranceJew posted:I sincerely hope that's generated code. Code generated by a tool produced in 2004. Well, no. The "senior" graphic designer, in 2014, typed/copy-pasted that out to get started on a new project that is, supposedly, due in a week (because of a publication / product ad). I am not kidding.
|
# ? Feb 21, 2014 08:10 |
|
Jewel posted:I forgot we talked about this DON'T START ANYTHING we've done it before see this post if you want to see the discussion on it. Move along I was just about to link that.
|
# ? Feb 21, 2014 08:43 |
substitute posted:The exciting follow-up to "I hate graphic designers." Maybe he was just trying to have his very own spaceship battle? code:
code:
Him: "No, AND. It's in (). Do I need to do it in multiple SELECTs?" I want to cry. Sulla Faex fucked around with this message at 12:46 on Feb 21, 2014 |
|
# ? Feb 21, 2014 12:44 |
I wrote him the correct query, or at least syntactically-correct query (who knows what the gently caress he needs it to do), and ten minutes later he asks me if this next query is correct:code:
|
|
# ? Feb 21, 2014 12:57 |
|
Why are you still working with him? It's obvious he doesn't understand basic logic.
|
# ? Feb 21, 2014 13:01 |
The project is almost over, it's a tiny company, and I'm not responsible for hiring/firing. Well, I say the project is almost over, but it could go on for months and months more.. The only way to survive is to shrug, pretend you didn't see all the poo poo you just saw, and collect your paycheque. I can't do anything to fix the situation and I've been sick for at least 6 weeks straight now, with maybe 2-3 periods of 3 days "recovery" between each bout, so I'm not signing up to get involved in this stuff. I make sure my work is done, I help them when they ask, and that's the extent of it. They're paid the exact same as me, for reference, so I'm not going to go out of my way to nanny them, teach them common sense, or cover for them. I just need to vent sometimes :x
|
|
# ? Feb 21, 2014 13:04 |
|
Suspicious Dish posted:Booked a flight on JetBlue instead. Did you really need to include the '.', though?
|
# ? Feb 21, 2014 21:12 |
|
Nf3 posted:Did you really need to include the '.', though? Both TSA agents and airline personnel can be incredibly anal about any minuscule discrepancies between what a ticket says and what someone's ID says. I don't blame him at all for deciding to play it safe.
|
# ? Feb 21, 2014 21:16 |
|
Found this gem in the documentation for Android's WebView: I have no idea why this is exposed in the webkit api.
|
# ? Feb 22, 2014 00:05 |
|
Uncomfortable Gaze posted:Found this gem in the documentation for Android's WebView: quote:Added in API level 1 Lots of dumb/optimistic stuff was done when android first launched. Not all of it was a great idea.
|
# ? Feb 22, 2014 00:16 |
|
code:
|
# ? Feb 22, 2014 09:29 |
|
Where did you find that? It's not in any publicly released version of libsecurity_ssl I could find, like this one: http://opensource.apple.com/source/libsecurity_ssl/libsecurity_ssl-55003/lib/sslKeyExchange.c?txt
|
# ? Feb 22, 2014 09:35 |
|
Wait, wouldn't that just cause the validation to always fail, not always succeed?
|
# ? Feb 22, 2014 09:43 |
|
Suspicious Dish posted:Where did you find that? It's not in any publicly released version of libsecurity_ssl I could find, like this one: http://opensource.apple.com/source/Security/Security-55471/libsecurity_ssl/lib/sslKeyExchange.c?txt vOv posted:Wait, wouldn't that just cause the validation to always fail, not always succeed? If the second goto is hit what is the value of err?
|
# ? Feb 22, 2014 09:48 |
|
apseudonym posted:If the second goto is hit what is the value of err? ... oh, duh.
|
# ? Feb 22, 2014 09:49 |
|
Wow. Braces could have saved the day. That is perversely amusing to me. For want of a brace, the kingdom was lost? I dunno. I swear I had something for this.
|
# ? Feb 22, 2014 10:16 |
|
teamdest posted:Wow. Braces could have saved the day. That is perversely amusing to me. Any of:
|
# ? Feb 22, 2014 13:01 |
|
apseudonym posted:
I'm really trying, but I can't understand what's the error. apseudonym posted:If the second goto is hit what is the value of err? code:
|
# ? Feb 22, 2014 14:04 |
|
there's two "goto fail" and no braces for the various "if" statements. They wanted: error_condition = <some combination of checks i don't care enough about SSL to investigate>. If those checks come to 0, we're okay, carry on. if those checks are >0, fail. it does that, sets "err" to 0 appropriately. then it hits the second "goto fail" no matter what because it's not actually part of the if statement. because they didn't use braces. because someone wanted to "save" 6 characters of typing. so the "err" is 0 but we fail anyway, and fail just puts us all the way at the end, past the actual SSL checking bullshit. This whole function goes "error was 0, everything's fuckin' good mate, carry the gently caress on we're safe as houses", but didn't do the ACTUAL IMPORTANT PARTS OF SSL BULLSHIT. because "oh it's only a one-line check" or "it's cleaner and easier to read this way" or something equally stupid. edit: this is the specific issue: if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail;
|
# ? Feb 22, 2014 14:19 |
|
HardDisk posted:I'm really trying, but I can't understand what's the error. code:
Now the verification method never gets called and the method that called this function thinks it succeeded because err = 0. So never actually verify the certificate, but report success. Bruegels Fuckbooks fucked around with this message at 14:21 on Feb 22, 2014 |
# ? Feb 22, 2014 14:19 |
|
To be honest, I'm taking this more as a lesson in why we don't use gotos then a lesson in correct bracket usage.
|
# ? Feb 22, 2014 14:50 |
|
Sir_Substance posted:To be honest, I'm taking this more as a lesson in why we don't use gotos then a lesson in correct bracket usage. Two lines of "return err" at that position cause the same problem and don't use goto, so I think you're taking the wrong lesson. Also isn't there a "code is trivially unreachable" compiler warning?
|
# ? Feb 22, 2014 15:18 |
pokeyman posted:Also isn't there a "code is trivially unreachable" compiler warning? What's the chance it's drowning in hundreds of other warnings?
|
|
# ? Feb 22, 2014 15:23 |
|
I get that this is a serious thing, especially in light of the NSA social engineering stuff going on, all that poo poo, but seriously: 1) It's really obviously one of those "Never ascribe to malice" situations. 2) It's also a blatant violation of at least 9 of the 4 rules of code safety. The more I think about it, the stranger and funnier it gets. I hope this winds up as one of those "object lessons we joke about" for the next twenty years. "Why is use of brackets important, kids?" <Sigh> "Because nobody wants to be apple." or as a Stop, Drop, Roll kind of ingrained lesson. "What do you do when you get a compiler warning, kids?" "Stop, Question Assumptions, Call your Code Buddy!" It's like a beautiful flower of avoidable bad decisions and shortcuts.
|
# ? Feb 22, 2014 15:54 |
|
teamdest posted:"Stop, Question Assumptions, Call your Code Buddy!" I'm gonna start using this with my middle-schoolers.
|
# ? Feb 22, 2014 16:04 |
|
I woke up to an IOS update because of an SSH issue. Little did I know I'd be reading about it an hour later in coding horrors thread. Sidenote: the contract I work on explicitly forbids omitting the brackets. It's one of the only code style requirements, in fact it might be the only one. I feel like it's sort of a silly requirement because as ctz mentioned, there are at least 6 other things you should be doing that would stop you from making this error. Then again, it can be a real problem.
|
# ? Feb 22, 2014 16:20 |
|
Sir_Substance posted:To be honest, I'm taking this more as a lesson in why we don't use gotos then a lesson in correct bracket usage. "if (error) goto fail" is an pretty common C construction when you aren't using exceptions, since otherwise you'd have to build the "failure" code path through conditionals the rest of the through the function, which would be way more error prone.
|
# ? Feb 22, 2014 16:21 |
|
evensevenone posted:"if (error) goto fail" is an pretty common C construction when you aren't using exceptions, since otherwise you'd have to build the "failure" code path through conditionals the rest of the through the function, which would be way more error prone. As opposed to C with exceptions? Exceptions would be better than retvals if morons didn't sprinkle catch(...) {} all over codebases.
|
# ? Feb 22, 2014 16:42 |
|
nielsm posted:What's the chance it's drowning in hundreds of other warnings? Good point.
|
# ? Feb 22, 2014 16:54 |
|
Sir_Substance posted:To be honest, I'm taking this more as a lesson in why we don't use gotos then a lesson in correct bracket usage. Using gotos in cleanup code like this is fine and perfectly acceptable. It's also very common in kernel (de)initialization type stuff too.
|
# ? Feb 22, 2014 16:59 |
|
Bruegels Fuckbooks posted:Exceptions would be better than retvals if morons didn't sprinkle catch(...) {} all over codebases. On the other hand, you have morons using goto statements. Which is worse?
|
# ? Feb 22, 2014 17:49 |
|
Bruegels Fuckbooks posted:As opposed to C with exceptions? There are C implementations of exceptions out there, it's just not provided by the language or standard library. I know this because I had to use one for a while, and it was awful.
|
# ? Feb 22, 2014 17:56 |
|
Sir_Substance posted:To be honest, I'm taking this more as a lesson in why we don't use gotos then a lesson in correct bracket usage. Sorry but gotos are very useful in c when you're doing lots of things that can fail and need to unwind and do cleanup in a sane way. The take away should be where the gently caress was the review on that change? Someone made a dumb mistake and no one noticed.
|
# ? Feb 22, 2014 17:58 |
|
Steve French posted:There are C implementations of exceptions out there, it's just not provided by the language or standard library. Yeah, I consider not having exceptions a feature, not a bug. I loving love integrating with libraries that throw exceptions in higher level languages, it's definitely my favorite part of writing glue code that makes poo poo talk to poo poo.
|
# ? Feb 22, 2014 18:16 |
|
goto should no longer be considered harmful in 2014 when we have so many more control structures available to us now, such as "while".
|
# ? Feb 22, 2014 18:29 |
|
goto fail; indeed
|
# ? Feb 22, 2014 18:44 |
|
Compiling C without -Wall -Werror or the moral equivalent is a horror.
|
# ? Feb 22, 2014 19:00 |
|
|
# ? May 28, 2024 16:08 |
|
HORATIO HORNBLOWER posted:Compiling C without -Wall -Werror or the moral equivalent is a horror. Worse is all the people complaining about "the nanny compiler".
|
# ? Feb 22, 2014 19:07 |