|
Yeah, I thought you were using setcontext/getcontext, or longjmp, not inline assembly mangling %rsp.
|
# ? Dec 3, 2013 22:58 |
|
|
# ? Jun 5, 2024 08:41 |
|
This isn't a direct code horror, but a source control one. The TFS build agent has locked files for check-out. So I can't check anything in, because I can't merge changes with whatever the gently caress the build agent is doing. Someone gets paid to manage this TFS server, and they've mysteriously disappeared from their desk.
|
# ? Dec 4, 2013 21:49 |
|
Suspicious Dish posted:Yeah, I thought you were using setcontext/getcontext, or longjmp, not inline assembly mangling %rsp. To be fair, the ucontext functions don't work with backtrace either. sigaltstack probably breaks it, too.
|
# ? Dec 5, 2013 00:22 |
|
Tha Chodesweller posted:This isn't a direct code horror, but a source control one. Our internal source control tool was based on the ClearCase source code, licensed long ago. It has since diverged significantly. Do you enjoy config specs but loving hate GUI tools? Then congrats, because neither CCRC or the Windows GUI can speak our mangled version. But you sure can command line the gently caress out of some awful customized version of clear tool as you check in each file change individually.
|
# ? Dec 5, 2013 01:10 |
|
pseudorandom name posted:To be fair, the ucontext functions don't work with backtrace either. sigaltstack probably breaks it, too. I feel Apple would be less opposed to rejecting that as a bug, though.
|
# ? Dec 5, 2013 01:13 |
|
One of my coworkers was saddled with an abortion of a codebase from elsewhere in the company. Among many, many other horrors, this pattern shows up everywhere:Java code:
This is just wrong on so many levels, but I think the reason is that the previous developers were lovely MSVC++ developers and got used to the fact that that returns null if new can't work (which, of course is against the c++ standard). Apparently learning a new language was too much for them...
|
# ? Dec 5, 2013 19:51 |
|
The incompetent buffoons that wrote Earthlink's webmail system have it compose messages with only text/html data. No plain text fallback. The incompetent buffoons that used to work here wrote email import code that blindly trusts HTML email if there's no plain text fallback. It then displays that HTML inline in our ticketing system. No attempt at cleaning the HTML is made. Nobody noticed until the Earthlink morons started including a <style> tag that changes the body background. Anyone could send an email to our ticketing address right now and hijack any employee's browser, commit exploits, or even manipulate our internal systems. This has been true for eight years. I've worked here for seven. I've touched that code, I've fixed that code, but I never noticed how broken it was. It's me. I'm the coding horror.
|
# ? Dec 5, 2013 19:54 |
|
McGlockenshire posted:It's me. I'm the coding horror. Having been in a situation like this, I have to say that it isn't exactly your fault necessarily, you should trust your codebase to some extent. You shouldn't have to keep glancing up at the ceiling to make sure there's not a gaping hole in it. This gives you plausible deniability so you can point the finger to the lack of internal security audits.
|
# ? Dec 5, 2013 20:11 |
|
McGlockenshire posted:Earthlink I'm just surprised they're still around.
|
# ? Dec 5, 2013 22:04 |
I'm the coding horror today. At least, I was. I had a list of Room objects which had lists of other objects in them that I was serializing to/from a file. Saving the list, before: Loop through the Room list, loop through each Room's object list, serialize each object, write to stream, add 'seperator' bytes, encrypt, write to file (named after the Room), end up with dozens or hundreds of files. Saving the list, after: Serialize Room list, write to stream, encrypt, write to single file. Loading the list, before: Loop through each file in directory, create a room named after each file, open file stream, continue reading stream until 'seperator' bytes are detected, decrypt bytes, deserialize object from byte section, add object to room, repeat until end of stream, switch to next file. Loading the list, after: Open single file stream, decrypt, deserialize room list.
|
|
# ? Dec 5, 2013 22:20 |
|
McGlockenshire posted:No attempt at cleaning the HTML is made. I lied! php:<? if ($contentType == 'text/html') { $display['body'] = preg_replace('/<(script|iframe|frame|frameset|object)>.*?<\/\1>/','',$display['body']); $display['body'] = preg_replace('/<[\/]?noscript>/','',$display['body']); }?>
|
# ? Dec 6, 2013 01:29 |
|
Now just send an email containing <scr<script></script>ipt>alert('I quit');</script> and you're good to go
|
# ? Dec 6, 2013 01:34 |
|
Manslaughter posted:I'm the coding horror today. At least, I was. I had a list of Room objects which had lists of other objects in them that I was serializing to/from a file. I'm the horror, I don't understand the problem. Is the horror the before implementation?
|
# ? Dec 6, 2013 01:50 |
|
Yes. Why loop through and save hundreds or thousands of individual files when you can just serialize/deserialize the whole list at once, then write/read only one file? The only reason the former would be better I guess is if you knew you would need to get just a subset of those at some point?
|
# ? Dec 6, 2013 10:51 |
|
OK, I thought I was just overlooking something dumb in the before vs after conversion. Thanks.
|
# ? Dec 6, 2013 13:25 |
|
this is the kind of poo poo i come across on a regular basis.code:
|
# ? Dec 6, 2013 17:44 |
|
nite time dinosaur posted:sigh. i need to find a new job. At least their nonsense appears to have some sort of pattern, you could just have a grab bag of slop. I'd trade with you.
|
# ? Dec 6, 2013 18:40 |
|
EntranceJew posted:At least their nonsense appears to have some sort of pattern, you could just have a grab bag of slop. I'd trade with you. That's evidence of some seriously stupid cargo-cult programming. I would not want to work with developers who write code like that. If that's how they mangle a simple method, I'd hate to see what a complex method looks like.
|
# ? Dec 6, 2013 20:08 |
|
Other than the obvious, I'm really happy ReSharper has taught me to use ternary operators in an application like this. So much less bullshit than "if null." Having ReSharper and using lambda expressions all over the place has made me really lazy, and I don't think I could write a C++ program without being horribly frustrated anymore.
|
# ? Dec 6, 2013 20:55 |
|
Tha Chodesweller posted:I don't think I could write a C++ program without being horribly frustrated anymore. Pretty common condition.
|
# ? Dec 6, 2013 21:02 |
|
JawnV6 posted:Pretty common condition. It's not a good one in my position, we do C++ at school, this semester I just had zero programming courses.
|
# ? Dec 6, 2013 21:43 |
|
Tha Chodesweller posted:Other than the obvious, I'm really happy ReSharper has taught me to use ternary operators in an application like this. So much less bullshit than "if null." Yeah I am writing C++ today it is bullshit.
|
# ? Dec 6, 2013 21:50 |
|
Just ran into this.code:
|
# ? Dec 6, 2013 22:55 |
|
nite time dinosaur posted:this is the kind of poo poo i come across on a regular basis. I'm the completely unused second parameter.
|
# ? Dec 7, 2013 03:22 |
|
Tha Chodesweller posted:Other than the obvious, I'm really happy ReSharper has taught me to use ternary operators in an application like this. So much less bullshit than "if null."
|
# ? Dec 7, 2013 10:24 |
|
Rottbott posted:But C++ has lambdas...? Half the fun of lambdas is usually that they magically capture the lexical environment, and in C++ it's just not sufficiently magic to actually make things easier.
|
# ? Dec 7, 2013 17:04 |
|
I don't get it. They can capture from the outer scope automatically, and are certainly much easier than ye olde functors.
|
# ? Dec 7, 2013 17:36 |
|
The capture rules for c++ lambdas are even really simple, too.
|
# ? Dec 7, 2013 18:29 |
|
C# lambdas are actually somehow more clunky than C++ lambdas because you have to spell their type explicitly. (I've had bad experiences with their auto-capturing behavior, too, although I was probably doing something I wasn't supposed to do.) C++ lambdas definitely don't have the convenient elegance that makes them fun to play with in functional languages, but C# lambdas sure the hell don't either. e: I suppose it's only fair to note that in C# lambdas you can use type inference for the parameters, which you can't do in C++ (until C++14 apparently). raminasi fucked around with this message at 22:47 on Dec 7, 2013 |
# ? Dec 7, 2013 21:07 |
|
GrumpyDoctor posted:C# lambdas are actually somehow more clunky than C++ lambdas because you have to spell their type explicitly. (I've had bad experiences with their auto-capturing behavior, too, although I was probably doing something I wasn't supposed to do.) C++ lambdas definitely don't have the convenient elegance that makes them fun to play with in functional languages, but C# lambdas sure the hell don't either. I'm confused. Where do you have to specify a type when using lambdas in C#?
|
# ? Dec 7, 2013 21:14 |
|
When you assign them. e.g. you can't infer the return type of (i: int) => i.ToString() as Func<int, String>
|
# ? Dec 7, 2013 21:25 |
|
Sedro posted:When you assign them. e.g. you can't infer the return type of (i: int) => i.ToString() as Func<int, String> The reason for that is that the type is ambiguous between Func<int, String> and Expression<Func<int, String>>
|
# ? Dec 7, 2013 21:34 |
|
Adahn the nameless posted:The reason for that is that the type is ambiguous between Func<int, String> and Expression<Func<int, String>> The fact that there's a reason for it (which I don't think anyone here wasn't aware of) doesn't make it not annoying.
|
# ? Dec 7, 2013 22:45 |
|
Then again, how often do you really need to assign a lambda to a variable? I use them every day and 99% of the time they are provided as function call arguments, e.g.code:
code:
|
# ? Dec 9, 2013 09:00 |
|
EssOEss posted:Then again, how often do you really need to assign a lambda to a variable? I use them every day and 99% of the time they are provided as function call arguments, e.g. In C#, I made an extension method to Action, and I was hoping I'd be able to do this: (()=>Foo()).SomeFluentMethod I couldn't, of course. I had to either cast (which is ugly) or stick it into an explicitly-provided type.
|
# ? Dec 9, 2013 13:53 |
|
EssOEss posted:Then again, how often do you really need to assign a lambda to a variable? I use them every day and 99% of the time they are provided as function call arguments, e.g. I usually run into this when I'm trying to stuff some gnarly predicate into a call to Where or something and my choices are to write a ten-million-character-long line, stick a multiline anonymous function into an already-multiline LINQ chain, write the predicate as its own named function that makes absolutely no sense outside of this particular context, or store the predicate in a variable. I agree that this is a 1% case, but it does happen.
|
# ? Dec 9, 2013 19:15 |
|
Found an old project me and a friend did at school. Two highlights: code:
code:
"There has to be a better way.." "Yes." "Do you know of any?" "No." "Me neither, moving on." EDIT: It was even so horrible it broke tables Claeaus fucked around with this message at 21:12 on Dec 9, 2013 |
# ? Dec 9, 2013 20:53 |
|
Not so much a coding horror, more of a horror in code. We have a client who exports a large chunk of product data from SAP, and we import it automatically. It's a very hands off process, and if there is a problem it's usually 99.9% the fault of the client not adhering to the spec. We do validation of all the files they send us, and usually we have some error that looks like this. "SKU was referenced in Catalogue but definition was not found in SKU definition file (file.txt), please check your SKU export and try again". After weeks of back and forth of him constantly asking what this meant, and us having to explain the above as "Yeah you defined a SKU id as being a part of your catalogue, but you never exported this product along with the others". The error is now "Hey X, remember when we said you have to export the skus, well yeah you missed SKU id Y, so go back and make sure you set it up k? Grand thanks!"
|
# ? Dec 10, 2013 10:11 |
|
Recently, I saw this...code:
|
# ? Dec 10, 2013 22:31 |
|
|
# ? Jun 5, 2024 08:41 |
|
Is that UB if one translation unit has private functions and another has all public functions?
|
# ? Dec 11, 2013 00:36 |