|
ZorbaTHut posted:You'd say "optimize it for 5 seconds!" and boy howdy it would optimize that sucker for exactly 5 realtime seconds. Regardless of how much CPU it was actually getting during that time. And to make things worse, it was buggy. So, depending on how much CPU it got . . . well, it might just spit out invalid assembly once in a while. Simulated annealing? By any chance did the assembler documentation mention a "temperature schedule"?
|
# ? Nov 5, 2009 18:20 |
|
|
# ? Apr 27, 2024 18:20 |
|
Fecotourist posted:Simulated annealing? By any chance did the assembler documentation mention a "temperature schedule"? I fail to believe anyone would have done this except perhaps out of spite or as an attempt at humor.
|
# ? Nov 5, 2009 18:59 |
|
Fecotourist posted:Simulated annealing? By any chance did the assembler documentation mention a "temperature schedule"? I pray to God that it did not, but honestly it was more blackboxy than that. You just said "optimize for X seconds!" and sometimes it did. It would not entirely surprise me if, on the inside, it did exactly that.
|
# ? Nov 5, 2009 19:55 |
|
code:
|
# ? Nov 6, 2009 08:48 |
|
spotted today:code:
|
# ? Nov 6, 2009 20:29 |
|
BigRedDot posted:spotted today: what the gently caress is CalcWhatever? is there an actual signature for it? what is it supposed to do?
|
# ? Nov 6, 2009 20:31 |
|
BigRedDot posted:spotted today: The biggest shock is that the couple of templates that are involved there are not the reason that error message is a horror.
|
# ? Nov 6, 2009 21:41 |
|
I'm not going to post the code, but this description is painful enough: We have a SOAP service that accepts one argument... strXML. Whoever wrote this thing didn't really understand why you would want to use a webservice. Instead of just connecting via a client of my choice and calling the method remotely with a few arguments, I have to go look up API documentation to remember what methods are exposed by this service and then generate an XML document to pass as my argument... which in turn gets encapsulated in XML. Good job, developer.
|
# ? Nov 6, 2009 21:41 |
|
BigRedDot posted:spotted today: What is an unaigned int ??
|
# ? Nov 6, 2009 21:43 |
|
No Safe Word posted:What is an unaigned int ??
|
# ? Nov 6, 2009 21:56 |
|
Presto posted:An off-by-one error. 's' - 'a' != 1
|
# ? Nov 6, 2009 22:59 |
|
king_kilr posted:'s' - 'a' != 1 holy loving poo poo
|
# ? Nov 6, 2009 23:00 |
|
king_kilr posted:'s' - 'a' != 1 Look at this guy here
|
# ? Nov 6, 2009 23:01 |
|
csammis posted:holy loving poo poo Perhaps king_kilr is German.
|
# ? Nov 6, 2009 23:03 |
|
code:
|
# ? Nov 6, 2009 23:45 |
|
Not so much code but the amount of people we see interviewing for our team who can't describe any sorting algorithms other than perhaps bubble sort and think that searching an ordered array takes O(sqrt(n)) time (or sometimes O(1/2 n) time) is pretty depressing It's also quite frightening when most of these people have decades of experience on their CV. Obviously a cursory examination of the internet suggests that these people are pretty much the bottom of the barrel, so why aren't we getting anything better than this? FWIW this is investment banking, so I assume the pay being offered is pretty competitive.
|
# ? Nov 7, 2009 00:45 |
|
king_kilr posted:
look at your keyboard
|
# ? Nov 7, 2009 00:47 |
|
Mr Dog posted:O(1/2 n) Also an unaigned int is what you get when you have to type that much crap by hand because the dev box is airgapped.
|
# ? Nov 7, 2009 00:57 |
|
BigRedDot posted:LOL Except those optimized versions that run in O(1/2) ! I've seen someone use the term O(0). That must be a pretty drat efficient algorithm.
|
# ? Nov 7, 2009 01:18 |
|
yaoi prophet posted:look at your keyboard oh... I don't want to talk about it, mine's still sort of funny thought... right?
|
# ? Nov 7, 2009 01:42 |
|
Mr Dog posted:Not so much code but the amount of people we see interviewing for our team who can't describe any sorting algorithms other than perhaps bubble sort and think that searching an ordered array takes O(sqrt(n)) time (or sometimes O(1/2 n) time) is pretty depressing I assume it's because HR screened everyone first. Ensuring team work and communication skills triumphs IT skills FSMC fucked around with this message at 10:31 on Nov 7, 2009 |
# ? Nov 7, 2009 01:57 |
|
Mr Dog posted:why aren't we getting anything better than this?
|
# ? Nov 7, 2009 05:34 |
|
I'm working on a tile-based project with someone else, and they were doing the code for calculating the coordinates of the tile the mouse is over when you press the button. He had a huge series of if statements using the coordinates of the mouse to find the correct row and then column. I don't think he was happy when I replaced 500 lines of his code with 5 of mine.
|
# ? Nov 7, 2009 13:32 |
|
blueberrypudding posted:I'm working on a tile-based project with someone else, and they were doing the code for calculating the coordinates of the tile the mouse is over when you press the button. So what exactly did those 500 lines do? I don't think I could write 500 lines for something that simple even if I tried.
|
# ? Nov 7, 2009 15:49 |
|
Broken Knees Club posted:So what exactly did those 500 lines do? I don't think I could write 500 lines for something that simple even if I tried. if(x<=10) tilex=0; else if(x<=20) tilex=1; And so on. It's not that hard.
|
# ? Nov 7, 2009 15:58 |
|
Broken Knees Club posted:So what exactly did those 500 lines do? I don't think I could write 500 lines for something that simple even if I tried. code:
|
# ? Nov 7, 2009 16:03 |
|
blueberrypudding posted:
He hardcoded it?! Please tell me he used constants and did not actually write out _xmouse>=10.
|
# ? Nov 7, 2009 17:05 |
|
Broken Knees Club posted:He hardcoded it?! I just had a look and it's actually 200 lines, and he didn't quite write it out. It makes me cringe to see this! code:
|
# ? Nov 7, 2009 17:12 |
|
Oh my god it's actually worse. e: it just hit me that he's using a ton of if clauses and not if else. So every time this runs, everything has to be evaluated even if you already found your position. Also the variable i is freaking me out. And the fact that you have two variables called thiscol and thisrow. You have to post the whole thing.
|
# ? Nov 7, 2009 18:04 |
|
Eh, if the guy isn't a hobbyist then it's a complete nightmare-level horror. I say cut the guy some slack. We all had to be that guy at some point in our learning of computer programming. What makes a coding horror to me is really based on how many years of school the person who wrote the code had, how many years of prior experience, and how much he got paid to write said code. If all of those are close to 1 or zero, then c'mon, how much can you really expect? There's also bonus points if the code is already used in production somewhere, and double bonus if it could kill people due to a bug. ErIog fucked around with this message at 23:33 on Nov 7, 2009 |
# ? Nov 7, 2009 23:31 |
|
ErIog posted:Eh, if the guy isn't a hobbyist then it's a complete nightmare-level horror. I say cut the guy some slack. We all had to be that guy at some point in our learning of computer programming. Well blueberry did say that it's a tile-based project, so it's probably a hobby or possibly an assignment. But still, I'm a newbie, started programming from absolute zero about six months ago, have never written a line of C/C++ in my life and can still avoid writing that sort of code. I mean, if you see a ton of ifs like that and do not immediately think of a loop, then it's a logic problem, not a programming horror. I completely agree with your second statement though.
|
# ? Nov 7, 2009 23:56 |
|
Broken Knees Club posted:Well blueberry did say that it's a tile-based project, so it's probably a hobby or possibly an assignment. But still, I'm a newbie, started programming from absolute zero about six months ago, have never written a line of C/C++ in my life and can still avoid writing that sort of code. I mean, if you see a ton of ifs like that and do not immediately think of a loop, then it's a logic problem, not a programming horror. Hahahaha a LOOP?
|
# ? Nov 8, 2009 19:07 |
|
markerstore posted:Hahahaha a LOOP? I don't get it either. A simple calculation would do.
|
# ? Nov 8, 2009 19:19 |
|
markerstore posted:Hahahaha a LOOP? Yes? You can collapse all of those ifs into a loop and have it do the same thing. Obviously it's the Wrong Way but it should be obvious even for a total newbie. As an aside, I also made a tile-based project. It did not have loops.
|
# ? Nov 8, 2009 20:14 |
|
Broken Knees Club posted:Yes? You can collapse all of those ifs into a loop and have it do the same thing. Obviously it's the Wrong Way but it should be obvious even for a total newbie. If you see a ton of if statements like that, and your first impulse is to replace them with a loop, then you're fixing the wrong problem. And you're probably just making things even less clear than they were before.
|
# ? Nov 8, 2009 20:39 |
|
markerstore posted:Hahahaha a LOOP? http://thedailywtf.com/Articles/The_FOR-CASE_paradigm.aspx
|
# ? Nov 8, 2009 20:46 |
|
mr_jim posted:If you see a ton of if statements like that, and your first impulse is to replace them with a loop, then you're fixing the wrong problem. And you're probably just making things even less clear than they were before. Yes, that is exactly what I said.
|
# ? Nov 8, 2009 21:13 |
|
Broken Knees Club posted:Yes, that is exactly what I said. How are "It should occur to you to replace them with a loop" and "It should not occur to you to replace them with a loop" the "exact" same things?
|
# ? Nov 8, 2009 22:49 |
|
blueberrypudding posted:I just had a look and it's actually 200 lines, and he didn't quite write it out. It makes me cringe to see this! code:
|
# ? Nov 8, 2009 23:24 |
|
|
# ? Apr 27, 2024 18:20 |
|
GrumpyDoctor posted:How are "It should occur to you to replace them with a loop" and "It should not occur to you to replace them with a loop" the "exact" same things? I don't know. I give up.
|
# ? Nov 8, 2009 23:32 |